python-idle

Is there a horizontal scroll bar in python's idle?

☆樱花仙子☆ 提交于 2019-12-04 17:56:07
I am using IDLE to learn Python 2.7 on Windows 7. The Vertical scroll bar works fine but I cannot find a way to activate the Horizontal scroll bar. Is there a horizontal scroll bar in Python's IDLE? Thanks Amber Horizontal Scroll Bars for IDLE from http://code.activestate.com/lists/python-list/26878/ ( not my code , found it on this site) It is dated Wed, 08 Mar 2000 Works for Python 2.6 but I can't get to work in 2.7. I get an error saying that the file is open some where. For me, the file he is talking about is located in:C:\Python27\ArcGIS10.1\Lib\idlelib It will be different if you do not

How to tell whether imaplib2 idle response resulted from timeout

百般思念 提交于 2019-12-04 17:47:24
I'm using imaplib2 ( docs ) to interact with an IMAP server. I'm using the idle command, with a timeout and a callback. The problem is, I don't see any way of telling if the callback was triggered by the timeout being reached, or if there was a change on the server that I need to check out. I just get ('OK', ['IDLE terminated (Success)']) every time. Here's the debug output for both cases: Timedout: 15:43.94 MainThread server IDLE started, timeout in 5.00 secs 15:48.94 imap.gmail.com handler server IDLE timedout 15:48.94 imap.gmail.com handler server IDLE finished 15:48.94 imap.gmail.com

How to prevent python IDLE from restarting when running new script

雨燕双飞 提交于 2019-12-04 17:21:25
I use Python 3.6.1 IDLE. I'd like to be able to run a sequence of scripts while maintaining the local environment (variables etc.) just as if I had entered all the commands line by line into the shell. However, whenever I execute a script the environment restarts and I lose all the variables from previous executions. Is there anything I can do to prevent this restart? I don't want to have to type things line by line in the shell. This question is similar to Run a module in IDLE (Python 3.4) without Restart but there's no convincing answer yet, maybe because the question is worded confusingly.

How does Python IDE IDLE shows autocompletion list on top of text widget at cursor position?

时光毁灭记忆、已成空白 提交于 2019-12-04 15:38:09
Is it using listbox? context-menu? inserting widgets within text? something else? Also, is there some documentation about how IDLE functions? Which python files do what, etc? The autocompletewindow is a tk Toplevel with a Listbox and Scrollbar . Code is in idlelib/AutoCompleteWindow.py (and associated code in AutoComplete.py). The Idle doc gives a user view of Idle. There is no doc giving a programmer view of idlelib. (I wish there had been one when I started with Idle. Now that I understand what most of the files do, I should write something.) EDIT: Tk and Toplevel widgets are located with

Python IDLE is not starting on Windows 7

倾然丶 夕夏残阳落幕 提交于 2019-12-04 11:34:17
问题 I used to use Python 2.7 and then IDLE was working. I uninstalled it and installed Python 3.1. Right now Idle cannot launch. What should i do to get it running? NOTE: I tried c:\Python31\pythonw.exe c:\Python31\Lib\idlelib\idle.py i uninstalled 3.1 and installed back 2.7, not working neither... 回答1: In the past, I've often found that when I had some issues with the python.org version of some Python release, specifically on Windows, installing instead the activepython version of the same

How to run two modules at the same time in IDLE

允我心安 提交于 2019-12-04 06:14:18
I am working on a super simple socket program and I have code for the client and code for the server. How do I run both these .py files at the same time to see if they work ? You can run multiple instances of IDLE/Python shell at the same time. So open IDLE and run the server code and then open up IDLE again, which will start a separate instance and then run your client code. 来源: https://stackoverflow.com/questions/15329649/how-to-run-two-modules-at-the-same-time-in-idle

Idle time of a process in Linux

这一生的挚爱 提交于 2019-12-04 05:12:11
问题 I need to calculate CPU usage (user mode, system mode, idle time) of a process in Linux. I am able to calculate usage in user and system mode using utime and stime values from /proc/PID/stat , but I found nothing which is related to idle time. I know I can get idle time from /proc/stat but this value is related to machine, not for particular process. Is it possible to calculate idle time of a process knowing its PID (reading data from /proc directory)? 回答1: I don't know much about it but

Change printed text color in Idle?

China☆狼群 提交于 2019-12-04 05:03:29
问题 Is there a way to specify the color a text is printed within Idle for Python 3.2? I'm looking for something like: print("foo", "#fafafa") print("bar", "#4f4f4f") 回答1: http://docs.python.org/library/idle.html#syntax-colors To change the color scheme, edit the [Colors] section in config.txt. Edit: As you've edited your question, here is an edited answer. See http://www.daimi.au.dk/~mailund/scripting2005/lecture-notes/process-management.html for how to use terminal escape sequences in Python to

How do I restart the IDLE Python Shell in Linux?

微笑、不失礼 提交于 2019-12-04 04:52:58
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? If you want the changes in module to be visible, just call something like that (where my_module is your module you updated):

New line on error message in KeyError - Python 3.3

回眸只為那壹抹淺笑 提交于 2019-12-04 03:43:49
问题 I am using Python 3.3 through the IDLE. While running a code that looks like: raise KeyError('This is a \n Line break') it outputs: Traceback (most recent call last): File "test.py", line 4, in <module> raise KeyError('This is a \n Line break') KeyError: 'This is a \n Line break' I would like it to output the message with the line break like this: This is a Line Break I have tried to convert it to a string before or using os.linesep but nothing seems to work. Is there any way I can force the