0

MultiProcessing doesn't correctly show results in IDLE's output window, but it does show in IntelliJ / commandPrompt's Output window.

I'm trying to run:

python -m idlelib

But my environment variable is set to 2.7 (and I DONT WANT to change this),

I just want to run IDLE from the command prompt as i.e. 3.10

How do I run a specific IDLE version from the command prompt? I'd imagine it to be:

python -m C:\Users\Administrator\AppData\Local\Programs\Python\Python310\Lib\idlelib

2 Answers 2

1

There is no IDLE version separate from the version of Python that it comes with. This is the same as for all other stdlib modules. Currently, when you run 3.x IDLE (with 3.x), IDLE runs the code you write or load into IDLE with 3.x, by default in a separate process. To run 3.10 IDLE on Window, install 3.10 with the 'py' launcher and enter py -3.10 -m idlelib in CommandPrompt. (Edited to add -m.)

I have no idea why you would want to run 3.10 IDLE with 2.7; what do you wish to accomplish? But I expect the command you gave would quickly fail with a SyntaxError. If not, importing tkinter would fail as that was called 'Tkinter' in 2.7.

Sign up to request clarification or add additional context in comments.

2 Comments

I have python 2.7 and 3.10 installed. But 2.7 must be left where it is in environment variables because it runs ARCGIS stuff. But I need 3.10's IDLE to run this other process that uses multiprocessing.py And you cannot run multiprocessing in IDLE, it must first be started from the command prompt, its just the way that multiprocessing .py works.
I explained in another answer that one can run multiprocessing in IDLE, but if one wants print output from the new opened processes, one must start IDLE in a terminal. The reason is that the new processes cannot send text to the IDLE tkinter window, but can send to the terminal. When IDLE is started in a terminal, sys.__stdout__, etc., are the terminal instead of None.
0

Thanks Terry above ^

From yours I made this that works really well:

py -3.10 C:\Users\Administrator\AppData\Local\Programs\Python\Python310\Lib\idlelib

1 Comment

Whoops, my answer omitted the needed -m (now added). Sorry! With that, the two commands are almost equivalent, except that -m idlelib means "search sys.path to find the idlelib directory" that you directly specified. In either case, import sys; sys.executable in IDLE should print "C:\Users\...\Python310\python.exe".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.