* Lad (2005-07-30 11:33 +0100) > I am running Python on XP and have a problem with > a program if its name consists '-' for example: > my-program.py > When I try to run a program with such name
/How/ do you "run" the program for Guido's sake?! > I get the error : > > Traceback (most recent call last): > File "<interactive input>", line 1, in ? > NameError: name 'my' is not defined > > Python thinks that the name of program is my.py only > but the name is my-program.py > > What is a solution? The solution to get answers is to give details. But to play the clairvoyant: /If/ you tried to run the program from a command prompt or from by klicking on the file there should be no problems. /If/ you tried to run the program by importing it from the Python shell, then this is normal. A hyphen is not allowed in module names at it is the same character as in subtractation. -- http://mail.python.org/mailman/listinfo/python-list