Re: Python windows interactive.



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

.



Relevant Pages

  • Re: 2.6, 3.0, and truly independent intepreters
    ... simple have the python language and the sip/PyQt modules available to ... All we wanted to do was embed the interpreter and language core as ... unloaded many many times in a host app. ... but lack of multiple load and unload support has been another painful ...
    (comp.lang.python)
  • Re: Python vs. Lisp -- please explain
    ... forever from potential Python users. ... and any change to the interpreter is a change to the program. ... with a Lisp chip. ... to say that Python does not compile to machine code. ...
    (comp.lang.python)
  • Re: 2.6, 3.0, and truly independent intepreters
    ... given all the great things about python. ... the machine's multiple cores to the fullest, ... fresh dynamic lib for each thread-independent interpreter (you can't ... be developed, it would be very attractive for companies to support, ...
    (comp.lang.python)
  • Re: 2.6, 3.0, and truly independent intepreters
    ... resident video) from the child process back to the parent process. ... An example would be python scripts that generate video programatically ... into its interpreter. ... documented otherwise) is that the app can make as many contexts as its ...
    (comp.lang.python)
  • Re: More than you ever wanted to know about objects [was: Is everything a refrence or isnt it]
    ... >Please note that I *am* oversimplifying here, and the nitpickers will ... >that they can pick up the details as they need them, which 98% of Python ... the interpreter goes down the ... >If the interpreter keeps walking up the inheritance tree in this way ...
    (comp.lang.python)