How can I run a program?
Hello, 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 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? Thank you Lad. -- http://mail.python.org/mailman/listinfo/python-list
Re: How can I run a program?
* 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
Re: How can I run a program?
On 30 Jul 2005 03:33:14 -0700, Lad [EMAIL PROTECTED] wrote: Hello, 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 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? Have you tried renaming it so it doesn't have a - in it? -- Email: zen19725 at zen dot co dot uk -- http://mail.python.org/mailman/listinfo/python-list
Re: How can I run a program?
did you try to put the filename in quotes? On 30 Jul 2005 03:33:14 -0700, Lad [EMAIL PROTECTED] wrote: Hello, 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 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? Thank you Lad. -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list