SV: Running test01.py under Windows (basic level)
- From: "K Viltersten" <tmp1@xxxxxxxxxxxxxx>
- Date: Fri, 29 Feb 2008 05:30:43 +0100
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:
python great.py
from the system prompt (cmd).
Or, if you are using IDLE ...
File -> Open, open your saved file, and use the Run menu (or press F5).
There will be poking around with %PATH%, i can tell. Never liked to do that under Windows.
Beware of \ as it's the escape character, so you have to use "c:\\loj\\python\\great.py" or r"c:\loj\python\great.py"...
I've tried to add the extra backslashes (or "r"
attribute) but i still get the same error at the colon. Should i understand that i made two
mistakes (the first being not using double "\"
and the second calling exec alltogether)?
http://wiki.python.org/moin/BeginnersGuide - have you worked out the Tutorial?
Not yet. I started off using some small things.
I tend to learn by doing. Or rather making. A
lot of errors, that is. :)
(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 http://www.diveintopython.org
I'll do that. Thank you.
--
Regards
Konrad Viltersten
--------------------------------
sleep - a substitute for coffee for the poor
ambition - lack of sense to be lazy
.
- Follow-Ups:
- Re: SV: Running test01.py under Windows (basic level)
- From: Gabriel Genellina
- Re: SV: Running test01.py under Windows (basic level)
- References:
- Running test01.py under Windows (basic level)
- From: K Viltersten
- Re: Running test01.py under Windows (basic level)
- From: Gabriel Genellina
- Running test01.py under Windows (basic level)
- Prev by Date: Re: Article of interest: Python pros/cons for the enterprise
- Next by Date: SV: Running test01.py under Windows (basic level)
- Previous by thread: Re: Running test01.py under Windows (basic level)
- Next by thread: Re: SV: Running test01.py under Windows (basic level)
- Index(es):
Relevant Pages
|