Re: Lightweight Python distribute it in under 2MBs for Win32
long delay on reply due to pc death. i made a simple gui that picked paragraphs from a file with wxpython. using py2exe i bundled the program then packaged it with INNO install. it was 3megs. now its about 4 megs after a revision. I give you the source if you want. it uses python 241 and the latest wxpython -- http://mail.python.org/mailman/listinfo/python-list
Re: Lightweight Python distribute it in under 2MBs for Win32
30meg for wx ? mine is under 3meg, compressed -- http://mail.python.org/mailman/listinfo/python-list
Re: wxPython field validation
why not validate then put cursor back into that field until satisfied. might use the lost focus (cant remember exact name right now) -- http://mail.python.org/mailman/listinfo/python-list
Re: dynamically generating temporary files through python/cgi
import tempfile works under windows and linux -- http://mail.python.org/mailman/listinfo/python-list
Re: py2exe - create one EXE
what about trying cx_freeze -- http://mail.python.org/mailman/listinfo/python-list
Re: sort of a beginner question about globals
just read the ne stuuf. i went to DIP right after work anf found in nice intro to unittest. not to bad (i thinK) now that I can see it work) -- http://mail.python.org/mailman/listinfo/python-list
Re: sort of a beginner question about globals
when i am roughing out my functions and classes i out a pass statement as my first line just as a place holder and a convenient place to put a break when i am testing. no other good reason. -- http://mail.python.org/mailman/listinfo/python-list
Re: sort of a beginner question about globals
I want to use OPTIONS as a global var. In this particular case I am trying to set a global debug constant so I can have some debug logging happen when my program is run with a -debug option. what will actuall end up in OPTIONS is OPTIONS.debug = True as i am using optparse module. -- http://mail.python.org/mailman/listinfo/python-list
Re: sort of a beginner question about globals
how would i use the following if OPTIONS was in a module ? --- from optparse import OptionParser usage = usage: %prog [options] arg parser = OptionParser(usage) parser.add_option(-d, --debug, ction=store_true, dest=verbose) (OPTIONS = parser.parse_args() ps Im not anywhere near my program right now just doing some kunch time surfing. -- http://mail.python.org/mailman/listinfo/python-list
Re: sort of a beginner question about globals
ok I'm sorry, I'm not sure what your doing there. if i have to guess it looks like yo might me modifying the imported modules dict with another dict. isn't there a way i can just assign to a var and have it seen no matter what part of the code is currently executing ? -- http://mail.python.org/mailman/listinfo/python-list
Re: sort of a beginner question about globals
it seems that i can import __main__ where i set the global and then access the var from my local func. is ther any gotcha's involveld in this ? -- http://mail.python.org/mailman/listinfo/python-list
Re: sort of a beginner question about globals
this is what i am using to test with. my program is not much more involved just longer and with a GUI. I did test it and everything works, just wondered if there was something evil and bad about importing main. # #global1.py import global2 import global3 import sys constant = 'dumb' option = sys.argv[1:] pass #global2.func1() a=global2.class1() a.func1() print newvar #global2.py import __main__ pass class class1: def func1(self): __main__.newvar = string pass -- http://mail.python.org/mailman/listinfo/python-list
sort of a beginner question about globals
i have read the book and searched the group too -- im not gettin it. i want to read a global (OPTIONS) from file1 from a class method (func1) in file2 i want to understand how this works. -- #file1.py import file2 import sys OPTION = sys.argv[1:] pass a=global2.class1() a.func1() #file2.py import __main__ pass class class1: .def func1(self): .pass --- -- http://mail.python.org/mailman/listinfo/python-list
Re: Avoiding DOS Window...
Launching a subprocess without a console window http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/409002 -- http://mail.python.org/mailman/listinfo/python-list
Re: The convenient compiler for Python Apps and Distribution of it
google for cx_freeze nevermind, here http://starship.python.net/crew/atuining/cx_Freeze/ linux and windows -- http://mail.python.org/mailman/listinfo/python-list
Re: terminating an inactive process
if you have pywin32 then check out a download from MS download called script-o-matic2. it will write some boilerplate code that is usefull for killing processes. its wmi based but works nicely. i have a script that i run on my home computer if you want a sample. -- http://mail.python.org/mailman/listinfo/python-list
Re: terminating an inactive process
i use this to open/close netscape as it also doesnt like to close all the time. its a WMI script but easiely edited. check out script-o-matic from ms-downloads , it outputs python code as well as others. ## strComputer = . Set objWMIService = GetObject(winmgmts:\\ strComputer \root\cimv2) Set colItems = objWMIService.ExecQuery(Select * from Win32_Process,,48) For Each objItem in colItems strProcess = Ucase(objItem.Name) If strProcess = NETSCP.EXE Then objItem.Terminate() End If Next '- MyVar = MsgBox (Do you want to start Netscape Mail and News chr(13) chr(13) Any Zombie processes have been exorcised from the machine already. chr(13) chr(13) , 308, Warning!) Set objWMIService = Nothing Set colItems = Nothing If MyVar = 7 Then Wscript.Quit Else sExecStr = C:\Program Files\Netscape\Netscape\Netscp.exe -mail Dim oShell, obj Set oShell = WScript.CreateObject (WSCript.shell) Set obj = oShell.exec(sExecStr) Set oShell = Nothing Set obj = Nothing End If ' MyVar = MsgBox (Click to close Netscape) strComputer = . Set objWMIService = GetObject(winmgmts:\\ strComputer \root\cimv2) Set colItems = objWMIService.ExecQuery(Select * from Win32_Process,,48) For Each objItem in colItems strProcess = Ucase(objItem.Name) If strProcess = NETSCP.EXE Then objItem.Terminate() End If Next Set objWMIService = Nothing Set colItems = Nothing -- http://mail.python.org/mailman/listinfo/python-list