Totally new to programming

I'm totally new to programming and I'm going to try to learn Python. I have been to several sites, mainly Python.org, and downloaded Python 2.3 which is really cool. I'm sure I'll have a million questions as I go along, most of which I can figure out myself or Googlesearch, but I haven't figured this one out yet.

I have been doing a tutorial on Python.org that shows the very basics, and gives a program to try. The problem I'm having is that after I type a line (Ex:print "whatever"), it immediately does the command. My question is this: How do I write the program and then run it when I'm done, instead of having it execute all of the commands as I go along? Or, if executing the commands during programming is normal, then how do I run the entire program when I'm finished?
Is there another program I need to download?

OK, that's 3 questions, sorry.;)

Any suggestions would me greatly appreciated.

Comments

  • : I'm totally new to programming and I'm going to try to learn Python. I have been to several sites, mainly Python.org, and downloaded Python 2.3 which is really cool. I'm sure I'll have a million questions as I go along, most of which I can figure out myself or Googlesearch, but I haven't figured this one out yet.
    :
    : I have been doing a tutorial on Python.org that shows the very basics, and gives a program to try. The problem I'm having is that after I type a line (Ex:print "whatever"), it immediately does the command. My question is this: How do I write the program and then run it when I'm done, instead of having it execute all of the commands as I go along? Or, if executing the commands during programming is normal, then how do I run the entire program when I'm finished?
    : Is there another program I need to download?
    :
    : OK, that's 3 questions, sorry.;)

    Python is one of the few languages that gives you an interactive interpreter, which is what you've been using. To run the program separately, you just put all of the commands into a plain text file. If you're using IDLE or PythonWin as your interactive interpreter, you should be able to File->New to create a new file. Type all of your commands in there and save it. Now you can run the script as a standalone program.


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

  • : I'm totally new to programming and I'm going to try to learn Python. I have been to several sites, mainly Python.org, and downloaded Python 2.3 which is really cool. I'm sure I'll have a million questions as I go along, most of which I can figure out myself or Googlesearch, but I haven't figured this one out yet.
    :
    : I have been doing a tutorial on Python.org that shows the very basics, and gives a program to try. The problem I'm having is that after I type a line (Ex:print "whatever"), it immediately does the command. My question is this: How do I write the program and then run it when I'm done, instead of having it execute all of the commands as I go along? Or, if executing the commands during programming is normal, then how do I run the entire program when I'm finished?
    : Is there another program I need to download?
    :
    : OK, that's 3 questions, sorry.;)
    :
    : Any suggestions would me greatly appreciated.
    :
    use a text editor (such as simpletext(mac), pico(linux) or notepad(win)
    to write your python code. use the apropriate extension (think it's .py)
    as I haven't used python in a long time, try googling .py, or python files. Oh, and to run it, try to (at command line) say:
    python myfirstpythonprog.py

    as I'm really not sure, I would suggest that you google.
    hope my answers help your searching.

    titanium_geek


  • [b][red]This message was edited by Kylixen at 2003-12-30 17:8:35[/red][/b][hr]
    Also note that if you are using it in linux, you can form it as a shell script by putting "#!/usr/bin/python" thats of course, assuming that that is the directory to your python executable. This will keep you from having to type python filename.py, you will just type ./filename.py which will also make it easier when trying to run it from another script. **side note: Just incase the reader doesn't know, you must change the permissions on the file to make it executable, for everyone to have complete access to it try, "chmod 777 filename.py".

    : I'm totally new to programming and I'm going to try to learn Python. I have been to several sites, mainly Python.org, and downloaded Python 2.3 which is really cool. I'm sure I'll have a million questions as I go along, most of which I can figure out myself or Googlesearch, but I haven't figured this one out yet.
    :
    : I have been doing a tutorial on Python.org that shows the very basics, and gives a program to try. The problem I'm having is that after I type a line (Ex:print "whatever"), it immediately does the command. My question is this: How do I write the program and then run it when I'm done, instead of having it execute all of the commands as I go along? Or, if executing the commands during programming is normal, then how do I run the entire program when I'm finished?
    : Is there another program I need to download?
    :
    : OK, that's 3 questions, sorry.;)
    :
    : Any suggestions would me greatly appreciated.
    :

    -- Kylixen



  • : I'm totally new to programming and I'm going to try to learn Python. I have been to several sites, mainly Python.org, and downloaded Python 2.3 which is really cool. I'm sure I'll have a million questions as I go along, most of which I can figure out myself or Googlesearch, but I haven't figured this one out yet.
    :
    : I have been doing a tutorial on Python.org that shows the very basics, and gives a program to try. The problem I'm having is that after I type a line (Ex:print "whatever"), it immediately does the command. My question is this: How do I write the program and then run it when I'm done, instead of having it execute all of the commands as I go along? Or, if executing the commands during programming is normal, then how do I run the entire program when I'm finished?
    : Is there another program I need to download?
    :
    : OK, that's 3 questions, sorry.;)
    :
    : Any suggestions would me greatly appreciated.
    :


    -IMBO-
    i dont really get what you mean but if it is what i'm thinking then all you got to do is go to file, then new window.(if your running in windows) dunno about a unix base. that should put you in a blank window and out of the interactive shell.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories