[Tutor] can't run script

alan.gauld@bt.com alan.gauld@bt.com
Fri Jan 31 06:00:10 2003


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C2C917.94F04400
Content-Type: text/plain;
	charset="iso-8859-1"

You don't say how you are saving your script, but it sounds like you are
trying 
to save an interactive session in IDLE as a script? You can't do that
because 
it will include all the >>> prompts etc.
 
You need to create the script in a new window(File->New) and save from
there.
 
This is covered (briefly) in my tutorial and also in Danny's intro to IDLE.
 
Same principle applies if you use Pythonwin.
 
Alan g. 
Author of the Learn to Program website 
http://www.freenetpages.co.uk/hp/alan.gauld/
<http://www.freenetpages.co.uk/hp/alan.gauld/>  
 
PS 
A nice enhancement to both IDEs would be a "Save As Script" feature for the
shell windows...

-----Original Message-----
From: tutor-admin@python.org [mailto:tutor-admin@python.org]On Behalf Of
Mike Cluster
Sent: 28 January 2003 23:22
To: tutor@python.org
Subject: [Tutor] can't run script


 
I am new to both programming and python, but I've been able to work in
interactive
mode and make some progress. However I am unable to save and "run script"-
every time I try I get an "invalid syntax" error message. None of the
tutorials
seem to address this or anticipate it as a problem.?????????????
mike


------_=_NextPart_001_01C2C917.94F04400
Content-Type: text/html;
	charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">






<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=014585010-31012003>You 
don't say how you are saving your script, but it sounds like you are trying 
</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=014585010-31012003>to 
save an interactive session in IDLE as a script? You can't do that because 
</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=014585010-31012003>it 
will include all the &gt;&gt;&gt; prompts etc.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=014585010-31012003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=014585010-31012003>You 
need to create the script in a new window(File-&gt;New) and save from 
there.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=014585010-31012003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=014585010-31012003>This 
is covered (briefly) in my tutorial and also in Danny's intro to 
IDLE.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=014585010-31012003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=014585010-31012003>Same 
principle applies if you use Pythonwin.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=014585010-31012003><FONT 
face="Courier New" size=2></FONT></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=014585010-31012003><FONT 
face="Courier New" size=2>Alan g.</FONT> <BR><FONT face="Courier New" 
size=2>Author of the Learn to Program website</FONT> <BR><FONT 
face="Courier New" size=2><A target=_blank 
href="http://www.freenetpages.co.uk/hp/alan.gauld/">http://www.freenetpages.co.uk/hp/alan.gauld/</A></FONT> 
</DIV></SPAN></FONT>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=014585010-31012003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=014585010-31012003>PS 
</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=014585010-31012003>A nice 
enhancement to both IDEs would be a "Save As Script" feature for the shell 
windows...</SPAN></FONT></DIV>
<BLOCKQUOTE dir=ltr 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma 
  size=2>-----Original Message-----<BR><B>From:</B> tutor-admin@python.org 
  [mailto:tutor-admin@python.org]<B>On Behalf Of </B>Mike 
  Cluster<BR><B>Sent:</B> 28 January 2003 23:22<BR><B>To:</B> 
  tutor@python.org<BR><B>Subject:</B> [Tutor] can't run 
  script<BR><BR></FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT color=#000000 size=2>I am new to both programming and python, but 
  I've been able to work in interactive</FONT></DIV>
  <DIV><FONT color=#000000 size=2>mode and make some progress. However I am 
  unable to save and "run script"-</FONT></DIV>
  <DIV><FONT color=#000000 size=2>every time I try I get an "invalid syntax" 
  error message. None of the tutorials</FONT></DIV>
  <DIV><FONT color=#000000 size=2>seem to address this or anticipate it as a 
  problem.?????????????</FONT></DIV>
  <DIV><FONT color=#000000 size=2>mike</FONT></DIV></BLOCKQUOTE></BODY></HTML>

------_=_NextPart_001_01C2C917.94F04400--