Jul-24-2023, 05:05 PM
(This post was last modified: Jul-24-2023, 05:06 PM by deanhystad.)
It doesn't surprise me that IDLE makes your program act differently. IDLE runs your program inside of IDLE, changing things here and there to intercept things here and override things there to keep IDLE informed about what is going on. For example, IDLE replaces stdin and stdout with IDLE specific versions. A few months ago there was a post on the forum asking why their program, which worked fine when run form the command line failed when run from IDLE. The reason was that the IDLE stdout did not support some features that have become standard in newer versions of Python. There are many posts on the forum wondering why tkinter programs run differently when using IDLE (the programs never exit because they are running inside the IDLE shell). It didn't take long for me to get tired of all the IDLE weirdness and move on to a different IDE.
I couldn't find where IDLE imports parse when your program imports urllib. I dug around for half an hour and lost interest. All I know is in IDLE:
I couldn't find where IDLE imports parse when your program imports urllib. I dug around for half an hour and lost interest. All I know is in IDLE:
Output:import urllib
dir(urllib)[/python]
['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'parse']
From the CMD shellOutput:c:\>python
Python 3.10.7 (tags/v3.10.7:6cc6b13, Sep 5 2022, 14:08:36) [MSC v.1933 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib
>>> dir(urllib)
['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__']