Re: A switch somewhere, or bug? CORRECTION
Thomas Passin <[email protected]> Fri, 5 Dec 2025 23:03:11 -0500
| Newsgroups | gmane.comp.python.general |
|---|---|
| Message-ID | <[email protected]> |
On 12/5/2025 10:33 PM, MRAB wrote:
>
>
> On 06/12/2025 00:52, Thomas Passin wrote:
>> On 12/5/2025 7:12 PM, Em wrote:
>>> Ok, using "Open with Python" , the program fails on both computers.
>>> Still, double-click the filename on the WIN10 computer and the program
>>> works.
>>> While, double-click the filename on the WIN11 computer and the program
>>> fails.
>>
>> Then set up the file association for .py files in Settings/Default
>> apps. And write a different test program, one that will stay around so
>> you can see error messages. Perhaps (untested)
>>
>> from time import sleep
>> print('this is a test')
>> sleep(10) # sleep 10 seconds
>> # or
>> # while True:
>> # sleep(10) # Break out of loop by closing the console that is
>> # running the program
>>
>> This will keep the console open so you can see messages and the output
>> from the print() statement.
>>
>> "program fails" isn't helpful unless we can figure out what is
>> happening. I still think that your program isn't actually getting run.
>> This suggestion will make a start at finding out what's going on.
>>
> [snip]
> Instead of 'sleep', you could just add an input line:
>
> print('This is a test')
> input('Press Enter to finish')
Just as good! The important thing is to see if the program is actually
getting launched. If the Python program fails to run then the console
window won't appear for more than a brief flash. If it runs but there
is some problem about creating/opening that file, well, this program
doesn't try. We're just trying to see if a .py file gets launched in
the way that is being used. We need to know if the launching process is
failing or that new file is bombing out somehow.
--
https://mail.python.org/mailman3//lists/python-list.python.org