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

Discussion in 'Python' started by ErichCart ErichCart, Mar 4, 2011.

  1. 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?
    ErichCart ErichCart, Mar 4, 2011
    #1
    1. Advertising

  2. 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
    Corey Richardson, Mar 4, 2011
    #2
    1. Advertising

  3. 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?
    ErichCart ErichCart, Mar 4, 2011
    #3
  4. 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.
    Corey Richardson, Mar 4, 2011
    #4
  5. ErichCart ErichCart

    John Gordon Guest

    In <> ErichCart ErichCart <> 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
    B is for Basil, assaulted by bears
    -- Edward Gorey, "The Gashlycrumb Tinies"
    John Gordon, Mar 4, 2011
    #5
  6. 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?
    ErichCart ErichCart, Mar 4, 2011
    #6
  7. 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
    Corey Richardson, Mar 4, 2011
    #7
  8. ErichCart ErichCart

    John Gordon Guest

    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?


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

    --
    John Gordon A is for Amy, who fell down the stairs
    B is for Basil, assaulted by bears
    -- Edward Gorey, "The Gashlycrumb Tinies"
    John Gordon, Mar 4, 2011
    #8
  9. ErichCart ErichCart

    Paul Rubin Guest

    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.
    Paul Rubin, Mar 5, 2011
    #9
  10. ErichCart ErichCart

    Grumman Guest

    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/
    Grumman, Mar 5, 2011
    #10
  11. ErichCart ErichCart

    CM Guest

    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).
    CM, Mar 5, 2011
    #11
  12. ErichCart ErichCart

    CM Guest

    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).
    CM, Mar 5, 2011
    #12
  13. ErichCart ErichCart

    CM Guest

    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).
    CM, Mar 5, 2011
    #13
  14. 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".
    ErichCart ErichCart, Mar 5, 2011
    #14
  15. 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.

    --
    Corey Richardson
    Corey Richardson, Mar 5, 2011
    #15
  16. ErichCart ErichCart

    CM Guest

    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.
    CM, Mar 5, 2011
    #16
  17. 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/


    Also www.dabodev.com

    --
    --OKB (not okblacke)
    Brendan Barnwell
    "Do not follow where the path may lead. Go, instead, where there is
    no path, and leave a trail."
    --author unknown
    OKB (not okblacke), Mar 5, 2011
    #17
  18. 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.

    Geremy Condra

    [0]: http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/
    geremy condra, Mar 5, 2011
    #18
  19. 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.
    ErichCart ErichCart, Mar 6, 2011
    #19
  20. ErichCart ErichCart

    John Pinner Guest

    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.


    Yay, looks good. Thanks, Greg.

    John
    --
    John Pinner, Mar 6, 2011
    #20
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DP
    Replies:
    0
    Views:
    1,130
  2. Hemkesh
    Replies:
    1
    Views:
    350
    Nigel Wade
    Feb 20, 2009
  3. Andries

    I know, I know, I don't know

    Andries, Apr 23, 2004, in forum: Perl Misc
    Replies:
    3
    Views:
    222
    Gregory Toomey
    Apr 23, 2004
  4. sahm
    Replies:
    4
    Views:
    673
  5. Aseem Bansal
    Replies:
    22
    Views:
    229
    Schneider
    Sep 26, 2013
Loading...

Share This Page