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



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

.



Relevant Pages

  • Re: Running test01.py under Windows (basic level)
    ... a source code i'm sure everybody will be ... Or, if you are using IDLE, go to File -> Open, open your saved file, and use the Run menu. ... and Python way is very new to me.) ... You may benefit from the Dive into Python book, available online at http://www.diveintopython.org ...
    (comp.lang.python)
  • Re: noob question: "TypeError" wrong number of args
    ... better understanding of Python's object model. ... def method: ... Python source code and outputs the same source code with only one change: ...
    (comp.lang.python)
  • Re: Why is there no Smalltalk-like IDE for Ruby?
    ... Its easy to say that - but I recently worked on a Python project and contrary to the comments others have made - I found that even some of the most recognized python IDE's are weak at cross referencing- yes they can do it but it often takes 5-10 seconds and then the resutls were placed in some other window making it awkward to see the references. ... In contrast, all of the Smalltalk implementation make cross referencing and navigation instant - its smooth, you dance between methods easily, and find what you need without thnking about it. ... Someone said to me it was becuase there is no image and so they have to look through all their possible source code - I can think of many workarounds to that - but then it occurs to me that I often have large images with all my source code in them and it doesn't seem to make a difference - so I guess its just funding. ...
    (comp.lang.smalltalk)
  • Re: hide python code !
    ... harder to turn back into source code. ... there is a version floating around which works for Python 2.4 I've ... binaries don't work on your newly-upgraded system and the vendor is on ... The question keeps getting asked because a lot of new programmers are ...
    (comp.lang.python)
  • Re: marked-up Python code
    ... I would like to experiment with marked-up Python source code. ... pieces of text in my editor and have this information saved _in my ... "all" the Python parser has to do is skip the mark-up. ...
    (comp.lang.python)