SV: Running test01.py under Windows (basic level)

K Viltersten tmp1 at viltersten.com
Thu Feb 28 23:30:43 EST 2008


>> 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




More information about the Python-list mailing list