You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
your script is wrong. --version is a cmd parameter. Try that.
import sys
print("Python-Version:")
print(sys.version)
print("Versionsinformationen:")
print(sys.version_info)
pstein ***@***.***> schrieb am So., 13. Okt. 2024, 12:27:
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?
python --version
works
—
Reply to this email directly, view it on GitHub
<#1421>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AECBUVC6CCCTCNIUHNGXKITZ3JDIRAVCNFSM6AAAAABP3JTH6OVHI2DSMVQWIX3LMV43ASLTON2WKOZSGU4DGOBVGU2DIMY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
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
The text was updated successfully, but these errors were encountered: