I don't really know if I'm saving the config to a py file. What i'm doing is taking all the
diferent user settings (fonts, colors, sounds, directories etc) using GetValue from it's
respective dialog or text control widget or file browse widget and pickling them in a file
I call TVConfig.SAV So if that is a py file, then yes... I'm using a py file to save config
data.
I set up TopiView to look for TVConfig.SAV ... if it's there unpickle all the data, and
place that data in it's respective variable which is global so other methods and classes
can use them... (Sidenote: I read the tips and tricks that may increase Python performance
and it sure sounds like globals are the dark side of the force with regard to defining
variables. But like I said before, it's what I know how to do even though you guys have
been telling me in no uncertain terms to get rid of them... I think I will get rid of them!!!)
If the file isn't there, the user configures TopiView to his/her liking and clicks "Save" in the
frame I set up for config, and POW new TVConfig.SAV...
And yes I would like to distribute a fully functional EXE to who ever may find benefit from
the program. Particularly the people I play EQ with, some people have multiple monitors,
and play multiple accounts at the same time, and would like to have what's going on in the
game on another monitor, while not having the game in the foreground sucking up resources.
I started writting it for EverQuest (a slightly dated, but still popular MMORPG) but I tried
to make it versatile enough for anyone to use for any reason they may find.
No delusions about making money on this gig. I just want to be able say "I published
functioning software that has value to atleast two people (myself, and atleast one other
person in the world...)
Custom frame labels, search strings, colors fore and back, fontground, optional playing of
wave file if search string is found in text. The option to slive a line entries up to point X
(assuming the user wants to get rid of the time/date stamp, and it's at the beginning of the
leg entry.) I tried to think of it all, and do what I knew I could do.
So, at the end of the day, I have a program that works as a Py, and everything BUT what
I want TopiView to do works when it's an EXE.
···
----- Original Message ----- From: "Josiah Carlson" <josiah.carlson@gmail.com>
To: <wxpython-users@lists.wxwidgets.org>
Sent: Friday, 18 July, 2008 22:58
Subject: Re: [wxpython-users] Why does py work, but EXE not?
range and xrange are builtins.
Based on your previous posts, it seems as though you are writing
configuration to a .py file. You then import that .py file and use
those values, correct? py2exe looks at all of the files you import,
and will discover those files that you import (including the ones you
currently use for configuration), and include them. So when you are
saving configuration, it won't actually be able to re-include them,
because the configuration is already included with py2exe.
If you are sneaky, you can use the __import__() function to do a lot
of that for you, and your configuration might not be included.
Alternatively, I think there's a setting with py2exe which will allow
you to include files as "data", and you can specify your config file
as data rather than code to be included with the binary.
Out of curiosity, why are you using py2exe? Aside from a minor
speedup (related to only needing to search the zipfile rather than the
filesystem), what do you hope to gain? Are you going to be giving it
to your friends?
- Josiah
On Fri, Jul 18, 2008 at 7:15 PM, Steve Freedenburg > <stevefreedenburg@charter.net> wrote:
That's an important thing to consider... The log file can get quite large,
other log parsers i've tried then to get
sluggish as the log grows, and they recommend trimming it from time to time.
The code you gave me, which
I printed out, and used parts of the (xrange part) was a cryptic to me, I
wasn't 100% sure how to use it all.
Once I figure out what that for loop is getting skipped in the EXE I'll go
back and re evaluate the entire Py.
It is a rather large program, atleast in my experience, heck anything larger
than 100 lines is huge to me.
does xrange or range rely on any imports that may be impied in Python, but
require an import in Py2Exe?
btw, I really appreciate your help Josiah with this whole thing.
Steve
----- Original Message ----- From: "Josiah Carlson"
<josiah.carlson@gmail.com>
To: <wxpython-users@lists.wxwidgets.org>
Sent: Friday, 18 July, 2008 21:45
Subject: Re: [wxpython-users] Why does py work, but EXE not?
On a performance-realated note, as your log files grow, you probably
aren't going to be wanting to read the entire file at one time (hence
my use of os.stat a week ago).
- Josiah
On Fri, Jul 18, 2008 at 6:03 PM, Steve Freedenburg >>> <stevefreedenburg@charter.net> wrote:
Maybe I edited down the wrong file or accidently took out too much
code...
I'll look at your observations with the intact file... Like I said,
everything works for me, and I'm sure my version of Python isn't
magically
forgiving.
I appreciate your observations.
----- Original Message ----- From: "claxo" <clazzt@arnet.com.ar>
To: <wxpython-users@lists.wxwidgets.org>
Sent: Friday, 18 July, 2008 19:18
Subject: Re: [wxpython-users] Why does py work, but EXE not?
On Fri, 18 Jul 2008 12:37:34 -0400 Steve Freedenburg >>>> <stevefreedenburg@charter.net> wrote:
Ok the EXE, does "work" in the sense that the GUI loads, all the widgets
load, and look correct.
Everything "works" except it seems that part of the program is getting
skipped over. I've linked
the code that is getting skipped over. There are no traceback errors
being
reported at all in the
log file the EXE generates. I even fouled up the code to see if it
would
even generate a log of
errors and recompiled it. It does in fact report errors.
The script itself works, I've tested it for hours. You may remember me
asking about, wx.Timers,[...]
Well, the .py doenst work for me.
I have spoted some errors, and posted the code at
http://python.pastebin.com/m6b89fc2d
Modifications are marked with comments #@ , to make it easy to find.
1. The first problem I found was that configurations would not be
remembered, a lot of globals fixed that
2. Stored configurattion would not load, you get
AttributeError: 'MenuItem' object has no attribute 'SetItemLabel'
My wxPython is version '2.8.4.2 (msw-unicode)
3. Missing global in method FLCplus1
4. You miss to Start() the timer
5. Missing global at class ContainerOneFrame method
ContainerOneFrameReceive() ( and you copy & pasted this code to oteher
containers without changing the '1')
I stopped there. Probably the best would be to follow another poster
sugestion about eliminating the code repetitions, and later get rid of
all
globals.
hope it helps
--
claxo
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users