import doesn't work as i want

Olivier Noblanc ATOUSOFT tech at
Mon Jan 31 11:29:47 EST 2005

how to move in function ?

"Fredrik Lundh" <fredrik at> a écrit dans le message de news: 
mailman.1643.1107187553.22381.python-list at
> Olivier Noblanc wrote:
>> In the botom of this post you will see my source code.
>> The problem is when i launch that doesn't make anything why ?
> the "if __name__" statement checks the name of the module.  if you run
> Python file as a script, by passing a filename to the python interpreter, 
> the
> __name__ variable is set to  "__main__".  if you import a file as a 
> module,
> the __name__ is the name of the module, not "__main__".
> if you want to do something, move that code to (or move
> it into a function, and call it from
> </F>

More information about the Python-list mailing list