Running test01.py under Windows (basic level)
Gabriel Genellina
gagsl-py2 at yahoo.com.ar
Thu Feb 28 19:07:32 EST 2008
En Thu, 28 Feb 2008 21:05:45 -0200, K Viltersten <tmp1 at viltersten.com>
escribió:
> I have v2.5.2 installed and i've composed
> a source code i'm sure everybody will be
> impressed by. It goes like this.
>
> def bloppA ():
> print "a very advanced piece of code"
>
> What i get to work is to make it run from
> the the snakes shell. Then, i realised
> that such a masterpiece needs storing in
> a file. So i saved it in a file called
> great.py but when i executed:
To execute the file, use:
python great.py
from the system prompt (cmd).
Or, if you are using IDLE (the snake's shell?), go to File -> Open, open
your saved file, and use the Run menu (or press F5).
> exec "c:\loj\python\great.py"
That's the way to exec another script from inside the current one; it's
seldom used. Beware of \ as it's the escape character (as in C), so you
have to use "c:\\loj\\python\\great.py" or r"c:\loj\python\great.py" (the
latter being a "raw string").
See the wiki http://wiki.python.org/moin/BeginnersGuide - have you worked
out the Tutorial?
> (Background: I'm a programmer since a few
> years back but it's mostly Java/C/C++/C#
> and Python way is very new to me.)
You may benefit from the Dive into Python book, available online at
http://www.diveintopython.org (somewhat old now, but most of the book is
still aplicable; it just misses the new features in the language)
--
Gabriel Genellina
More information about the Python-list
mailing list