Skip to main content
rephrase / clarify
Source Link
KlausF
  • 172
  • 9

Contrary to what @go2nirvan saidEdit:

To be more precise.

just typing the filename in histhe command line will not work.

Typing start program.py however should work.

Windows normally has information telling it which program is the default program for a given suffix.

Concerning @go2nirvan's comment,: Though windows does this without you havingis not an oracle, it can have information for each file suffix to do anything specialknow what's the related default application. Even many linux desktop application associate a default application to certain mime types.

If you click on .xls (depending on what is installed) either Excel, or OpenOfficeCalc or LibreOffice will be opened)

Windows associates file suffixes to file types and file types to applications, that are supposed to start it.

If you open a CMD window and you type

assoc .py

You should get an output similar to: (I don't have a windows machine nearby, so can't tell you the exact output) .py=Python.File

Then type ftype Python.File or whatever the rpeviousprevious command gave you andyouand you should see which executable shall be used.

This should be something like

c:\System32\py.exe

which is a wrapper program, calling the real python executable according to some rules

If this doesn't work, then please tell which version of python you installed and how you installed it (for all users, for current user, ...)

From command line you have to call (If I recall correctly)

start test.py and it will excuteexecute the file with the associated executable

Contrary to what @go2nirvan said in his comment, windows does this without you having to do anything special.

If you click on .xls (depending on what is installed) either Excel, or OpenOfficeCalc or LibreOffice will be opened)

Windows associates file suffixes to file types and file types to applications, that are supposed to start it.

If you open a CMD window and you type

assoc .py

You should get an output similar to: (I don't have a windows machine nearby, so can't tell you the exact output) .py=Python.File

Then type ftype Python.File or whatever the rpevious command gave you andyou should see which executable shall be used.

This should be something like

c:\System32\py.exe

which is a wrapper program, calling the real python executable according to some rules

If this doesn't work, then please tell which version of python you installed and how you installed it (for all users, for current user, ...)

From command line you have to call (If I recall correctly)

start test.py and it will excute the file with the associated executable

Edit:

To be more precise.

just typing the filename in the command line will not work.

Typing start program.py however should work.

Windows normally has information telling it which program is the default program for a given suffix.

Concerning @go2nirvan's comment: Though windows is not an oracle, it can have information for each file suffix to know what's the related default application. Even many linux desktop application associate a default application to certain mime types.

If you click on .xls (depending on what is installed) either Excel, or OpenOfficeCalc or LibreOffice will be opened)

Windows associates file suffixes to file types and file types to applications, that are supposed to start it.

If you open a CMD window and you type

assoc .py

You should get an output similar to: (I don't have a windows machine nearby, so can't tell you the exact output) .py=Python.File

Then type ftype Python.File or whatever the previous command gave you and you should see which executable shall be used.

This should be something like

c:\System32\py.exe

which is a wrapper program, calling the real python executable according to some rules

If this doesn't work, then please tell which version of python you installed and how you installed it (for all users, for current user, ...)

From command line you have to call (If I recall correctly)

start test.py and it will execute the file with the associated executable

Source Link
KlausF
  • 172
  • 9

Contrary to what @go2nirvan said in his comment, windows does this without you having to do anything special.

If you click on .xls (depending on what is installed) either Excel, or OpenOfficeCalc or LibreOffice will be opened)

Windows associates file suffixes to file types and file types to applications, that are supposed to start it.

If you open a CMD window and you type

assoc .py

You should get an output similar to: (I don't have a windows machine nearby, so can't tell you the exact output) .py=Python.File

Then type ftype Python.File or whatever the rpevious command gave you andyou should see which executable shall be used.

This should be something like

c:\System32\py.exe

which is a wrapper program, calling the real python executable according to some rules

If this doesn't work, then please tell which version of python you installed and how you installed it (for all users, for current user, ...)

From command line you have to call (If I recall correctly)

start test.py and it will excute the file with the associated executable