What do I need to know in order to write a web application in python?

  • Thread starter ErichCart ErichCart
  • Start date
E

ErichCart ErichCart

I am currently a Computer Science student, I can write in pascal, C,
and Java, and recently I learned about Python and fell in love with
it. I watched some python programming tutorials on youtube, and now I
can write some programs.
But what I really want to do is to make a website where people can
play real-time RISK game online with other players.

Can this be done in Python 3.2?
What do I need to know in order to make such a website? Which Python
modules will I need to use?
 
C

Corey Richardson

I am currently a Computer Science student, I can write in pascal, C,
and Java, and recently I learned about Python and fell in love with
it. I watched some python programming tutorials on youtube, and now I
can write some programs.
But what I really want to do is to make a website where people can
play real-time RISK game online with other players.

Can this be done in Python 3.2?
What do I need to know in order to make such a website? Which Python
modules will I need to use?

Real-time? As in viewing the same board like people would in real-life?
I would say that's a job for Java or Flash. You could pull off something
with Javascript and XMPP (bad choice? I don't know), in which case
Python would be on the server directing the game logic and sending the
proper messages to the players.

So look into XMPP (xmpppy or Twisted Words are your choices, I guess)
and learn up on Javascript.

That's my take on it, at least. I'm sure someone with more experience
could direct you more specifically.

Turn-based would be much easier.
 
E

ErichCart ErichCart

It is just that I want to better my python skills by doing this.

I have heard about Django, can't this be done with Django?
 
C

Corey Richardson

It is just that I want to better my python skills by doing this.

I have heard about Django, can't this be done with Django?

As you described it? Absolutely not [1]. When thinking of Django, think
more of Ruby on Rails or something vaguely along the lines of PHP. If
you want to improve your Python skills, this is a poor project unless
you already have plenty of experience designing fairly complex systems
with many interoperating parts.

Take all the things you did in school for C etc. and implement them in
Python. That's a good start, so you're more familiar with the language
compared to the ones you currently know. And then you can try a web app
with Django, but I suggest Pyramid instead.

--
Corey Richardson

[1] - Well, kinda. You could have Django driving the back-end and maybe
use AJAX and have the client poll the server every second or so for a
change in the game state, but that'd be needlessly complex and
resource-consuming compared to other systems.
 
J

John Gordon

In said:
It is just that I want to better my python skills by doing this.
I have heard about Django, can't this be done with Django?

Django does help with web content, but it doesn't (as far as I know) have
any way to do real-time.

Traditional web applications are not real-time. The user has to make a
choice and then click a Submit button in order to see results, which may
or may not be the way you want your game to operate.

Perhaps you could elaborate on what you meant by "real-time".
 
E

ErichCart ErichCart

By real-time, I mean that I want it to be similar to the way instant
online chess works. Something like here: instantchess.com, but for
RISK.

I thought about making such an application, and now that I want to
practice python I thought that perhaps it can be done with python.
Now after your answers it seems like a hard task not suitable for a
beginner.

But really, I just want to make something useful with python. All I
can do now, is console programs, and that doesn't seem very user
friendly.

In fact this doesn't necessary need to be web application. For example
I have a friend who uses Delphi, and he can create all sorts of
windows applications easily, like he can see the window on the screen
and he can place buttons, text fields, radio buttons etc. wherever he
wants and then program the actions of each element. I was able to do
the same with visual basic in one of my university classes.

What do I need to know in order to be able to do the same with python?
Which python modules/python development environments do I need to use?
 
C

Corey Richardson

In fact this doesn't necessary need to be web application. For example
I have a friend who uses Delphi, and he can create all sorts of
windows applications easily, like he can see the window on the screen
and he can place buttons, text fields, radio buttons etc. wherever he
wants and then program the actions of each element. I was able to do
the same with visual basic in one of my university classes.

What do I need to know in order to be able to do the same with python?
Which python modules/python development environments do I need to use?

As far as I know, no tools exist to make developing desktop apps in
Python like there do VB. However I can recommend a few desktop toolkits.
Qt (pyqt or pyside) and Gtk (pygtk) seem to be popular, and I think
Pygui will be becoming popular as it becomes more complete / more
examples/tutorials using it become available. Tkinter is easy to use and
comes right in the standard library.
 
J

John Gordon

In said:
By real-time, I mean that I want it to be similar to the way instant
online chess works. Something like here: instantchess.com, but for
RISK.

That site appears to require a monthly fee, so it may not be a good
vehicle for demonstrating requirements to a broad audience.
I thought about making such an application, and now that I want to
practice python I thought that perhaps it can be done with python.
Now after your answers it seems like a hard task not suitable for a
beginner.

I would agree. Learning Python is enough of a task by itself; adding
website design *and* real-time interaction on top of that is probably
too much.
What do I need to know in order to be able to do the same with python?
Which python modules/python development environments do I need to use?

You might try learning Tkinter; it is python's standard GUI interface
package.
 
P

Paul Rubin

ErichCart ErichCart said:
By real-time, I mean that I want it to be similar to the way instant
online chess works. Something like here: instantchess.com, but for
RISK.

If you want to do that in a web browser, the main technique for it is
called AJAX and you'd write your application in Javascript. There are
some good libraries including jquery that can help. A little bit of web
surfing about AJAX and Jquery can find you more info. Another approach
is as a desktop GUI app with its own socket communications layer, but
that way seems to be going out of style as AJAX has gotten more
powerful. Finally you can write in Actionscript which runs in the
browser's Flash plug-in. I guess this is also popular (lots of Facebook
games use it) but I put it last because I hate Flash.
 
G

Grumman

