IDLE question

R

Rolf Wester

Hi,

I would like to use IDLE as interactively as I can with Emacs. In Emacs
I can send a marked region to the Python interpreter. Is there any way
to do the same thing with IDLE?

Thank you in advance

Regards

Rolf Wester
 
K

Kartic

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
 
I

Ishwor

Hi,

I would like to use IDLE as interactively as I can with Emacs. In Emacs
I can send a marked region to the Python interpreter. Is there any way
to do the same thing with IDLE?
Although i don't use anything much beside IDLE, vim for coding, AFAIK
IDLE can't do that.
IDLE opens up python shell. Within that shell you type in your script
, commands and create objects as such......The interpreter will
execute your code then.
IDLE looks like this when you fire it up.

Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.

****************************************************************
Personal firewall software may warn about the connection IDLE
makes to its subprocess using this computer's internal loopback
interface. This connection is not visible on any external
interface and no data is sent to or received from the Internet.
****************************************************************

IDLE 1.1
# this is the Python shell.

l = ['spam','eggs'] # you assign and create a list variable called l
l # prints the content of l.
['spam', 'eggs']

[snip]
 
K

Kurt B. Kaiser

Ishwor said:
Although i don't use anything much beside IDLE, vim for coding, AFAIK
IDLE can't do that.
IDLE opens up python shell. Within that shell you type in your script
, commands and create objects as such......The interpreter will
execute your code then.

Copy. Paste at shell prompt. <enter>.

I'm thinking about adding copy and paste to right click menu.
Maybe paste/exec would be cool in the shell window.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top