<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:'Courier New', courier, monaco, monospace, sans-serif;font-size:10pt"><div></div><div>Forwarding to the tutor list with cut n paste sessions.<br>&nbsp;</div><div>It looks to me like the code page issue somebody else&nbsp;</div><div>referred to is the problem but the behaviour seems a&nbsp;</div><div>bit extreme, I'd have thought it might have chosen&nbsp;</div><div>a default value or something...</div><div><br></div><div>But I'm not sure what causes it to select cp720 in&nbsp;</div><div>the first place. Where does Py_Initialize get its values?</div><div>Are they set in the environment somewhere?</div><div><br></div><div>And why is 2.6 OK? I know 3.0 did some changes around&nbsp;</div><div>locale handling but I can't recall what they were.&nbsp;</div><div>I assume this is a side effect of those changes?</div><div><br></div>Alan Gauld<br>Author of the
 Learn To Program website<br><a rel="nofollow" target="_blank" href="http://www.alan-g.me.uk">http://www.alan-g.me.uk/<br></a><div><br></div><div style="font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt"><br><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><font size="2" face="Tahoma">----- Forwarded Message ----<br><b><span style="font-weight: bold;">From:</span></b> Khalid Al-Ghamdi &lt;emailkgnow@gmail.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> ALAN GAULD &lt;alan.gauld@btinternet.com&gt;<br><b><span style="font-weight: bold;">Sent:</span></b> Sunday, 15 November, 2009 18:02:25<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Tutor] getting python 3 to run from the command line (version 2)<br></font><br><div dir="ltr">Hi,<div>I'm really sorry for this hassle!</div><div><br></div><div><b><u>Python31 (gives
 error):</u></b></div><div><br></div><div><div><div>C:\Users\KE&gt;python</div><div>Fatal Python error: Py_Initialize: can't initialize sys standard streams</div>
<div>LookupError: unknown encoding: cp720</div><div><br></div><div>This application has requested the Runtime to terminate it in an unusual way.</div><div>Please contact the application's support team for more information.</div>
<div><br></div><div>C:\Users\KE&gt;cd c:\python31</div><div><br></div><div>c:\Python31&gt;python</div><div>Fatal Python error: Py_Initialize: can't initialize sys standard streams</div><div>LookupError: unknown encoding: cp720</div>
<div><br></div><div>This application has requested the Runtime to terminate it in an unusual way.</div><div>Please contact the application's support team for more information.</div><div><br></div><div><b><u>Python30 (doesn't respond):</u></b></div>
<div><br></div><div>c:\Python31&gt;cd c:\python30</div><div><br></div><div>c:\Python30&gt;python</div><div>Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit (Intel)] on</div><div>win32</div><div>Type "help", "copyright", "credits" or "license" for more information.</div>
<div>&gt;&gt;&gt; 2+2</div><div>&gt;&gt;&gt;&nbsp;</div><div><br></div><div><div><b><u>Python26(works ok):</u></b></div><div><b><u><br></u></b></div><div>C:\Users\KE&gt;cd c:\python26</div><div><br></div><div>c:\Python26&gt;python</div>
<div>Python 2.6.1 (r261:67517, Dec &nbsp;4 2008, 16:51:00) [MSC v.1500 32 bit (Intel)] on</div><div>win32</div><div>Type "help", "copyright", "credits" or "license" for more information.</div>
<div>&gt;&gt;&gt; 2+2</div><div>4</div><div>&gt;&gt;&gt;</div><div><br></div><div>Thanks very much</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><div><br></div></div>
<div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><br><div class="gmail_quote">On Sun, Nov 15, 2009 at 8:16 PM, ALAN GAULD <span dir="ltr">&lt;<a rel="nofollow" ymailto="mailto:alan.gauld@btinternet.com" target="_blank" href="mailto:alan.gauld@btinternet.com">alan.gauld@btinternet.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div style="font-size:10pt;"><div></div>
<div>Unfortunately the image didn't get to me.</div><div><br></div><div>To copy/paste from a cmd window click the small icon&nbsp;</div><div>at the left hand end of the title bar.</div><div><br></div><div>From that select Edit-&gt;Mark</div>
<div>Use the mouse to select the text you want to copy</div><div>Use the menu again to do Edit-&gt;Copy</div><div><br></div><div>Now paste into your mail program.</div><div><br></div><div>You can make this easier by opening the properties&nbsp;</div>
<div>dialog from the same menu, and on the Options tag&nbsp;</div><div>tick QuickEdit. This will allow you to select with&nbsp;</div><div>the mouse and copy by hitting return after selecting.</div><div><br></div><div>This is very useful when sending python examples&nbsp;</div>
<div>to the
 tutor list! :-)&nbsp;</div><div><br></div><div><br></div>Alan Gauld<br>Author of the Learn To Program website<div class="im"><br><a rel="nofollow" target="_blank" href="http://www.alan-g.me.uk">http://www.alan-g.me.uk/<br></a><div>
