Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Problem: .py file not passed and started with Phyton.exe on windows #1421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pstein opened this issue Oct 13, 2024 · 1 comment
Closed

Problem: .py file not passed and started with Phyton.exe on windows #1421

pstein opened this issue Oct 13, 2024 · 1 comment

Comments

@pstein
Copy link

pstein commented Oct 13, 2024

I installed successfully newest WinPython v3.13 on Windows 10.

The path to python.exe is prepended to PATH environment variable.

I can launch python.exe from CommandPrompt simply by entering python.exe.
So everything is fine so far.

Furthermore I let WinPythons Installer associate the *.py file extension to python.exe

Now I created a super simple python file "text.py" with the following content:

--version

which should obviously be passed to python and executed.

But when I double click on test.py or enter at the commandprompt test.py I get the following error:

Traceback (most recent call last):
File "D:\data\test.py", line 1, in
--version
^^^^^^^
NameError: name 'version' is not defined

Even if I enter:

python test.py

the same error occurs.

Whats wrong?

I though a *.py file will be passed to python interpreter and executed just as I would enter

python --version

but this seems to be not the case.

Whats wrong?

If I enter (without a *.py file) directly the command in CommandPrompt

python --version

it works

@nmarc
Copy link

nmarc commented Oct 13, 2024 via email

@stonebig stonebig closed this as completed May 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants