Newbie question about running scripts
Joshua Macy
l0819m0v0smfm001 at sneakemail.com
Sat Oct 6 08:56:07 EDT 2001
Lenny wrote
> My questions are:
> 1.) Do I have to save my scripts to a certain folder that Python
> created for me or one I make for them?
No.
>
> 2.) Do I have to change something in the registry about the PATH even
> though Python appears to have a Python Path entry already in the
> memory?
>
No, the installer handled this for you (or you wouldn't see the black
box, even temporarily, when you tried running Python from the Run menu).
> 3.) Is the RUN window the window they mean as the "Command Prompt
> Window"?
>
No, they mean the MS-DOS Command window; you should be able to find
this somewhere in the Start Menu. If you see a black box pop up when
you run python from Run Commands (or by double-clicking on the .py file
you created in Explorer), that means it's working--at least to the
extent of finding python.exe in the path. Unfortunately, the command
box started that way doesn't hang around after the program completes; if
you put a line at the end of the program that prompts for input, it
should wait for you to type something, but it's easier and better to
start the MS-DOS Command prompt yourself, and then it will be there
until you dismiss it.
Better still, you should probably try learning Python (at least on
Windows, where the command line isn't natural) from within an IDE
(integrated development environment). If you use the Pyton install from
python.org it should have installed IDLE; run IDLE from the Start Menu
or by double-clicking on its icon in Explorer and you get an IDE with
(among other things) a Python-aware text editor (color coding syntax,
tool-tip hints for method and function completion, auto-indenting) and
an interactive Python prompt. The only thing to be aware of is that
when you run a program from within the text window, you may have to
switch to the Interactive Prompt window (if it's not visible) to see the
output.
The ActiveState Python distribution has a similar (more native
Windowsy-looking) IDE called PythonWin. You can also use IDLE, but you
have to download it from python.org, I think.
One last note, Python 2.2 is currently an alpha release, not even
beta, which means they are still shaking the bugs out--you should
probably back down to 2.1, which is the latest production release.
>
> Does anyone suggest a certain online tutorial or other learning
> method.
You could take a look at Dive into Python at
http://www.diveintopython.org or at How to Think Like a Computer
Scientist, In Python at
http://www.andamooka.org/reader.pl?section=thinkpython
but the Python Tutorial that comes with Python is pretty good, I think.
It sounds more like you're just having a little trouble getting
started because Windows likes to get in the way of simple things like
using a command line interface. Once you start using one of the Python
IDEs, things will be a lot more Windowsy and you should find the going
smoother, at least until you start trying to write your own GUI
interface or multi-threaded programs (where trying to run from within an
IDE poses some gotchas). But when and if you get there, there are
people on comp.lang.python who can help you out.
Hope this helped, and welcome to Python.
Joshua
More information about the Python-list
mailing list