<br></div></div><div style="font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt;"><br><div style="font-family:times new roman, new york, times, serif;font-size:12pt;"><font size="2" face="Tahoma"><hr size="1">
<b><span style="font-weight:bold;">From:</span></b> Khalid Al-Ghamdi &lt;<a rel="nofollow" ymailto="mailto:emailkgnow@gmail.com" target="_blank" href="mailto:emailkgnow@gmail.com">emailkgnow@gmail.com</a>&gt;<br><b><span style="font-weight:bold;">To:</span></b> Alan Gauld &lt;<a rel="nofollow" ymailto="mailto:alan.gauld@btinternet.com" target="_blank" href="mailto:alan.gauld@btinternet.com">alan.gauld@btinternet.com</a>&gt;<br>
<b><span style="font-weight:bold;">Sent:</span></b> Sunday, 15 November, 2009 7:11:06<br><b><span style="font-weight:bold;">Subject:</span></b> Re: [Tutor] getting python 3 to run from the command line (version 2)<br></font><div>
<div></div><div class="h5"><br><div dir="ltr"><div>Hi Alan,</div><div><br></div><div><div>this is how the problem looks from
 my work pc (which is xp. at home i use vista). and yes i don't know how copy and paste from the cmd so here is an image:</div>
<div><br></div><div><br></div></div><img src="http://files.posterous.com/emailkgnow/CIsmbXVuB1T6frAbG2vAFAWFy1dSomwz8QW9j953D7CNm9xFMo67i8crusTR/python.jpg?AWSAccessKeyId=1C9REJR1EMRZ83Q7QRG2&amp;Expires=1258268773&amp;Signature=cRw%2BeXSxhxKXbg%2B7Oxy1xwbBIvM%3D" alt="python.jpg?AWSAccessKeyId=1C9REJR1EMRZ83Q7QRG2&amp;Expires=1258268773&amp;Signature=cRw%2BeXSxhxKXbg%2B7Oxy1xwbBIvM%3D" title="python.jpg?AWSAccessKeyId=1C9REJR1EMRZ83Q7QRG2&amp;Expires=1258268773&amp;Signature=cRw%2BeXSxhxKXbg%2B7Oxy1xwbBIvM%3D"><br>

<div class="gmail_quote"><br></div><div class="gmail_quote"><div>As you can see when I try to access python31 it gives me the error above. When I use python 26 it works fine.</div><div>Now, I don't have python30 installed at my work PC, but what happens is when I enter c:\python30\python it initiates and gives me a blank prompt(&gt;&gt;&gt;) then when i enter something (2+2 for example) it returns (&gt;&gt;&gt;) as if i just pressed enter without entering any code. It just doesn't process the code for me.&nbsp;</div>

<div><br></div><div>I hope you can be of help.</div><div><br></div><div>thanks&nbsp;</div></div><div class="gmail_quote"><br></div><div class="gmail_quote">On Sat, Nov 14, 2009 at 9:56 PM, Alan Gauld <span dir="ltr">&lt;<a rel="nofollow" ymailto="mailto:alan.gauld@btinternet.com" target="_blank" href="mailto:alan.gauld@btinternet.com">alan.gauld@btinternet.com</a>&gt;</span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
"Khalid Al-Ghamdi" &lt;<a rel="nofollow" ymailto="mailto:emailkgnow@gmail.com" target="_blank" href="mailto:emailkgnow@gmail.com">emailkgnow@gmail.com</a>&gt; wrote<div><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
when i try to code something it just gives me a new line without any<br>
processing of the code. (for example:2+2 returns a new line)<br>
</blockquote>
<br></div>
You mean you get to the &gt;&gt;&gt; prompt?<br>
And you type 2+2 you get this:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">




2+2<br>
</blockquote></blockquote></blockquote>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">




<br>
</blockquote></blockquote></blockquote>
<br>
With just a newline between your input and the next &gt;&gt;&gt; prompt?<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div>
when I tried to change the path to the directory that contains python 31 and<br></div>
enter *python (c:\python31&gt;)*,<br>
</blockquote>
<br>
I'm not surprised it doesn't work, that should have python trying to start<br>
executing a folder. But....<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
*fatal python error: Py_Initialize: can't initialize sys standard streams<br>
</blockquote>
<br>
I get a very different message:<br>
<br>
C:\Documents and Settings\Alan Gauld&gt;python (C:\Python31)<br>
python: can't open file '(C:\Python31)': [Errno 22] Invalid argument<div><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
When i change the directory to c:\python26 and then enter it works ok.<br>
so can anyone tell me why this is happening?<br>
</blockquote>
<br></div>
Nope, sorry, I don't understand how the 2.6 version works if<br>
you are passing in a folder as you did for 3.1<br>
<br>
Do you know how to cut n paste from a cmd window&gt;<br>
It would probably help if you pasted in the actuall sessions<br>
into your mail.<br>
<br>
HTH,<br>
<br>
<br>
-- <br><font color="#888888">
Alan Gauld</font><div><br>
Author of the Learn to Program web site<br>
<a rel="nofollow" target="_blank" href="http://www.alan-g.me.uk/">http://www.alan-g.me.uk/</a> <br>
<br></div><div><div></div><div>
_______________________________________________<br>
Tutor maillist &nbsp;- &nbsp;<a rel="nofollow" ymailto="mailto:Tutor@python.org" target="_blank" href="mailto:Tutor@python.org">Tutor@python.org</a><br>
To unsubscribe or change subscription options:<br>
<a rel="nofollow" target="_blank" href="http://mail.python.org/mailman/listinfo/tutor">http://mail.python.org/mailman/listinfo/tutor</a><br>
</div></div></blockquote></div><br></div>
</div></div></div></div><div></div>



</div></div></blockquote></div><br></div></div>
</div></div><div style="position:fixed"></div>


<!-- cg5.c241.mail.ird.yahoo.com compressed/chunked Fri Nov  6 01:34:17 PST 2009 -->
</div></body></html>