Running Scripts vs Interactive mode

Ben Finney ben+python at benfinney.id.au
Thu Feb 24 00:54:22 CET 2011


grobs456 <gregory.alexander.roberts at gmail.com> writes:

> I am trying to work through the tutorial at:
> http://docs.python.org/tutorial/

Excellent! I heartily encourage everyone to do this when learning
Python: *work through* (not just read) the tutorial. Good for you!

> I realize I can double click on a .py file and Windows treats it as an
> executable but the command prompt pops in and out so quickly that I
> can't see the results of my script.

Don't do that, then :-)

You can open a persistent terminal window, and run the program from the
command line.

> I would prefer to follow along with the tutorial, compiling new ticks
> and topics into a growing .py file

Not a good idea; the exercises aren't meant to be all run in an
ever-growing single program. You should instead make a directory of
small programs that are independent, one for each exercise.

> Python is installed at:
> C:\Python27
>
> and I ran:
> set path=%path%;C:\python27
> #do i have to run the above each time I open up a session?

You should be able to set that value persistently. (I don't wash
Windows, so I don't know what you need to do there.)

> #Also, note that  I do not see the any system environment variables
> get updated when I run the above.

Right, that's only for the current environment (generally, one program
and any of its child processes). You'll need to find how to set
environment variables in your login profile if you want that to persist.


Good hunting.

-- 
 \        “Good judgement comes from experience. Experience comes from |
  `\                              bad judgement.” —Frederick P. Brooks |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list