473,698 Members | 1,884 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

py2exe and window with info about error

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.
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
Jul 18 '05 #1
6 1765

Krzysztof Książek <mr******@go2.p l> wrote:
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.
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.


[snip setup.py]

So what you are saying is that you wrote an application that is run
during startup, and on failure, you get a dialog that pops up to tell
you that a failure has occurred, and you want to get rid of the dialog.

First questions: how is this dialog being brought up? Are you making it
happen with some sort of GUI toolkit (like wxPython or tk)? Is it
automatically happening if your script raises an exception? Give more
information.
- Josiah

Jul 18 '05 #2
On 2004-10-30 03:33:28 Josiah Carlson wrote:

First questions: how is this dialog being brought up? Are you making it
happen with some sort of GUI toolkit (like wxPython or tk)?
No. I'm not using any GUI toolkit. It does not have any graphical
elements. That's why I don't like to have that error window.
Is it
automatically happening if your script raises an exception?


I think that is the reason. Here is the example of info from log file.
It looks for me like standard exception handling. Since it can't write
it to console, it writes the output to log file and and shows the
information window.

Traceback (most recent call last):
File "test-programu.py", line 3, in ?
File "ftplib.pyc ", line 107, in __init__
File "ftplib.pyc ", line 117, in connect
socket.gaierror : (7, 'getaddrinfo failed')

Regards,
Krzysztof Ksiazek
Jul 18 '05 #3

Krzysztof Książek <mr******@go2.p l> wrote:

On 2004-10-30 03:33:28 Josiah Carlson wrote:
Is it
automatically happening if your script raises an exception?


I think that is the reason. Here is the example of info from log file.
It looks for me like standard exception handling. Since it can't write
it to console, it writes the output to log file and and shows the
information window.

Traceback (most recent call last):
File "test-programu.py", line 3, in ?
File "ftplib.pyc ", line 107, in __init__
File "ftplib.pyc ", line 117, in connect
socket.gaierror : (7, 'getaddrinfo failed')


How is your script being run? Is it placed in one of the registry
locations:
HKLM/SOFTWARE/Microsoft/Windows/CurrentVersion/Run
HKCU/SOFTWARE/Microsoft/Windows/CurrentVersion/Run
HKLM/SOFTWARE/Microsoft/Windows/CurrentVersion/RunServices
HKCU/SOFTWARE/Microsoft/Windows/CurrentVersion/RunServices

Or is it run via shortcut from your Startup program group? Or some
other method.

How is it being run?

- Josiah

Jul 18 '05 #4
On 2004-10-30 17:15:55 Josiah Carlson wrote:
How is your script being run? Is it placed in one of the registry
locations:
HKLM/SOFTWARE/Microsoft/Windows/CurrentVersion/Run


It is located in that registry key.

Greetings,
Krzysztof Ksiazek
Jul 18 '05 #5
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


Jul 18 '05 #6
On 2004-10-30 23:55:56 steen wrote:
I believe the best solution would be to catch the exception. Then you
wont get any error messages at all :-)


Thx. It works.

Regards,
Krzysztof Ksiazek
Jul 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
1651
by: Tim Axtelle | last post by:
I am new to Python and am trying to create a standalone exe from a python script using py2exe 0.5.0 and Python 2.3 without success. I am able to generate the appropriate .exe file but it is not executable. Running it does absolutely nothing. The sourceforge site says that wsvc6 is required for py2exe. Is this true? If so, it is contradiction with the python faq which claims that no C compiler is necessary with py2exe. I also tried...
3
5718
by: Werner Merkl | last post by:
Hi, Python is really great, for small to big programs. For my colleagues and some circumstances I sometimes need to "compile" a script using py2exe. Cause I use Windows, I like to use the (Windows) ability, to add some version infos, comments, etc to the exe file. If I use explorer to check, these properties are visible and correct.
1
2588
by: Funduk | last post by:
Hello, So I've been playing with Python and Pygame for a while and I decided I wanted to make a real executable so I could send that stuff over to my friends to show off my <sarcasm>maad skillz</sarcasm>. Everything was going great I went and got all the newest software (including Distutils and PY2EXE) and read the docs on making a setup py.
2
2109
by: codecraig | last post by:
Hi, I tried to take the Monkey Shell script (http://www.sharp-ideas.net/archives/2005/03/monkey_shell_us.html) and make it into an executable. I am making an executable for the server piece (monkey_shelld.py). So my setup.py looks like this # setup.py from distutils.core import setup import py2exe import sys
17
3419
by: Thomas Heller | last post by:
py2exe 0.6.1 released ===================== py2exe is a Python distutils extension which converts python scripts into executable windows programs, able to run without requiring a python installation. Console and Windows (GUI) applications, windows NT services, exe and dll COM servers are supported. Changes in this release:
2
1131
by: flupke | last post by:
Hi, when i run my program and use the logging component, i see this: 2005-09-02 17:07:48,193 INFO windowmain 97 Main window created 2005-09-02 17:07:49,020 DEBUG windowmain 103 Frame <wx._windows.Frame; proxy of C++ wxFrame instance at _b8dd9401_p_wxFrame> 2005-09-02 17:07:49,145 INFO firebird 195 Starting up the database However when i run py2exe on my app and run it then i don't see the file
6
4757
by: zdp | last post by:
Dear all: I made a window program by wxPython. Split windows, treectrl, listctrl and textctrl are used. When I program in python, the look & feel of the window controls are like the windos XP look & feel, with thin and flat border (My os is window XP). It's natural because, as I know, wxPython use native look and feel. But when I convert the program to EXE file by Py2exe, and run it, the look & feel is bad. It's just like the windows...
0
1054
by: Croteam | last post by:
Hello, I using py2exe for my script installing,and I have one problem about it,actually the real problem is tkinter window iconbitmap: import Tkinter root=Tkinter.Tk() root.iconbitmap('myicon.ico') # I was try and with myicon.bmp
3
1971
by: Kevin | last post by:
Hi everyone, I'm running Python 2.5.1 on an XP-Pro platform, with all the updates (SP2, etc) installed. I have a program (send_file.py) that sends a file to a service provider, using an ftp connection. The program works properly, and I've created an 'exe' of it, using py2exe. It was distrubuted to my user base a couple of weeks ago and seems to be working well. None of the users have Python installed on their machines, thus the need...
0
8668
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9148
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9012
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8855
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6515
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4358
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4611
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
1992
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.