1,445 questions
1
vote
1
answer
82
views
Why does sklearn GaussianMixtures spawn a cmd window when run from IDLE?
When I run this code using IDLE in windows, it spawns a temporary cmd window that disappears shortly thereafter.
import numpy as np
import matplotlib.pyplot as plt
from sklearn.mixture import ...
0
votes
2
answers
52
views
python -m idlelib Switch to specific py version
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 ...
-1
votes
4
answers
142
views
Different outputs depending on different IDE used? [duplicate]
So I'm learning Python in a Coursera Google course, which provides instructional code inside a Jupyter notebook page. But in addition to the Jupyter page, I primarily use the IDLE Shell and scratchpad ...
0
votes
2
answers
50
views
VS code for Python does not show the contents of the variable after the codes are executed
I have a simple Python code written in VS code to print an array:
import numpy as np # Importing the NumPy library
# Creating a 1D array
array_1d = np.array([1, 2, 3, 4, 5])
print("1D Array:&...
-1
votes
1
answer
2k
views
restart:shell as output when trying to connect mysql with python [duplicate]
import mysql.connector
mydb = mysql.connector.connect(host="localhost", user="root", password="123456")
if mysql.connector.is_connected():
print("connected")...
1
vote
0
answers
130
views
Tkinter by python doesn't work in Visual Studio Code, only in IDLE
I am a beginner developer and I've been trying to code some basic tkinter shapes. When I run it in the pyhon-mage ide called IDLE, there is no problem. However, when I try to run it in Visual Studio ...
0
votes
0
answers
163
views
IDLE/Tkinter Error: no display name and no $DISPLAY environment variable
Traceback (most recent call last):
File "/usr/bin/idle", line 5, in \<module\>
main()
File "/usr/lib/python3.10/idlelib/pyshell.py", line 1617, in main
root = Tk(...
0
votes
1
answer
70
views
Why is code copied from IDLE always rejected?
I am unable to persuade this system to accept my question because it tells me that I should indent my code by 4 spaces. As far as I can tell it is all properly indented, as it runs properly within ...
0
votes
2
answers
194
views
Using cmd to run IDLE
I an unable to run Python IDLE using command prompt on windows 10 OS.
C:\Windows\System32>IDLE
'IDLE' is not recognized as an internal or external command,
operable program or batch file.
C:\...
0
votes
1
answer
82
views
Import pandas not working, showing "RESTART: shell"
whenever im using import pandas as pd it isn't working other than that anything like import math module is working.
it shows "RESTART: shell".
i am unable to install any other IDE so i am ...
1
vote
0
answers
52
views
python code not working properly in python terminal but working in idle editor
I am using python to encrypt and decrypt stream ciphers. It works perfectly fine on the idle editor shell when I run it but I get messed up outputs when I try to run the code with the python terminal (...
0
votes
0
answers
275
views
Infinite Loops, Ctrl + C, and Python IDLE Shell
I'm very new to programming and am learning Python through Automate the Boring Stuff. I'm looking at While Loops and put the following into the file editor window:
name = ''
while name != 'your name':
...
0
votes
3
answers
496
views
How to change the menu font size in IDLE?
While I'm using Python's IDLE, the font size of menus and submenus is very small.
In the editor window the font size is 14. On a large 4K monitor, working with files is fine but sometimes if I need to ...
1
vote
1
answer
693
views
Cannot wrap text in the new Python IDLE 3.12.2 on Windows
I am unable to wrap text in the script window in Python IDLE 3.12.2 . I saw the previous solutions of clicking on Configure IDLE and then clicking on the General Tab, but this does not exist anymore.
...
-2
votes
1
answer
431
views
idle won't start on macOS 11.7, python 3.12. says macOS 11 (1107) or later required, have instead 11 (1106)
The title says it: I did pip install idle, after upgrading pip. Now I get this:
% idle
macOS 11 (1107) or later required, have instead 11 (1106) !
zsh: abort idle
My Mac About says: BigSur 11.7
...
1
vote
1
answer
2k
views
Python 3.12 - where is the Run menu?
I am trying to follow a tutorial but the tutorial was made in an earlier version of Python. I installed 3.12 and I have no Run menu option in the IDLE app. The F5 key just emits a sounds when I ...
0
votes
1
answer
318
views
Carriage return (\r) works different on python idle vs VS Code [duplicate]
import time
for i in range(10):
print(f"Progress: {i}/10", end='\r')
time.sleep(1)
When I run this code in VS Code it works as expected by showing "Progress" in place ...
2
votes
0
answers
65
views
Inconsistency in outputs given by Python IDLE (using both Shell and Interactive modes) and Google Colabs
I tried a code regarding the IDs of dictionaries I created in Python, but the same code gives a different output when I run it on IDLE and when I run it on Google Colabs. Could anyone explain this?
...
0
votes
0
answers
83
views
How do I get the right installation of python?
I'm having trouble finding the right installation of python, and I am on windows.
When I first installed python (IDLE) by going to https://python.org, and downloading the version, I did not know that ...
0
votes
0
answers
55
views
When testing code in the Python IDLE, why is my newly saved code not running after making updates to it in VS Code?
For context, I am editing a simple script that outputs stock information to a Pandas dataframe. I am currently editing the script itself within VS Code, and build it there. I started to notice that ...
1
vote
1
answer
216
views
openai module not found -- Confusion on how to use pip and Idle vs Cmd Prompt
This is my first post but I've benefited greatly in the past from reading all of your questions and collective knowledge.
I'm having trouble figuring out which program/interpreter to use Pip with to ...
-2
votes
2
answers
191
views
Settings window too large in Python IDLE 3.8
I am trying to increase the font size of my code on IDLE 3.8. For this I go on IDLE->Preferences->Fonts/Tabs and change from there. But the length of my settings window is by default quite large ...
0
votes
3
answers
158
views
In IDLE, what is the simplest way to limit the number of lines displayed by a pprint call?
I am working with large nested dictionaries in Python and would like to quickly check their structure in IDLE. The pprint module nicely displays this structure, but leads IDLE to hang due to the size ...
0
votes
1
answer
132
views
Making extension for Idle to change its right click menu
I need to make an extension for Idle, that lets me change its right click menu (context menu?) to add events/options that i want to be there. Mainly for Idle Editor.
I only found documentation on how ...
0
votes
0
answers
63
views
Where do I run Python code for frame io API?
I'm not understanding this first simple concept if you could help me please.
I'm trying to learn the frame.io API to so some simple things like scrape comments using Python.
I have a frame.io dev ...
0
votes
1
answer
57
views
I opened my python script and found 3 additional lines I did not write
These lines just appeared in my code:
<<<<<<<HEAD
followed by ~20 normal lines
=======
followed by ~15 normal lines
>>>>>>> 6cba... 40 characters of ...
0
votes
0
answers
130
views
Two different idle (python) versions installed, none of them work properly
I downloaded WSL for windows because I needed some modules that are not yet suited for Windows. Thus, I downloaded conda, and all the packages I needed in an environment. It seems that I accidently ...
0
votes
2
answers
1k
views
cmd shows Older version of Python, and IDLE shows the current version
Here in cmd show this older version
enter image description here
but, IDLE shows this version (which i again installed)
enter image description here
because of this VsCode uses older verison of Python ...
0
votes
1
answer
83
views
How do I get it so when I double click a py file it opens up Idle to edit without a console window temporarily coming up?
I've been trying to search stack overflow and Reddit to find out how to do it as I did it years ago, where if I double-clicked on a py file, it would open in idle without a console window temporarily ...
0
votes
3
answers
507
views
Is there Python Shell like IDLE in VSCode?
I'm writing code in Python and using both the default IDLE and Visual Studio Code as my development environments. I was wondering if there is a interactive shell like the one in IDLE in vscode, where ...
0
votes
1
answer
90
views
Print from mapped function in multiprocessing Pool on Windows
I am trying to generate a printout from my mapped workers in Python and the following works when I run it on the command line in Linux, but it doesn't print out when using the IDLE Shell on Windows.
I ...
1
vote
1
answer
143
views
Can I use IDLE to debug a program that reads from standard input?
I'm debugging a long source code file that takes many inputs from the keyboard. I want to step through the program to see variable values, but I can't get the Python IDLE debugger to take standard ...
0
votes
1
answer
361
views
Is there a way to launch python idle via command line on ChromeOS's linux terminal?
I have been searching for a way to use python on my ChromeOS laptop, I can get the python3 command working but cannot find a way to open IDLE.
The commands that are tradiditionally used such as python ...
-2
votes
1
answer
336
views
Can I clear the screen in Python's IDLE Shell?
I'm trying to clear the screen in Python's IDLE shell, and so far haven't found any working mechanism to do so.
How can this be done?
0
votes
0
answers
71
views
Python: opening a separate instance of IDLE from within an IDLE file
I have had success opening external application files from within a python script by sending the application filepath and the filepath of the specific file as a list to Popen as follows:
filepath = [&...
5
votes
1
answer
3k
views
How do I install idlelib?
How do I install idlelib in a windows computer?
Is there a way for me to install it with pip?
I am using
Windows 7 (64-bit)
Windows embeddable package (64-bit)
Python 3.8.9
Thanks.
Because I am ...
0
votes
0
answers
89
views
If I edit a Python file with IDLE and try to run that in the Revit Python Shell, it fails with Unexpected Token errors. Why?
I learning to use the Revit Python Shell addin and have come across a problem that I am hoping someone knows the answer to.
Initially, I would create a Python script using Notepad and then load that ...
3
votes
0
answers
108
views
Higher memory usage in Python Idle when compared with VSCode
I have been comparing algorithms for Fibonacci sequences and the memory usage of the two algorithms and noticed extra memory usage in idle when compared to vscode.
The code being run was:
import ...
-1
votes
1
answer
151
views
Python Idle: Why does the dash key show a comma instead?
Whenever I type in "-" python idle converts it to ","
I have redownloaded python to the most recent update
I don't think its my computers problem bc I can type - just fine
Typing - ...
0
votes
1
answer
726
views
Python Code on Raspberry Pi Stops after several hours but used to run for months
As the title says it is a Python script which used to run for weeks/months at a time but now suddenly stops working after several hours. There is no error message. There are no other indications that ...
-1
votes
2
answers
1k
views
How to copy the output of a python program to a text file? (cannot use the console, only the Python IDLE)
I want my program to execute in python IDLE and then the last output has to be saved in a text file.
Here's my code:
while (True):
import random
import time
#Introduction
print("&...
0
votes
1
answer
182
views
Different outcomes by Python IDLE and VS Code python interpreter
On executing the following code.
while True:
try:
number = int(input("Enter the number: "))
except ValueError:
print("Sorry, I didnt understand that.\n") ...
1
vote
2
answers
690
views
How to prevent IDLE from running a Python code prematurely
I am quite new in using IDLE, and yes this is a rookie question, but please bear with me. I have this long, complex python code (I will embed below), that I am copying line by line to IDLE. The ...
-1
votes
1
answer
322
views
Why can I access a sqlite database in IDLE but not Visual Studio Code?
So I'm trying to retrieve information from a database using sqlite3 and python. I've tried to do so with the following code:
username=username_entry.get()
password=password_entry.get()
conn=sqlite3....
0
votes
1
answer
127
views
OpenCV program works in MacOS terminal but not IDLE
This is my first time using OpenCV and I'm having some difficulties. I just made a simple program to see if it was imported correctly:
import cv2
import numpy as np
print("hi")
cap = cv2....
-1
votes
2
answers
2k
views
How do you comment muliple lines of python code in IDLE on MACBOOK?
I have been trying to figure out how to comment multiple lines of python code in IDLE shell on MACBOOK pro apple silicon
I have tried to comment with command+D, Command+1, control+D, control+1 but ...
0
votes
1
answer
83
views
Windows CMD not seeing pip module paramiko
I'm writing a small script in Python, as a part of my networking class homework.
I have to run this script in cmd.exe, but it keeps giving me error ModuleNotFoundError: No module named 'paramiko'. It ...
0
votes
1
answer
190
views
How can I run a python script more than once in the same IDLE shell, without the shell closing and reopening?
I want to use Sublime Text to write python scripts, but run them in IDLE.
So far I've created a build system like this:
{
"cmd": ["/Library/Frameworks/Python.framework/Versions/3.8/...
0
votes
2
answers
353
views
How can I create a build system in Sublime Text to run my python code in an IDLE shell?
How can I run my code from Sublime Text in an IDLE shell. I much prefer using IDLE to run my code when I'm writing it because it's really easy to debug. However I love Sublime Text and much prefer to ...
1
vote
1
answer
52
views
How to colourise user input in IDLE's terminal?
How do I change the text input in IDLE's terminal to green?
import sys
try:
color = sys.stdout.shell
except AttributeError:
raise RuntimeError("Use IDLE")
full_name = input('What ...