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

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?

Advertisements

Re: What do I need to know in order to write a web application inpython?

On 03/04/2011 03:08 PM, ErichCart ErichCart wrote:
> 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.

Advertisements

Re: What do I need to know in order to write a web application inpython?

On 03/04/2011 03:34 PM, ErichCart ErichCart wrote:
> 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.

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?

Re: What do I need to know in order to write a web application inpython?

On 03/04/2011 04:48 PM, ErichCart ErichCart wrote:
> 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.

In <> ErichCart ErichCart <> writes:
> 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?

ErichCart ErichCart <> writes:
> 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.

Re: What do I need to know in order to write a web application inpython?

On 3/4/2011 16:48, ErichCart ErichCart wrote:
>
> 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?

On Mar 4, 5:07 pm, Corey Richardson <> wrote:
> On 03/04/2011 04:48 PM, ErichCart ErichCart wrote:
>
> > 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.

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).

On Mar 4, 5:07 pm, Corey Richardson <> wrote:
> On 03/04/2011 04:48 PM, ErichCart ErichCart wrote:
>
> > 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.

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).

On Mar 4, 5:07 pm, Corey Richardson <> wrote:
> On 03/04/2011 04:48 PM, ErichCart ErichCart wrote:
>
> > 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.

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).

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".

Re: What do I need to know in order to write a web application inpython?

On 03/05/2011 06:49 AM, ErichCart ErichCart wrote:
> 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.

On Mar 5, 6:49 am, ErichCart ErichCart <> wrote:
> 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.

Grumman wrote:
> On 3/4/2011 16:48, ErichCart ErichCart wrote:
>>
>> 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/

Re: What do I need to know in order to write a web application inpython?

On Sat, Mar 5, 2011 at 3:49 AM, ErichCart ErichCart <> wrote:
> 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.

On Mar 5, 7:42 pm, geremy condra <> wrote:
> On Sat, Mar 5, 2011 at 3:49 AM, ErichCart ErichCart <>wrote:
> > 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,

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.

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!