Python windows interactive.

notejam notejam at sbcglobal.net
Tue Oct 31 01:15:32 CET 2006


Thanks everyone for the help.   I got a simple two line program to work
from a text file.
Can not figure out how to write more than one line in interpreter mode.
 Is that all interpreter is good for, testing one liners?  I have it
run the program everytime I hit return, and can not figure out how to
enter multiple lines of code.  I can do multiple lines in text file, so
no problem, but I am jsut wondering can a program with 2 or more lines
be wrote from the interpreter mode?





Larry Bates wrote:
> notejam wrote:
> > I am trying to get started with a interactive version of Python for
> > windows and need some help.
> > I have played with the tutorial, and now want to write a program.
> >
> > In basic language, I could write something like
> > 10 print "hello"
> > 20 print "Jim"
> >
> > and if I run it I would get
> > hello
> > Jim
> >
> > How do I do sometihing simple like that in python?
> > How do I enter line numbers, or if none, what do I do.
> > Can the interpreter load a text file with my program in it?
> > How do I list a program or the parts of a program I am interested in
> > looking at?
> >
> > How do I run a python program?
> >
> Start with the tutorial here:
>
> http://docs.python.org/tut/tut.html
>
> Your program in python would be:
>
> print "hello"
> print "jim"
>
> You don't have line numbers in Python
>
> Yes the interpreter can load a text file with your program.
> A good "beginners" version of Python for windows is:
>
> http://www.activestate.com/Products/ActivePython/?tn=1
>
> It has an easy to use interpreter window with both your
> program and interactive prompt open on the screen.
>
> To run a program you click run icon.  To run outside the
> interpreter you type python programname.py
> 
> -Larry




More information about the Python-list mailing list