Questions tagged [python-idle]

IDLE is Python's Integrated Development and Learning Environment. It is part of the standard Python distribution.

IDLE is Python's Integrated Development and Learning Environment. It is part of the standard Python distribution. Though lightweight, it has a fairly rich feature set, including a code editor and a shell (in separate windows). It is written in Python using the tkinter toolkit.

1318 questions
168
votes
23 answers

Any way to clear python's IDLE window?

I know there's a similar topic about python console, but I do not know if they are the same. I tried system("clear") and it didn't work here. How do I clear python's IDLE window?
devoured elysium
  • 90,453
  • 117
  • 313
  • 521
141
votes
26 answers

How to repeat last command in python interpreter shell?

How do I repeat the last command? The usual keys: Up, Ctrl+Up, Alt-p don't work. They produce nonsensical characters. (ve)[kakarukeys@localhost ve]$ python Python 2.6.6 (r266:84292, Nov 15 2010, 21:48:32) [GCC 4.4.4 20100630 (Red Hat 4.4.4-10)] on…
kakarukeys
  • 16,427
  • 9
  • 28
  • 42
117
votes
7 answers

How to turn on line numbers in IDLE?

In the main shell of IDLE, errors always return a line number but the development environment doesn't even have line numbers. Is there anyway to turn on line numbers?
User
  • 20,562
  • 35
  • 99
  • 185
111
votes
5 answers

How do I access the command history from IDLE?

On bash or Window's Command Prompt, we can press the up arrow on keyboard to get the last command, and edit it, and press ENTER again to see the result. But in Python's IDLE 2.6.5 or 3.1.2, it seems if our statement prints out 25 lines, we need to…
nonopolarity
  • 130,775
  • 117
  • 415
  • 675
111
votes
15 answers

How to run a python script from IDLE interactive shell?

How do I run a python script from within the IDLE interactive shell? The following throws an error: >>> python helloworld.py SyntaxError: invalid syntax
user1703914
76
votes
9 answers

interactive shell debugging with pycharm

I am new to PyCharm. I have been using IDLE for a long time. It is very convenient to use Python objects after script execution in IDLE. Is there any way to use script objects after its execution with interactive python shell using PyCharm? For…
user1941407
  • 2,239
  • 3
  • 21
  • 37
54
votes
8 answers

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

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…
Kevin Le - Khnle
  • 9,509
  • 8
  • 46
  • 76
51
votes
4 answers

How to get the list of all initialized objects and function definitions alive in python?

Say that in the python shell (IDLE) I have defined some classes, functions, variables. Also created objects of the classes. Then I deleted some of the objects and created some others. At a later point in time, how can I get to know what are the…
user235273
50
votes
13 answers

IPython workflow (edit, run)

Is there a GUI for IPython that allows me to open/run/edit Python files? My way of working in IDLE is to have two windows open: the shell and a .py file. I edit the .py file, run it, and interact with the results in the shell. Is it possible to use…
compie
  • 9,449
  • 15
  • 51
  • 73
47
votes
12 answers

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

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,…
Jason Dagit
  • 13,034
  • 8
  • 31
  • 54
44
votes
10 answers

how do I launch IDLE, the development environment for Python, on Mac OS 10.7?

I am running python 2.7.1. I can't figure out how to launch the IDLE IDE. I am told it comes already installed with python, but I can't find it using spotlight.
Deonomo
  • 1,475
  • 3
  • 15
  • 24
44
votes
2 answers

Terminating idle mysql connections

I see a lot of connections are open and remain idle for a long time, say 5 minutes. Is there any solution to terminate / close it from server without restarting the mysql service? I am maintaining a legacy PHP system and can not close the…
shantanuo
  • 27,732
  • 66
  • 204
  • 340
44
votes
12 answers

When running a python script in IDLE, is there a way to pass in command line arguments (args)?

I'm testing some python code that parses command line input. Is there a way to pass this input in through IDLE? Currently I'm saving in the IDLE editor and running from a command prompt. I'm running Windows.
Ben Gartner
  • 12,463
  • 10
  • 34
  • 34
43
votes
8 answers

How to remove tab indent from several lines in IDLE?

If you want to indent several lines in Python IDLE you just mark the lines and hit Tab. But what if you want to remove the indent from several lines? Shift+Tab does not work for that in IDLE.
Thanx
  • 6,847
  • 5
  • 19
  • 12
42
votes
3 answers

TypeError: 'filter' object is not subscriptable

I am receiving the error TypeError: 'filter' object is not subscriptable When trying to run the following block of code bonds_unique = {} for bond in bonds_new: if bond[0] < 0: ghost_atom = -(bond[0]) - 1 bond_index = 0 …
1
2 3
87 88