Python

Discussion in 'Programming' started by BOOMBOOM, Apr 24, 2009.

  1. #1
    I am learning Python, (But I like to call it Pythong) and have a few questions to anybody who knows this language.

    1. How do I save my program to be viewed on a computer that does not have pythong installed? Doesn't .py files open only when you have pythong installed?

    2. How do you create a GUI?

    Well, that is pretty much it for now... If anybody can answer this for me, I would greatly appreciate it...:D
     
    BOOMBOOM, Apr 24, 2009 IP
  2. BOOMBOOM

    BOOMBOOM Peon

    Messages:
    196
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    BOOMBOOM, Apr 24, 2009 IP
  3. BOOMBOOM

    BOOMBOOM Peon

    Messages:
    196
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Since there is no section for Python, I guess I will post all of my questions under this thread.

    I have obtained a script that asks for the user to enter their name. Once the user enters their name and hits enter, an automatic response comes up saying Hi name.

    I want to take this a step farther and ask the user how they are doing. If the user enters bad, then the reply will be, sorry to hear that + name. If the user enters good, then the reply will be something different. Here is what I have so far:

    x = raw_input("Enter name:")
    print "Hey " + x
    raw_input("How Are You:" ) + x
    if input = ("bad")
    print "sorry to hear that " + x
    raw_input("Press<enter>")
    Code (markup):
    I know that I am the noobest of the noobs, but I don't think I have the proper syntax or commands. Can anybody help with this? This would actually open some doors up for me and better understand Python... Thank you to anybody who can help... :)
     
    BOOMBOOM, Apr 24, 2009 IP
  4. NuLLByTe

    NuLLByTe Active Member

    Messages:
    382
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    80
    #4
    
    x = raw_input("Enter name:")
    print "Hey " + x
    y = raw_input("How Are You:")
    if y == "bad":
            print "sorry to hear that " + x
    raw_input("Press<enter>")
    
    Code (markup):
     
    NuLLByTe, Apr 24, 2009 IP
  5. BOOMBOOM

    BOOMBOOM Peon

    Messages:
    196
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    WOW!!!!

    It works... :D Too cool and thank you!!!!!

    Now I can add all kinds of different things like:

    x = raw_input("Enter name:")
    print "Hey " + x
    y = raw_input("How Are You:")
    if y == "bad":
            print "sorry to hear that " + x
    if y == "good":
            print "glad to hear that " + x
    raw_input("Press<enter>")
    
    Code (markup):
     
    BOOMBOOM, Apr 24, 2009 IP
  6. cormack2009

    cormack2009 Peon

    Messages:
    177
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    0
    #6
    Python is more an interpreted language, kinda of script language.
    Not really to make GUIs, no matter it can be donde, but thats out of the real use of python.
    If you want to learn windows programming, go direct to .NET (its easier than Python) or C.
     
    cormack2009, Apr 25, 2009 IP
  7. NuLLByTe

    NuLLByTe Active Member

    Messages:
    382
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    80
    #7
    No it is not easier. And you can make really great stuff with Python, see "Frets on Fire", it is made using PyGame.
     
    NuLLByTe, Apr 25, 2009 IP
  8. BOOMBOOM

    BOOMBOOM Peon

    Messages:
    196
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #8
    YES PyGame!!! I just found this yesterday and installed it!!! Maybe I can make an actual game.
     
    BOOMBOOM, Apr 26, 2009 IP