From taleinat at gmail.com Mon Dec 1 08:13:25 2008 From: taleinat at gmail.com (Tal Einat) Date: Mon, 1 Dec 2008 09:13:25 +0200 Subject: [Idle-dev] multiprocessing module and IDLE without subprocess In-Reply-To: <13e3f9930811290637u662ab699i625b1a67b0753339@mail.gmail.com> References: <13e3f9930811280617t6630e5beu2fcb4d4b08d7d5f8@mail.gmail.com> <7afdee2f0811290337j1fa9195y8a65cfbd7845b8bc@mail.gmail.com> <13e3f9930811290637u662ab699i625b1a67b0753339@mail.gmail.com> Message-ID: <7afdee2f0811302313o25909b48m61c0c72b1e60609@mail.gmail.com> Weeble wrote: > > I'm certainly interested enough to give it a go, but I don't know a > whole lot about Python development. I have managed (I think) to sync > up and build a copy of trunk using Visual C++ Express 2008. I'm not > really sure about how to make patches, but I'm not going to worry > about that until I have actually made any useful changes. > Well, the nice thing about IDLE is that it is implemented in pure Python. This means you don't have to compile at all to make changes; just edit IDLE's code and run it. IDLE's code is found under the Lib/idlelib directory where your Python library files are found. Under Windows this is found where you installed Python (C:\Python26 by default for Python2.6). When working on IDLE it is useful to run it from the command line so you can see exception output etc. On windows, open a command prompt and run: C:\Python26\python.exe C:\Python26\Lib\idlelib\idle.py Good luck! - Tal -------------- next part -------------- An HTML attachment was scrubbed... URL: From clockworksaint at gmail.com Mon Dec 1 12:32:59 2008 From: clockworksaint at gmail.com (Weeble) Date: Mon, 1 Dec 2008 11:32:59 +0000 Subject: [Idle-dev] multiprocessing module and IDLE without subprocess In-Reply-To: <7afdee2f0811302313o25909b48m61c0c72b1e60609@mail.gmail.com> References: <13e3f9930811280617t6630e5beu2fcb4d4b08d7d5f8@mail.gmail.com> <7afdee2f0811290337j1fa9195y8a65cfbd7845b8bc@mail.gmail.com> <13e3f9930811290637u662ab699i625b1a67b0753339@mail.gmail.com> <7afdee2f0811302313o25909b48m61c0c72b1e60609@mail.gmail.com> Message-ID: <13e3f9930812010332x36678772qcf02d5bdaf928e0d@mail.gmail.com> On Mon, Dec 1, 2008 at 7:13 AM, Tal Einat wrote: > Well, the nice thing about IDLE is that it is implemented in pure Python. > This means you don't have to compile at all to make changes; just edit > IDLE's code and run it. Yep, I just figured that I should start with the version in trunk so that the resultant patches would be most useful. Building was a smoother than I expected, but I had to copy TK/TCL DLLs into the working directory to get "import _tkinter" to work, and I'm not entirely sure why. > IDLE's code is found under the Lib/idlelib directory where your Python > library files are found. Under Windows this is found where you installed > Python (C:\Python26 by default for Python2.6). > > When working on IDLE it is useful to run it from the command line so you can > see exception output etc. On windows, open a command prompt and run: > C:\Python26\python.exe C:\Python26\Lib\idlelib\idle.py Thanks! I made the changes and it seems to work, and I'll see about making up a patch tonight. As I noted before, in order to get the port number, I need to bind the socket before spawning the subprocess, and the comments lead me to believe that this means that the subprocess will also inherit the socket. However, it seems that this happens *anyway* when you restart the subprocess, so I imagine it's not a particularly bad thing. Or is it only bad if the socket is in the "listening" state at the time you spawn the subprocess? I'm also curious why IDLE uses sockets to communicate with the subprocess in the first place. Are other forms of IPC not suitable? From taleinat at gmail.com Tue Dec 2 16:03:00 2008 From: taleinat at gmail.com (Tal Einat) Date: Tue, 2 Dec 2008 17:03:00 +0200 Subject: [Idle-dev] right click to edit in windowsXP In-Reply-To: <50CE562EE612A046BF831CD48CF112896AD315@ELSCA-EXB-AV1.ticketmaster.corp> References: <50CE562EE612A046BF831CD48CF112896AD315@ELSCA-EXB-AV1.ticketmaster.corp> Message-ID: <7afdee2f0812020703v26e7ad76jec83a364b5281f08@mail.gmail.com> Sean Wolfe wrote: > hey everybody! first of all thanks for a fun, lightweight, friendly ide. I'm > just poking around using Python as a way to learn basic coding, and idle is > a fun place to do work. > > I'm seeing a problem when I right-click and then hit F5 to run the program, > where the first time I run the program it works fine, but subsequent runs > fail. I'm using the pygame module and windowsXP. For example, a font I'm > trying to render with pygame, first time renders fine, subsequent runs error > that the font has no width. Opening the file via the executeable works fine. > > Doing some research, I noticed this on the pygame.org page: > > "On Windows if you open a python file with a "right-click: Edit with Idle" > the editor and interactive prompt both run from the same Python process." > > http://www.pygame.org/wiki/FrequentlyAskedQuestions > > Is there a way to use the right-click option and save the F5 runs spawn a > new python process? > > anyhow. . . thanks! > Hi Sean, Sorry for the long delay before answering... Yes, there is a way. You need to edit your registry and remove the -n flag which is used when running IDLE via the "Edit with IDLE" context-menu option. If you do this, however, you will only be able to open one instance of IDLE at a time in this way; trying to open another one in the same manner will cause a 10 second delay after which you will receive an annoying error message. There is a way to get this working smoothly with as many instances of IDLE as you like, but that requires patching your version of IDLE. I'd be glad to explain how if you're that motivated :) - Tal From taleinat at gmail.com Tue Dec 2 17:10:47 2008 From: taleinat at gmail.com (Tal Einat) Date: Tue, 2 Dec 2008 18:10:47 +0200 Subject: [Idle-dev] multiprocessing module and IDLE without subprocess In-Reply-To: <13e3f9930812010332x36678772qcf02d5bdaf928e0d@mail.gmail.com> References: <13e3f9930811280617t6630e5beu2fcb4d4b08d7d5f8@mail.gmail.com> <7afdee2f0811290337j1fa9195y8a65cfbd7845b8bc@mail.gmail.com> <13e3f9930811290637u662ab699i625b1a67b0753339@mail.gmail.com> <7afdee2f0811302313o25909b48m61c0c72b1e60609@mail.gmail.com> <13e3f9930812010332x36678772qcf02d5bdaf928e0d@mail.gmail.com> Message-ID: <7afdee2f0812020810n5725206ey3ff8c9e56d7f0d77@mail.gmail.com> Weeble wrote: > I'm also curious why IDLE uses sockets to communicate with the > subprocess in the first place. Are other forms of IPC not suitable? > Generally speaking, using sockets is the most portable form of IPC across all platforms. You'll see that most RPC libraries use sockets, if not all of them. (IDLE uses a custom RPC mechanism to communicate with the sub-process). And communicating via sockets is certainly fast enough for IDLE's needs. From sean at ticketweb.com Tue Dec 2 19:04:24 2008 From: sean at ticketweb.com (Sean Wolfe) Date: Tue, 2 Dec 2008 10:04:24 -0800 Subject: [Idle-dev] right click to edit in windowsXP In-Reply-To: <7afdee2f0812020703v26e7ad76jec83a364b5281f08@mail.gmail.com> References: <50CE562EE612A046BF831CD48CF112896AD315@ELSCA-EXB-AV1.ticketmaster.corp> <7afdee2f0812020703v26e7ad76jec83a364b5281f08@mail.gmail.com> Message-ID: <50CE562EE612A046BF831CD48CF112896AD317@ELSCA-EXB-AV1.ticketmaster.corp> Hey Tal, thanks for the reply. I'd love to hear about the patch if you are so inclined :o) -----Original Message----- From: Tal Einat [mailto:taleinat at gmail.com] Sent: Tuesday, December 02, 2008 7:03 AM To: idle-dev Cc: Sean Wolfe Subject: Re: [Idle-dev] right click to edit in windowsXP Sean Wolfe wrote: > hey everybody! first of all thanks for a fun, lightweight, friendly > ide. I'm just poking around using Python as a way to learn basic > coding, and idle is a fun place to do work. > > I'm seeing a problem when I right-click and then hit F5 to run the > program, where the first time I run the program it works fine, but > subsequent runs fail. I'm using the pygame module and windowsXP. For > example, a font I'm trying to render with pygame, first time renders > fine, subsequent runs error that the font has no width. Opening the file via the executeable works fine. > > Doing some research, I noticed this on the pygame.org page: > > "On Windows if you open a python file with a "right-click: Edit with Idle" > the editor and interactive prompt both run from the same Python process." > > http://www.pygame.org/wiki/FrequentlyAskedQuestions > > Is there a way to use the right-click option and save the F5 runs > spawn a new python process?> > anyhow. . . thanks! > Hi Sean, Sorry for the long delay before answering... Yes, there is a way. You need to edit your registry and remove the -n flag which is used when running IDLE via the "Edit with IDLE" context-menu option. If you do this, however, you will only be able to open one instance of IDLE at a time in this way; trying to open another one in the same manner will cause a 10 second delay after which you will receive an annoying error message. There is a way to get this working smoothly with as many instances of IDLE as you like, but that requires patching your version of IDLE. I'd be glad to explain how if you're that motivated :) - Tal