Python

From vret
Revision as of 09:51, 19 January 2010 by Niels (talk | contribs) (Problems)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Download

Tutorials

Documentation practice

I propose to use epydoc to generate documentation ala javadoc. This means adding text like @param and @author to the docu field in the code.

Problems

=+ VS +=

counter += 1 isn't equal to counter =+ 1 both scripts will run with out a error but one will add 1 to the counter and the other will set the counter too 1. I haven't got counter++ working.

Relative image paths

Every python script has its own __file__ variable that gives you the path of that script file instead of the path of the running script file.

example:
os.path.join(os.path.dirname(__file__),"SudTimeBar.png")