python-idle

Python IDLE freezes

偶尔善良 提交于 2019-12-01 06:25:44
问题 This is absolutely frustrating, but I am not sure if the following is an issue only on my machine or with IDLE in general. When attempting to print a long list in the shell, and that could happen by accident while debugging, the program crushes and you have to restart it manually. Even worse, if you have a few editor windows open, it always spawns a few sub-processes, and each of these has to be manually shut down from the task manager. Is there any way to avoid that? I am using Python 3, by

IDLE crash when opening on Mac OS X

孤者浪人 提交于 2019-12-01 06:12:30
问题 I recently attempted to install python 3.2 along with IDLE 3 on my macbook pro. I successfully installed python 3.2 (as in, I can run it from the terminal), but when I attempted to install IDLE 3.2 I must have done something wrong because now both IDLE 2.7 and IDLE 3.2 crash immediately upon opening with the message "Python quit unexpectedly", no matter whether I open it through the terminal or through finder. Does anyone know how to fix this? I have installed the correct ActiveTCL package

Controlling Paraview GUI from Python IDLE

☆樱花仙子☆ 提交于 2019-12-01 06:06:50
问题 I am trying to control Paraview interactively using IDLE. This would involve sending commands from IDLE and seeing the changes occur in Paraview. I would rather not use the in-Paraview python shell. So far, I have succeeded in importing the Paraview modules (simple, servermanager…etc) from IDLE. However the commands sent do not reflect in Paraview. For instance: >>> from paraview.simple import * >>> cone = Cone() >>> Show() >>> Render() does indeed create a cone. However the cone is output to

Running Python file by double-click

帅比萌擦擦* 提交于 2019-12-01 03:32:36
I have really annoying problem, I cannot run a Python file just by double-clicking. I have tried to set it to open the file with idle.bat but that only starts IDLE editor on double-click, it does not run the Python file. What version of Python do you have installed? You should write your own batch file to execute your python binary and your script. For example, with a default Python 2.7 installation on Windows, this could be the entire contents of your script. myscript.bat : ECHO ON REM A batch script to execute a Python script SET PATH=%PATH%;C:\Python27 python yourscript.py PAUSE Save this

IDLE won't highlight my syntax

白昼怎懂夜的黑 提交于 2019-12-01 02:48:33
问题 Using IDLE and Python version 2.7.3. Only when I start a new file it highlights for a few lines and then just stops after I press F5. So all my text becomes plain black. If there are equally good/better command line and editor combinations out there, you may always suggest them. 回答1: This happened to me too. Save it as .py (manually type .py in the document name), and the highlighting will come back. 回答2: I usually have to save the file as .py before IDLE will do any syntax highlighting at

Python IDLE won´t start

核能气质少年 提交于 2019-12-01 01:08:59
I´m a noob in python and about a week ago IDLE stop working, I have readed some other people questions about this, but none of them had the same error that I´m getting, which is: Traceback (most recent call last): File "c:\python26\Lib\idlelib\idle.py", line 21, in <module> idlelib.Pyshell.main() File "C:\python26\Lib\idlelib\PyShll.py", line 1386, in main root = Tk(className="Idle") File "C:\python26\Lib\lib-tk\Tkinter.py", line 1643, in __init__ self.tk = _tkinter.creat(screenName, baseName, className, interactive, want objects, useTk, sync, use) _tkinter.TclError: Can´t find a usable init

How to attach Messages from a Form shown with ShowDialog to Application2?

徘徊边缘 提交于 2019-11-30 22:56:21
I am trying to use the code in this article that lets you know when your app is idle.. This code works great if your application has only one form. You call Application2.Run(myOnlyForm) on it and all messages get routed through the filters in Application2. However if at any point you call mySecondForm.ShowDialog() that dialog does not get its messages filtered through Application2. Is there any way (with out bad side effects) to get the messages on mySecondForm to go through the `Application2' event filters? I have tried: Changing mySecondForm.ShowDialog to Application2.Run(mySecondForm) .

How to physically print python code in color from IDLE?

做~自己de王妃 提交于 2019-11-30 19:36:18
I have searched for an answer to this but the related solutions seem to concern 'print' ing in the interpreter. I am wondering if it is possible to print (physically on paper) python code in color from IDLE? I have gone to: File > Print Window in IDLE and it seems to just print out a black and white version without prompting whether to print in color etc. Edit: It seems like this might not be available so the option is to copy code to a text editor like SciTE and print from there - quite like the default IDLE syntax highlighting though. IDLE can't do it, but you can do it in an indirect way:

Use IDLE to launch script using the full file path

纵饮孤独 提交于 2019-11-30 15:44:28
I'm currently using Notepad++ to edit my python script, and I would like to be able to use a shortcut to make my script run in IDLE. Currently, I have: cd C:\Python32 pythonw.exe Lib\idlelib\idle.pyw -c "$(FULL_CURRENT_PATH)" When I try to run it, I get a Syntax error on the : in C:\Users\... However, if I omit -c , IDLE properly opens up the file in it's editor and then I am able to run it. I feel like I'm missing something simple, can anyone help me out? Argument -c used to start the command, if you need to run a file, then use argument -r I use this command: C:\Python27\Lib\idlelib\idle.bat

Default working directory for Python IDLE?

不问归期 提交于 2019-11-30 15:03:40
问题 Is there a configuration file where I can set its default working directory? It currently defaults to my home directory, but I want to set it to another directory when it starts. I know I can do "import os" followed by "os.chdir("")" but that's kind of troublesome. It'd be great if there is a conf file that I can edit and change that setting, but I am unable to find it. In particular, I've looked into my OS (Ubuntu)'s desktop entry '/usr/share/applications/idle-python3.2.desktop', which doesn