Re: Python Question
ang, on host 64.77.158.157
Friday, June 14, 2002, at 18:06:17
Re: Python Question posted by Sam on Friday, June 14, 2002, at 17:46:38:
> > I'm just getting started learning python but when I try to 'Run Script' (from the Edit menu) I get an error message "The buffer for Python Shell is not saved. Please save it first!" I get this after I've: opened a new window, typed 4 command lines *exactly* like they are in the tutorial and saved it. I can't find anything on the tutorial site that says anything about this. > > I downloaded the Python for Windows package and fired up IDLE to see what the situation was. It seems like an odd way for them to do things. Anyway, I got the error message you did if I didn't save ahead of time. But I managed to make something work. I don't know exactly what you did, so here is exactly what I did: > > 1. Started up IDLE. > 2. Selected File/New Window. > 3. In this second window, typed in this one-line program: > > print "Hello, World!" > > 4. Still in the second window, did File/Save, giving it the filename of test.py. > 5. Still in the second window, did Edit/Run Script. > 6. Back in the first window, the results were displayed. > > What you probably did was do the Edit/Run Script from the *first* window, which does indeed give me that error message. > > I think the idea is that you use the second window to edit and run your program, and you use the first window to receive the output from your programs as well as to enter in any direct lines of code that you want to execute immediately. For example, you could type... > > print "Hello, world!" > > ...directly in the first window (with the >>> prompt) and it would run as soon as you hit return.
Thanks!! I hated getting stopped before I really got started.
Angela
|