python-idle

How do you add breakpoints to a Python program in IDLE?

冷暖自知 提交于 2019-12-17 16:12:39
问题 I solved this already, I'm just posting it here because I couldn't figure it out with google, or by reading the docs. I only found it by accident. To add a breakpoint, right-click on the line that you want to add a breakpoint on and select "Set Breakpoint". The line will become highlighted. (Note that this only works when you are editing a file; it does not work at the interpreter.) This site has a detailed tutorial about using the IDLE debugger. On Mac, you need to Control-click instead of

How to start IDLE (Python editor) without using the shortcut on Windows Vista?

自古美人都是妖i 提交于 2019-12-17 15:47:26
问题 I'm trying to teach Komodo to fire up IDLE when I hit the right keystrokes. I can use the exact path of the shortcut in start menu in the Windows Explorer location bar to launch IDLE so I was hoping Komodo would be able to use it as well. But, giving this path to Komodo causes it to say that 1 is returned. This appears to be a failure as IDLE doesn't start up. I thought I'd avoid the shortcut and just use the exact path. I go to the start menu, find the shortcut for IDLE, right click to look

Import module works in terminal but not in IDLE

喜你入骨 提交于 2019-12-17 14:53:50
问题 I am trying to import pyodbc module on a windows computer. It works in the terminal, but not the IDLE. The error message in IDLE is: Traceback (most recent call last): File "FilePath/Filename.py", line 3, in <module> import pyodbc ImportError: No module named pyodbc 回答1: This typically occurs when multiple versions of python are installed with different paths. You can check to see if you have multiple installations by opening up the IDLE terminal and using import sys sys.version sys.path

How to launch python Idle from a virtual environment (virtualenv)

别等时光非礼了梦想. 提交于 2019-12-17 10:22:37
问题 I have a package that I installed from a virtual environment. If I just launch the python interpreter, that package can be imported just fine. However, if I launch Idle, that package cannot be imported (since it's only available in one particular virtualenv and not global). How can I launch Idle from a virtualenv, so that all packages from the virtualenv would be available? 回答1: For Python 3.6+, please see Paul Wicking's answer below. In Python prior to 3.6, IDLE is essentially from idlelib

Python IDLE: Change Python Version

只愿长相守 提交于 2019-12-17 06:46:23
问题 I have Python 2.x and 3.x on my machine (Mac OS X 10.6). For some things I want to use ver 2, but for others I want ver 3. I like the IDLE software for editing/running, but it always uses version 3. Is there any way to change the version of the interpreter that IDLE uses? Thanks! 回答1: There are different versions of IDLE installed for each Python version. Depending on how you installed Python on Mac OS X, you may find different folders in /Applications . Look for a Python 3.n (n = 1 or 2)

How do I restart the IDLE Python Shell in Linux?

时光怂恿深爱的人放手 提交于 2019-12-14 04:16:16
问题 In IDLE on Windows, on the menu bar, there is a Shell menu. One of the items on the Shell menu is 'Restart Shell'. The Shell menu is not available in IDLE on Linux. The Restart Shell command is useful after you have made a change in a module and want to run the module again in the shell. In IDLE on Linux, I have to close IDLE and open it again for the shell to notice the change in the module. How can I restart the shell without closing and reopening IDLE as a whole? 回答1: If you want the

python: why IDLE is slower than terminal?

核能气质少年 提交于 2019-12-14 03:50:05
问题 I just wrote a simple python command to check on a big list from a csv file. The csv has 2 columns with 10K lines. when I input the 2nd row into a list and later print the list, it takes the IDLE quite some time to show it where the terminal (under mac) shows it promptly. *BTW, I checked it on 2 different machines - same result. Obviously, no one will print 10k items on a console but the idea that one is significantly faster than the other makes me wonder: why IDLE which supposed to be python

How to deal with Non-ASCII Warning when performing Save on Python code edited with IDLE?

耗尽温柔 提交于 2019-12-14 02:19:10
问题 I frequently edit Python code using IDLE and occasionally when I perform a Save I receive an I/O Warning. I am assuming that I have inadvertently added a Non-ASCII character, and I do not really want to declare the cp1252 encoding. Is there an easy way to find and delete the Non-ASCII that the Warning relates to? The OS Version involved is Windows 7, and the Python version is 2.6.5 回答1: The regex [^ -~] will match anything except printing ASCII characters. It should be able to find your stray

How to solve ModuleNotFound Error in IDLE?

笑着哭i 提交于 2019-12-14 02:07:27
问题 I am using ubuntu 18.04. I first installed Python along with anacondafrom terminal whose version is 3.7.0 and I have launched Jupyter notebook and Spyder as well. Then I installed IDLE whose version is 3.6.6+ and I am currently working in IDLE but then when I tried to import module,it shows the error: No module found. I checked for the path as well for both in IDLE and Terminal which are different.How do I solve this problem? when I checked the python path, In terminal, /home/reema/anaconda3

Program works in IDLE, but fails at the command line

落花浮王杯 提交于 2019-12-14 00:50:54
问题 I'm using Python's ctypes library to talk to a Windows DLL. When I run my code from IDLE, Ipython, or typed into the interactive python interpreter, it works fine. When I run the same code from the Windows command prompt, it crashes. Why does one way crash, and one way succeed? Here's a simplified version of the code I'm running: import ctypes, os, sys print "Current directory:", os.getcwd() print "sys.path:" for i in sys.path: print i PCO_api = ctypes.oledll.LoadLibrary("SC2_Cam") camera