#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    1
    Rep Power
    0

    Help around understanding python for web


    Hi I recently purchased the book "RealPython" and I've been scripting some apps on my own in Idle. Right now my intention is to start developing web apps. To acheive this I am going to use web2py framework but I have a hard time understanding how things work.


    For example, here is an app I made in Idle:
    which runs under "question("x")"

    def question(x):
    x = raw_input("What do you want? ")
    z = raw_input("Why do you want it? ")
    z = z.replace("my", "your")
    z = z.replace("I", "you")
    print "So you want", x, z
    print " "
    a = raw_input("and why do you want that? ")
    a = a.replace("because I want", "")
    print " "
    print "so you want",a
    print " "
    b = raw_input("And why do you want that? ")
    print " "
    print b, "- that's what's purposeful to you "



    Now this is all fine.. but I can't just simply copy and paste this into web2py or load it as a module or something because it doesn't contain text fields on the screen or even a location where the output text will be shown and I have absolutely no idea how to do that or how to wrap my head around that.

    Any help would be greatly appreciated
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    138
    Rep Power
    2
    Originally Posted by Nswayze22
    [...]

    Now this is all fine.. but I can't just simply copy and paste this into web2py or load it as a module or something because it doesn't contain text fields on the screen or even a location where the output text will be shown and I have absolutely no idea how to do that or how to wrap my head around that.

    Any help would be greatly appreciated
    You'll need to create a form for input and output. Google for "web2py form example" or search on the web2py website.

IMN logo majestic logo threadwatch logo seochat tools logo