IDLE question

Kartic kartic.krishnamurthy at gmail.com
Sun Dec 26 15:30:54 EST 2004


Rolf,

IDLE presents you with an interactive python prompt where you can enter
your code : single statments, class definitions, functions and it will
execute interactively.

>From the IDLE editor, I doubt if you can do what you want. In fact IDLE
will force you to save your code in a file before you can execute it.

To achieve what you describe (select a portion and execute) in IDLE, I
use exec() or alternatively the compiler module both of which can take
statements in a string variable and execute it. This works for me; may
be there is a better way.

Thanks,
--Kartic




More information about the Python-list mailing list