<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>1.6.2 Writing a Python Script </title> <META NAME="description" CONTENT="1.6.2 Writing a Python Script "> <META NAME="keywords" CONTENT="mac"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <meta http-equiv="Content-Type" content="text/html; charset="> <link rel="STYLESHEET" href="mac.css"> <link rel="first" href="mac.html"> <link rel="contents" href="contents.html" title="Contents"> <link rel="index" href="genindex.html" title="Index"> <LINK REL="next" href="IDEexecution.html"> <LINK REL="previous" HREF="node15.html"> <LINK REL="up" href="IDE.html"> <LINK REL="next" href="IDEexecution.html"> </head> <body> <DIV CLASS="navigation"> <table align="center" width="100%" cellpadding="0" cellspacing="2"> <tr> <td><A HREF="node15.html"><img src="../icons/previous.gif" border="0" height="32" alt="Previous Page" width="32"></A></td> <td><A href="IDE.html"><img src="../icons/up.gif" border="0" height="32" alt="Up One Level" width="32"></A></td> <td><A href="IDEexecution.html"><img src="../icons/next.gif" border="0" height="32" alt="Next Page" width="32"></A></td> <td align="center" width="100%">Macintosh Library Modules</td> <td><A href="contents.html"><img src="../icons/contents.gif" border="0" height="32" alt="Contents" width="32"></A></td> <td><a href="modindex.html" title="Module Index"><img src="../icons/modules.gif" border="0" height="32" alt="Module Index" width="32"></a></td> <td><A href="genindex.html"><img src="../icons/index.gif" border="0" height="32" alt="Index" width="32"></A></td> </tr></table> <b class="navlabel">Previous:</b> <a class="sectref" HREF="node15.html">1.6.1 Using the ``Python</A> <b class="navlabel">Up:</b> <a class="sectref" href="IDE.html">1.6 The IDE</A> <b class="navlabel">Next:</b> <a class="sectref" href="IDEexecution.html">1.6.3 Executing a script</A> <br><hr> </DIV> <!--End of Navigation Panel--> <H2><A NAME="SECTION003620000000000000000"> </A> <BR> 1.6.2 Writing a Python Script </H2> <P> In addition to using the <b class="program">Python IDE</b> interactively, you can also type out a complete Python program, saving it incrementally, and execute it or smaller selections of it. <P> You can create a new script, open a previously saved script, and save your currently open script by selecting the appropriate item in the ``File'' menu. Dropping a Python script onto the <b class="program">Python IDE</b> will open it for editting. <P> If you try to open a script with the <b class="program">Python IDE</b> but either can't locate it from the ``Open'' dialog box, or you get an error message like ``Can't open file of type ...'' see section <A href="creator-code.html#creator-code">1.3.2</A>. <P> When the <b class="program">Python IDE</b> saves a script, it uses the creator code settings which are available by clicking on the small black triangle on the top right of the document window, and selecting ``save options''. The default is to save the file with the <b class="program">Python IDE</b> as the creator, this means that you can open the file for editing by simply double-clicking on its icon. You might want to change this behaviour so that it will be opened by the <b class="program">PythonInterpreter</b>, and run. To do this simply choose ``Python Interpreter'' from the ``save options''. Note that these options are associated with the <i>file</i> not the application. <P> <DIV CLASS="navigation"> <p><hr> <table align="center" width="100%" cellpadding="0" cellspacing="2"> <tr> <td><A HREF="node15.html"><img src="../icons/previous.gif" border="0" height="32" alt="Previous Page" width="32"></A></td> <td><A href="IDE.html"><img src="../icons/up.gif" border="0" height="32" alt="Up One Level" width="32"></A></td> <td><A href="IDEexecution.html"><img src="../icons/next.gif" border="0" height="32" alt="Next Page" width="32"></A></td> <td align="center" width="100%">Macintosh Library Modules</td> <td><A href="contents.html"><img src="../icons/contents.gif" border="0" height="32" alt="Contents" width="32"></A></td> <td><a href="modindex.html" title="Module Index"><img src="../icons/modules.gif" border="0" height="32" alt="Module Index" width="32"></a></td> <td><A href="genindex.html"><img src="../icons/index.gif" border="0" height="32" alt="Index" width="32"></A></td> </tr></table> <b class="navlabel">Previous:</b> <a class="sectref" HREF="node15.html">1.6.1 Using the ``Python</A> <b class="navlabel">Up:</b> <a class="sectref" href="IDE.html">1.6 The IDE</A> <b class="navlabel">Next:</b> <a class="sectref" href="IDEexecution.html">1.6.3 Executing a script</A> <hr> <span class="release-info">Release 2.2, documentation updated on December 21, 2001.</span> </DIV> <!--End of Navigation Panel--> <ADDRESS> See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. </ADDRESS> </BODY> </HTML>