<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Luke, Jacob, et. al...</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Dumb question (may be slightly off course from what you two were discussing), but are you both describing how to get the IDLE to run along with the editor? I may just be getting too many things confused. I've tried to run IDLE, but that's not working. I have the same function through opening it separately from the Start menu but then it doesn't work as IDLE should work with the editor (or so I've been told that happens). I can type the word Python in my editor and it comes up, but then the editor is gone. I've gone so long with just SSH, but at this point it's worth it if I find a way that makes sense. As someone mentioned from this list, at least it'll be code that is easier to read for a newbie like myself. </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">(Hope that didn't confuse or cause unnecessary headaches...)</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Sara<BR><BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">----- Original Message ----<BR>From: Luke Paireepinart <rabidpoobear@gmail.com><BR>To: Tiger12506 <keridee@jayco.net><BR>Cc: tutor@python.org<BR>Sent: Monday, July 16, 2007 7:00:53 PM<BR>Subject: Re: [Tutor] interpreter restarts<BR><BR>
<DIV>Tiger12506 wrote:<BR>>> But there's an exception to that - if you right-click a file in Windoze<BR>>> and 'edit' it,<BR>>> IDLE won't open up its subprocess, and as such, it can't restart the<BR>>> interpreter session because it's running in the same<BR>>> process as IDLE, and to restart the interpreter would mean restarting <BR>>> IDLE.<BR>>> Boy, that 'edit with idle' thing sure does cause some problems, don't it? <BR>>> :)<BR>>> -Luke<BR>>> <BR>><BR>> Thanks, Luke. I hadn't thought of that. Question: Why won't IDLE open up its <BR>> subprocess?<BR>><BR>> This is the command that is in the registry concerning the Edit with IDLE <BR>> menu.<BR>> "C:\Python25\pythonw.exe" "C:\Python25\Lib\idlelib\idle.pyw" -n -e "%1"<BR>><BR>> This is the Target for the shortcut in the Start Menu (Note: the Target box <BR>> was disabled!)<BR>> Python
2.5.1<BR>><BR>> I thought that this was incredibly strange, so I opened this shortcut in a <BR>> hex editor to see what was different about this shortcut. (Normally, they <BR>> have a path in the target box)<BR>><BR>> What I found surprised me. The title of the file in the hex editor said <BR>> "python_icon.exe"<BR>> I started laughing maniacally and checked the full path of the file from <BR>> within the hex editor.<BR>> C:\windows\installer\{31800004-6386-4999-a519-518f2d78d8f0}\python_icon.exe<BR>><BR>> IDLE is started in two *very* different ways. So my next question was: Can <BR>> you pass arguments to this python_icon.exe? Simple navigations to that <BR>> directory and a confirmation... Yuck. You can't even execute it from <BR>> explorer. A low-level ZwTerminateProcess function from ntdll is called ... <BR>> Let me try something...<BR>><BR>> Woah... {31800004-6386-4999-a519-518f2d78d8f0} appears in the registry in
<BR>> alot of places. The Uninstall key for Add/Remove Programs, some weird data <BR>> thing... Okay, this is beyond me. I don't know the registry or understand <BR>> CLSIDs very well. Someone who knows Windows inside and out has done a number <BR>> with the python installer, or at least the msi installer does this all <BR>> automatically. Interesting. I wonder just how python_icon.exe starts IDLE. <BR>> If I could figure that out, I could emulate it with the Edit w/Idle menu <BR>> item and get IDLE to start a subprocess! But how.... any ideas?<BR>> <BR>It sounds like python_icon.exe is a fake executable that just contains <BR>the icon for python programs...<BR>hence the name.<BR>You probably stumbled across the path to the icon to use, instead of the <BR>path that is used when running the 'Edit with IDLE' thing.<BR>Try this:<BR>open an Explorer window, via Start Button -> Run -> explorer {ENTER}<BR>or your favorite
method. Use the My Computer shortcut if you want, <BR>either way.<BR>Now hit "Alt, t, o" to browse to the Tools -> Folder Options menu setting.<BR>Go to the File Types tab, and scroll down till you find "PY"<BR>click the Advanced button.<BR>You should now see a dialog box with Edit with IDLE listed under actions.<BR>Click Edit when "Edit with IDLE" is selected.<BR>in the "Application used to perform action:" field you should see <BR>something like this:<BR><BR>"C:\Python24\pythonw.exe" "C:\Python24\Lib\idlelib\idle.pyw" -n -e "%1"<BR><BR>Basically, this is the same as saying:<BR>python idle.py<BR>except it's more verbose because python may not be on your path (and <BR>pythonw is used instead of python so there's no dos box)<BR>As you will notice, there are some parameters there at the end.<BR>the -n is the one you're interested in .<BR>-n means no subprocess.<BR>Just remove that, and you will have a subprocess on the 'Edit with IDLE' <BR>feature.<BR>There is
some caveat here - it doesn't work correctly on some systems, <BR>I'm told.<BR>I've never had problems changing this, but I don't recommend it to <BR>people randomly just in case it were to cause problems for them.<BR>Then I'd feel bad.<BR>But since you asked, I thought I'd give you all the info you need.<BR>HTH,<BR>-Luke<BR>P.S. nice detective skillz ;)<BR>_______________________________________________<BR>Tutor maillist - Tutor@python.org<BR><A href="http://mail.python.org/mailman/listinfo/tutor" target=_blank>http://mail.python.org/mailman/listinfo/tutor</A></DIV></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR></DIV></div><br>
<hr size=1>Get the Yahoo! toolbar and <a href="http://us.rd.yahoo.com/evt=48225/*http://new.toolbar.yahoo.com/toolbar/features/mail/index.php">be alerted to new email </a>wherever you're surfing. </body></html>