Re: [Tutor] Fw: capturing crashing application (application running under windows environment) - now sending with right adress ...

Magnus Lycka magnus at thinkware.se
Wed Dec 10 17:41:40 EST 2003


> One is, I thought lots of times, about how great it would be, to have program, sort of "monitoring application", which would save crashing apllication data. I do not mean logging crashing process instructions before crash, like some memory dump, but capturing any event, and unsaved user data going on just before crash occur, only some last important sequenceses (in case of capturing whole program memory from time to time), and not like logging user input all the time. 
[...]
> Second is kind of releated to first, since all applications I would like to monitor are running under Windows. 

We could have guessed, and this is where the problem lies.
The only reasonable solution to those crash problems is to
give up on Microsoft and get a real operating system, and
real software tools. The simple Unix editor vi has been
excellent at crash recovery for decades. And the need for
this isn't that the OS is unstable, or that processes kill
each other, but because people were editing over unreliable
connections to the computer. The price for using Windows is
high, and Python can only compensate that to a limited degree.

> It is about Python code to be executed in Windows without Python installed. I read here on Tutor something about making some somefile.py2exe executable, but could you tell some more about this, how it looks, how Python code must be written (or just modified) to work under Windows environment. I suppose that kind of programming is much more complicated ...

Here I can provide a simpler solution!

You can make an executable file that bundles python.exe
with your .py-files, and the ones you need to import.

There are several such tools, such as py2exe and the McMillan
installer. Recently I've come to favour cx_Freeze. It works
when the others fail with MemoryError. You can find it with
Google.

You don't write your Python code any differently--although
there are some library modules that will have problems
cooperating with these freezers.

If I have written a program that I would normally start
by running my_prog.py, I will run:

FreezePython.exe --base-binary ConsoleBase.exe --install-dir . my_prog.py

and I'll end up with my_prog.exe and a few .dll and
pyd-files that I need, in the current directory.
ConsoleBase.exe (part of cx_Freeze) and my_prog.py
must be in the same directory, and FreezePython.exe
needs to be in my path (unless I specify it on the
command line). Not very hard, is it?

Anyone who has the new "my_prog.exe" and the .dll- and
pyd-files in a directory, can start the Python program
by double-clicking on my_prog.exe. They don't need to
install Python.

-- 
Magnus Lycka, Thinkware AB
Alvans vag 99, SE-907 50 UMEA, SWEDEN
phone: int+46 70 582 80 65, fax: int+46 70 612 80 65
http://www.thinkware.se/  mailto:magnus at thinkware.se



More information about the Tutor mailing list