Editing in IDLE

P

peterfarrell66

Hello to the group!

I'm a new Python user and so far I'm enjoying it. One of the many newbie problems I'm having is I can't edit my code in IDLE once it's run or there's an error message. I can only copy the code so far, paste at the bottom and continue coding. Is there something simple I'm missing, or should I be using a different editor?

Thanks in advance!

Peter Farrell
 
T

Terry Reedy

Hello to the group!

I'm a new Python user and so far I'm enjoying it. One of the many
newbie problems I'm having is I can't edit my code in IDLE once it's
run or there's an error message. I can only copy the code so far,
paste at the bottom and continue coding. Is there something simple
I'm missing, or should I be using a different editor?

You are missing how to use IDLE. It has two kinds of windows:
interactive Shell and Edit windows. The shell more or less emulates the
interactive interpreter, running one statement at a time. You can put
the cursor on a previous statement and hit return to make it the current
statement, where you can edit it. You edit normal multi-statement code
in edit windows, hit F5 to run, edit, run, edit, run.
 
C

Chris Angelico

Hello to the group!

I'm a new Python user and so far I'm enjoying it. One of the many newbie problems I'm having is I can't edit my code in IDLE once it's run or there's an error message. I can only copy the code so far, paste at the bottom and continue coding. Is there something simple I'm missing, or should I be using a different editor?

I only ever use IDLE in its interactive mode (at which, imho, it's
rather better than the default Python interactive mode, as it
auto-indents). In that mode, you can retrieve previous commands with
Alt-P - at least, that's the keystroke on Windows, not sure if it's
different on other platforms.

For editing code that's to be saved in a .py file, I use SciTE, but a
lot of people do use IDLE for that too. It's a matter of personal
preference.

ChrisA
 
P

peterfarrell66

Thanks for the responses, Terry and Chris, I'll try the shell, alt-P and I'll check out SciTE!

Peter
 
P

peterfarrell66

Thanks for the responses, Terry and Chris, I'll try the shell, alt-P and I'll check out SciTE!

Peter
 

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,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top