<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";
        background:#ECF0F3;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.pre
        {mso-style-name:pre;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>I tried to use the &#8220;-c&#8221; option to run a script called &#8220;a&#8221; with a method called &#8220;Test()&#8221;, and received an error message as follows:<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal style='text-indent:.5in'><span style='font-family:"Courier New"'>S:\&gt;python -c &quot;import a\n a.Test()&quot;<o:p></o:p></span></p><p class=MsoNormal style='text-indent:.5in'><span style='font-family:"Courier New"'>  File &quot;&lt;string&gt;&quot;, line 1<o:p></o:p></span></p><p class=MsoNormal style='text-indent:.5in'><span style='font-family:"Courier New"'>    import a\n a.Test()<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>                      ^<o:p></o:p></span></p><p class=MsoNormal style='text-indent:.5in'><span style='font-family:"Courier New"'>SyntaxError: unexpected character after line continuation character<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-indent:.5in'><span style='font-family:"Courier New"'>S:\&gt;<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>If I replace the &#8220;\n&#8221; with a semicolon, then it works.  Documentation for the interface option &#8220;-c&#8221; reads (<a href="http://docs.python.org/using/cmdline.html#command-line">http://docs.python.org/using/cmdline.html#command-line</a>):<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal style='background:white'><tt><b><span style='font-size:14.5pt;color:black'>-c</span></b></tt><tt><span style='font-size:11.5pt;color:black'> &lt;command&gt;</span></tt><span style='font-family:"Arial","sans-serif";color:black'><a href="http://docs.python.org/using/cmdline.html#cmdoption-unittest-discover-c" title="Permalink to this definition"><span style='font-size:9.5pt;color:#C60F0F'>¶</span></a> <o:p></o:p></span></p><p class=MsoNormal style='mso-margin-bottom-alt:auto;margin-left:.5in;text-align:justify;line-height:130%;background:white'><span style='font-family:"Arial","sans-serif";color:black'>Execute the Python code in <em><span style='font-family:"Arial","sans-serif"'>command</span></em>. <em><span style='font-family:"Arial","sans-serif"'>command</span></em> can be one or more statements <span style='background:yellow;mso-highlight:yellow'>separated by newlines</span>, with significant leading whitespace as in normal module code.<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>I am running 64-bit Python27 on Windows Vista.  I have not tried this with any other version of Python or on any other platform.  In my personal opinion, the semicolon is cleaner than the &#8216;\n&#8217; anyway, so I would prefer that the documentation just be updated to say &#8220;separated by semicolons&#8221; instead of &#8220;separated by newlines&#8221;, but that is assuming all other versions of Python on all platforms behave the same.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Thanks,<o:p></o:p></p><p class=MsoNormal><span style='font-family:"Times New Roman","serif"'>Joshua D. Hodson<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Times New Roman","serif"'>ATK Aerospace Systems<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Times New Roman","serif"'><a href="mailto:josh.hodson@atk.com">josh.hodson@atk.com</a><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Times New Roman","serif"'>(435) 863-3646<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></body></html>