Mailing List Archive

Winodws10 Command Prompt unresponsive to .py commands
Hi, I got python 11 to work with the esptool a few days ago. However, I
must have something wrong, because now, when I enter any command with .py,
Windows Command Prompt just returns without doing anything. Example

C:\Users\gregg>esptool.py version

C:\Users\gregg>

I tried to change the Windows default by filetype. but no luck. Any
ideas? Thanks
--
https://mail.python.org/mailman/listinfo/python-list
Re: Winodws10 Command Prompt unresponsive to .py commands [ In reply to ]
On 3/7/2023 2:31 PM, Thomas Gregg wrote:
> Hi, I got python 11 to work with the esptool a few days ago. However, I
> must have something wrong, because now, when I enter any command with .py,
> Windows Command Prompt just returns without doing anything. Example
>
> C:\Users\gregg>esptool.py version
>
> C:\Users\gregg>
>
> I tried to change the Windows default by filetype. but no luck. Any
> ideas? Thanks

Never mind file associations for now. Just run it with Python (that is,
the python executable program) -

python esptool.py

Notes:
1. If esptool is not in the current directory then use the full path to it.
2. Use the right name (instead of just "python") to launch your desired
version of Python. On a standard Windows installation it will probably
be "py" (without the quotes), or "python3.11" or "py -3.11". But it
might possibly be just "python". You will have to try it to see.

If you ever do decide you want to run Python programs using file
associations, you can read up on how to get them working.

Probably the easiest way to get a file association set up is to open the
File Explorer and navigate to some directory that has a .py file. Right
click on that file and choose OpenWith. Then click on "Choose another
app". This will open a dialog that will let you navigate to your Python
executable program and assign it to run all .py files.

I don't really recommend setting up and depending on a file association,
though. That's because it can be a problem if and when you end up with
more than one version of Python on your computer. Sometimes you want to
use one version to run a Python file, sometimes another. It's hard to
make that work if you run them using file associations.

Also if anything goes wrong, you probably will not see the error messages.
--
https://mail.python.org/mailman/listinfo/python-list
Re: Winodws10 Command Prompt unresponsive to .py commands [ In reply to ]
On 8/03/2023 6:31 am, Thomas Gregg wrote:
> Hi, I got python 11 to work with the esptool a few days ago. However, I
> must have something wrong, because now, when I enter any command with .py,
> Windows Command Prompt just returns without doing anything. Example
>
> C:\Users\gregg>esptool.py version
>
> C:\Users\gregg>
>
> I tried to change the Windows default by filetype. but no luck. Any
> ideas? Thanks

Prove it works in the command prompt by using the full path to python
for example,

C:\Python311\python C:\Users\gregg>esptool.py version

If that works, look at your path environment variables and see where
python is sitting. Substitute the real location of Python 3.11 on your
machine. Sadly, I think it defaults to C:\Program Files nowadays.

Once you can get Python working by omitting the path, for example,

C:\Users\gregg>python esptool.py version

... you can then right-click the .py file and choose whichever program
you like to open with.

I'm inclined to advise you to focus on getting virtual environments
working next and leave all that auto-opening to later. You might find
you prefer to right click and select every time.

M

--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Your
email software can handle signing.
Re: Winodws10 Command Prompt unresponsive to .py commands [ In reply to ]
> On 8 Mar 2023, at 05:55, Mike Dewhirst <miked@dewhirst.com.au> wrote:
>
> ?On 8/03/2023 6:31 am, Thomas Gregg wrote:
>> Hi, I got python 11 to work with the esptool a few days ago. However, I
>> must have something wrong, because now, when I enter any command with .py,
>> Windows Command Prompt just returns without doing anything. Example
>>
>> C:\Users\gregg>esptool.py version
>>
>> C:\Users\gregg>
>>
>> I tried to change the Windows default by filetype. but no luck. Any
>> ideas? Thanks
>
> Prove it works in the command prompt by using the full path to python for example,
>
> C:\Python311\python C:\Users\gregg>esptool.py version

On windows use the py.exe command rather then python.exe.

Does `py esptool.py version’
>
> If that works, look at your path environment variables and see where python is sitting. Substitute the real location of Python 3.11 on your machine. Sadly, I think it defaults to C:\Program Files nowadays.
>
> Once you can get Python working by omitting the path, for example,
>
> C:\Users\gregg>python esptool.py version
>
> ... you can then right-click the .py file and choose whichever program you like to open with.

Use py.exe which should in the windows folder to run .py files.

Barry

> I'm inclined to advise you to focus on getting virtual environments working next and leave all that auto-opening to later. You might find you prefer to right click and select every time.
>
> M
>
> --
> Signed email is an absolute defence against phishing. This email has
> been signed with my private key. If you import my public key you can
> automatically decrypt my signature and be sure it came from me. Your
> email software can handle signing.
>
> --
> https://mail.python.org/mailman/listinfo/python-list

--
https://mail.python.org/mailman/listinfo/python-list