[Tutor] running scripts in IDLE

Ron Nixon nixonron@yahoo.com
Thu, 7 Mar 2002 09:19:40 -0800 (PST)


--0-904170643-1015521580=:26912
Content-Type: text/plain; charset=us-ascii


 

 

I have this script

myfile = open("c:/menu.txt", 'r')
    for line in myfile.readlines():
        print line
     myfile.close()

 

I save it and hit "run script". I get invalid syntax. What is going on? Am I not doing this right. I though in order to run a script. You wrote the script out, save it and then open it in IDLE and hit run script. Am I mistaken?



---------------------------------
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
--0-904170643-1015521580=:26912
Content-Type: text/html; charset=us-ascii

<P>&nbsp;</P>
<P>&nbsp;</P>
<P>I have this script</P>
<P>myfile = open("c:/menu.txt", 'r')<BR>&nbsp;&nbsp;&nbsp; for line in myfile.readlines():<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print line<BR>&nbsp;&nbsp;&nbsp;&nbsp; myfile.close()</P>
<P>&nbsp;</P>
<P>I save it and hit "run script". I get invalid syntax. What is going on? Am I not doing this right. I though in order to run a script. You wrote the script out, save it and then open it in IDLE and hit run script. Am I mistaken?</P><p><br><hr size=1><b>Do You Yahoo!?</b><br>
Try FREE <a href="$rd_url/tag/http://mail.yahoo.com/">Yahoo! Mail</a> - the world's greatest free email!
--0-904170643-1015521580=:26912--