pythonw does not terminate on exiting leo

15 views
Skip to first unread message

Norton

unread,
Nov 23, 2009, 9:57:23 AM11/23/09
to leo-editor
I recently acquired a new (WinXP) system and have gradually been
migrating my applications over to it. After migrating Python/Qt/Leo,
I noticed a number of pythonw process accumulating. I was tipped off
to this when shutdown complained that pythonw was still running.
Experimentation suggests this is more likely to happen when I start
leo by double-clicking on a .leo file in explorer. I tried issuing the
commands interactively at the commad line using both python.exe and
pythonw.exe. In neither case did I get a consistent failure to
terminate. With python.exe, I have never seen this problem. With
pythonw.exe issued from the command line I may have gotten it to fail
this way once, but it seems to terminate OK almost every time.

The current configuration is that .leo is associated with the command
below (specifying pythonw, not python). I will try moving these
commands into a batch file to see if that helps.

Has anyone else seen this sort of issue or know of a work-around?

-Norton

C:\Documents and Settings\nort>"C:\Python26\python.exe" "C:
\Python26\Lib\site-packages\Leo-4.7-beta-1\launchLeo.py" "My Documents
\SW\arp-das\QNX6\QNX6_DAS.leo"
Leo 4.7 beta 1, build 2404, September 8, 2009
Python 2.6.4, qt version 4.5.3
Windows 5, 1, 2600, 2, Service Pack 3
reading settings in C:\Python26\Lib\site-packages\Leo-4.7-beta-1\leo
\config\leoSettings.leo
using menus from: leoSettings.leo
reading settings in C:\Documents and Settings\nort\My Documents\SW\arp-
das\QNX6\QNX6_DAS.leo
reading C:\Documents and Settings\nort\.leo\.leoRecentFiles.txt
@enabled-plugins found in leoSettings.leo
Can not load c:\aspell\bin\aspell-15.dll
wrote recent file: C:\Documents and Settings\nort\.leo
\.leoRecentFiles.txt

C:\Documents and Settings\nort>

Edward K. Ream

unread,
Nov 26, 2009, 12:24:35 PM11/26/09
to leo-e...@googlegroups.com
On Mon, Nov 23, 2009 at 8:57 AM, Norton <norton....@gmail.com> wrote:

I noticed a number of pythonw process accumulating.

The current configuration is that .leo is associated with the command
below (specifying pythonw, not python). I will try moving these
commands into a batch file to see if that helps.

Has anyone else seen this sort of issue or know of a work-around?

I always run Leo with python, because I always want to see the console if something goes wrong.  I suggest you do the same.  Using two window managers (qt and pythonw) looks like asking for trouble.

Edward

TL

unread,
Nov 28, 2009, 8:23:39 AM11/28/09
to leo-editor
I launch my Leo project files "by double-clicking on a .leo file in
explorer" that launches the following batch file that has been
associated to the ".leo" extension.

Some things to note:

- A DOS command window is left open but can be immediately closed
manually without effecting the launching of the Leo file.

- I use a separate batch file to set which local Leo branch I'm
using. If you always use Leo's Trunk branch then just change the
"set /p Leo_Branch= < C:\Leo\Leo_Branch.txt" line to "set
Leo_Branch=Trunk"

- The "set EDITOR="C:\Program Files\vim\vim72\gvim"" command defines
an environment variable used by Leo to launch an external editor.
Setting it in the batch file restricts its scope to the Leo file. It
could be removed from this batch file and specified as a system wide
environment variable at the risk (low) that some other program may
also be checking for it.

- The last line of the batch file contains the following code to
redirect Leo's runtime messages to a log file:
> "C:\Leo\Leo_%~n1_%random%.log" 2>&1
The %~n1 embeds the name of the Leo project file without the
extension in the name of the log file.
The %random% embeds a random number in the log file name to insure
each instance of Leo has its own log file.

Regards,
TL

Batch file:
---------------
rem Turn of the echoing of each command to the DOS window
@echo off

rem Get the local Leo branch to use (Leo_Branch.txt usually contains
"Trunk")
set /p Leo_Branch= < C:\Leo\Leo_Branch.txt

rem Indicate which Leo branch were using (A reminder when opening a
Leo file)
echo Leo branch: %Leo_Branch%

rem Select the local Leo branch
cd c:\Leo\%Leo_Branch%

rem Select the EDITOR used by contextmenu.py (Qt gui)
set EDITOR="C:\Program Files\vim\vim72\gvim"

rem Use Tk gui (comment out the next line to use the Qt gui)
set UseTK=--gui=tk

rem Launch Leo
cmd /c Pythonw leo\core\runLeo.py %1 %UseTK% > "C:\Leo\Leo_%~n1_%random
%.log" 2>&1

Norton Allen

unread,
Nov 30, 2009, 12:56:44 PM11/30/09
to leo-e...@googlegroups.com
Hmm, OK I'll try that. I kind of assumed pythonw was the same thing as python without the console.

It's a little tricky figuring out what the recommended setup is under windows. There seem to be multiple installation instructions floating around.

-N

--

You received this message because you are subscribed to the Google Groups "leo-editor" group.
To post to this group, send email to leo-e...@googlegroups.com.
To unsubscribe from this group, send email to leo-editor+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.

tfer

unread,
Nov 30, 2009, 3:11:57 PM11/30/09
to leo-editor


On Nov 30, 12:56 pm, Norton Allen <norton.t.al...@gmail.com> wrote:

> It's a little tricky figuring out what the recommended setup is under
> windows. There seem to be multiple installation instructions floating
> around.

Just to add to the mix, you could go with my preferred way of starting
Leo, I use the sourceforge app "Console" which provides a tabbed set
of dos windows. I just had a "tab type" set up for Leo.

See thread:
http://groups.google.com/group/leo-editor/browse_thread/thread/6b840020f1048399
for details.

This comes in handy for connecting Leo to an Ipython session, as it
takes over the dos window that Leo was started from.

Tom

TL

unread,
Nov 30, 2009, 4:55:50 PM11/30/09
to leo-editor
> I use the sourceforge app "Console" ...

Thanks for the recommendation. I'll never go back.

TL

Reply all
Reply to author
Forward
0 new messages