Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   What do I need to know in order to write a web application in python? (http://www.velocityreviews.com/forums/t744581-what-do-i-need-to-know-in-order-to-write-a-web-application-in-python.html)

ErichCart ErichCart 03-04-2011 08:08 PM

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?

Corey Richardson 03-04-2011 08:21 PM

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.

Turn-based would be much easier.

--
Corey Richardson

ErichCart ErichCart 03-04-2011 08:34 PM

Re: What do I need to know in order to write a web application in python?
 
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?

Corey Richardson 03-04-2011 08:48 PM

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.

John Gordon 03-04-2011 09:04 PM

Re: What do I need to know in order to write a web application in python?
 
In <67a0332e-aa25-4bc6-a0b5-0f68f597b6b9@y14g2000vbb.googlegroups.com> ErichCart ErichCart <erichcart@gmail.com> writes:

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

--
John Gordon A is for Amy, who fell down the stairs
gordon@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"


ErichCart ErichCart 03-04-2011 09:48 PM

Re: What do I need to know in order to write a web application in python?
 
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?

Corey Richardson 03-04-2011 10:07 PM

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.

--
Corey Richardson

John Gordon 03-04-2011 10:10 PM

Re: What do I need to know in order to write a web application in python?
 
In <1b0d04db-c45d-481d-b19e-03ba2d2a5495@p16g2000vbo.googlegroups.com> ErichCart ErichCart <erichcart@gmail.com> 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?


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

--
John Gordon A is for Amy, who fell down the stairs
gordon@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"


Paul Rubin 03-05-2011 02:07 AM

Re: What do I need to know in order to write a web application in python?
 
ErichCart ErichCart <erichcart@gmail.com> 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.

Grumman 03-05-2011 02:37 AM

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?


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




All times are GMT. The time now is 07:17 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.