py2exe and window with info about error

steen steensen101 at yahoo.com
Sat Oct 30 18:55:56 EDT 2004


Krzysztof Książek wrote:
> Hi!
>
> As almost totally newbe, I have written a simple script and I'm proud
of
> it ;-) It connects to ftp server and uploads some files. Kind of
backup.
> I've compiled it with py2exe and put it in autostart.
> When something is wrong (in example, I'm not connected to the net),
it
> opens a window with some information about error and exact location
> where I can find log.

I believe the best solution would be to catch the exception. Then you
wont get any error messages at all :-)
I have never used ftplib so I cant provide sample code but you should
probably put a try: except: around your connect command. Then when an
exception is raised you can take apropriate action like logging to a
file or just ignore it.

> How can I get rid of this window? I'd like to have a log file, but I
> don't want to see a popup during XP startup.
>
> I have no idea if it is important, but here is my setup.py:
>
> from distutils.core import setup
> import py2exe
> setup(windows=["script.py"])
>
> Thanks in advance for your help.
> 
> Regards,
> Krzysztof Ksiazek




More information about the Python-list mailing list