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