In fact this doesn't necessary need to be web application. For example
I have a friend who uses Delphi, and he can create all sorts of
windows applications easily, like he can see the window on the screen
and he can place buttons, text fields, radio buttons etc. wherever he
wants and then program the actions of each element. I was able to do
the same with visual basic in one of my university classes.

What do I need to know in order to be able to do the same with python?
Which python modules/python development environments do I need to use?

You might want to look at: http://visualpython.org/
 
C

CM

As far as I know, no tools exist to make developing desktop apps in
Python like there do VB.

Boa Constructor is a visual GUI builder and IDE for desktop apps that
was
written to be a kind of Delphi for Python. I've used it happily for a
long
time. As the OP mentioned, it can allow visual designing of the GUI
(like placing
buttons, etc.), plus tons more. It's not actively developed anymore,
though,
and it is somewhat buggy on Linux (don't know on Mac).
 
C

CM

As far as I know, no tools exist to make developing desktop apps in
Python like there do VB.

Boa Constructor is a visual GUI builder and IDE for desktop apps that
was written to be a kind of Delphi for Python. I've used it happily
for a long time. Like the OP mentioned, it can allow visual designing
of the GUI (like placing buttons, etc.), plus tons more. It's not
actively developed anymore, though, and it is somewhat buggy on Linux
(don't know on Mac).
 
C

CM

As far as I know, no tools exist to make developing desktop apps in
Python like there do VB.

For desktop applications that use the wxPython toolkit for the GUI,
Boa Constructor is a visual GUI builder and IDE that was written to be
a kind of Delphi for Python. I've used it happily for a long time. As
the OP mentioned, it can allow visual designing of the GUI (like
placing buttons, etc.), plus tons more. It's not actively developed
anymore, though, and it is somewhat buggy on Linux (don't know on
Mac).
 
E

ErichCart ErichCart

Visual Python seems to be exactly what I want. But it doesn't seem
very popular. Perhaps it means that there are not many people who will
be able to help if I have problems with it. Also judging by the amount
of ads at visualpython.org, it also doesn't seem very serious.

I looked into pyGTK, and I found something called "Glade", which seems
to be something similar to visual python. The latest version of Glade
was released just this month, so it seems to be actively developed.

Regarding Boa constructor, it is very old, isn't it? The latest news
from this project date to the end of 2006. I don't expect it to
support python 3 any time soon.

So, "Glade", is this what everybody uses? I mean programmers don't
just use text editors to make GUI applications, do they?


That site appears to require a monthly fee, so it may not be a good
vehicle for demonstrating requirements to a broad audience.

Actually you can play 10 games per day for free, or at least it was
like that when I used it last time. Just enter some random name and
press "start game".
 
C

Corey Richardson

So, "Glade", is this what everybody uses? I mean programmers don't
just use text editors to make GUI applications, do they?

I usually see people using Qt and QtDesigner over Gtk and Glade. And
actually, yes, I'm sure lots of people besides me actually make their
GUI apps in a text editor. Then again, I usually don't do anything big.
If you want to learn your GUI toolkit well, do it by hand and not by
tool. As someone said to me once, "QtDesigner is meant for people who
already know how to use Qt". I'm sure the same applies for Glade.
 
C

CM

Regarding Boa constructor, it is very old, isn't it? The latest news
from this project date to the end of 2006. I don't expect it to
support python 3 any time soon.

The website is incredibly out of date, but the last major update was
July 2007. So, yes. Like any snake, it could suddenly rear up and
spring to life with a new version, but there is no way to know when or
if that will happen. Even wxPython itself doesn't support Python 3
yet, so I'm not sure I'd let that deter you. It seems like many third
party libraries haven't updated to Python 3 yet and may not for some
time to come.

All this said, one can build a toy GUI application using Boa, Python
2.5 or 2.6 and wxPython 2.8.x.x. in 5 minutes if you know what you're
doing. And you can build a larger and real application that way, too.
 
G

geremy condra

Visual Python seems to be exactly what I want. But it doesn't seem
very popular. Perhaps it means that there are not many people who will
be able to help if I have problems with it. Also judging by the amount
of ads at visualpython.org, it also doesn't seem very serious.

I looked into pyGTK, and I found something called "Glade", which seems
to be something similar to visual python. The latest version of Glade
was released just this month, so it seems to be actively developed.

Regarding Boa constructor, it is very old, isn't it? The latest news
from this project date to the end of 2006. I don't expect it to
support python 3 any time soon.

So, "Glade", is this what everybody uses? I mean programmers don't
just use text editors to make GUI applications, do they?

Yes, they do. It isn't that bad once you get used to it, and it beats
the snot out of trying to maintain the insensible gibberish that some
of the autogen tools put out.

On a side note, you should check out pygui[0]- very, very nice GUI toolkit.

Geremy Condra

[0]: http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/
 
E

ErichCart ErichCart

QT Designer looks very nice.
I hope I can use it with PySide. I would rather use PySide than PyQT,
because PyQT is not under LGPL license.
 
J

John Pinner

Yes, they do. It isn't that bad once you get used to it,
Agreed.

and it beats
the snot out of trying to maintain the insensible gibberish that some
of the autogen tools put out.

I have a lot of experience with Qt Designer, I don't know about any of
the other tools:

1. Qt Designer produces sensible well-formed XML, not gibberish.
2. The whole point of the tool is that you should _never_ have to edit
the code it
produces - if you need to extend ui designs, you do this by sub-
classing.
On a side note, you should check out pygui[0]- very, very nice GUI toolkit.

Yay, looks good. Thanks, Greg.

John
--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,787
Messages
2,569,630
Members
45,334
Latest member
66Zeinab9

Latest Threads

Top