Re: Getting wxPython to work on a Mac
In article <[EMAIL PROTECTED]>, Piet van Oostrum <[EMAIL PROTECTED]> wrote: > >TS> I set PYTHONPATH to > >TS> System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5 > > Why would you do that? Don't know, as it's not clear (to me) from the documentation whether PYTHONPATH has to include a path to the regular Python modules, or only to one's own modules. Just fishing here. > >TS> The Python interpreter works OK, far as I can tell. wx sort of works, > >TS> but all the functionality is not there. For example, working through the > >TS> exercises in "WxPython in Action" by Noel Rappin, I find that while I > >TS> can create and display a frame, and create an app, stuff like > >TS> wx.MessageBox() just doesn't work. > > >TS> The same exercises work just fine on a Python 2.5.1 installation on my > >TS> wife's Windows XP machine. > > I tried the example (python_compare.py) and it just works, including the > MessageBox, on Tiger with python 2.5.1. I run the in Terminal (pythonw > python_compare.py) both with and without your PYTHONPATH. > > How did you run the examples? I tried them using just python and also pythonw. Same (lack of) results. I will try going back to the OS X 10.5 distribution of Python. Will have to do a reinstall, I suppose. -- http://mail.python.org/mailman/listinfo/python-list
Re: Getting wxPython to work on a Mac
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > If you don't get an answer here, you should try the wxPython mailing > list: > http://www.wxpython.org/maillist.php > I'm sure they'll be able to help you out (I don't have a Mac, so I > don't know). OK, will try there. Thanks. -- http://mail.python.org/mailman/listinfo/python-list
Getting wxPython to work on a Mac
Not sure exactly what I need to do to get wxPython to work on either of my Macs. (One's a notebook running Tiger (OS X 10.4.11), the other a Mac Pro running Leopard (10.5.1.)) I downloaded what should be the latest binary, and it installed without error. So Python comes up as $ python -V Python 2.5.1 $ ls -l /usr/bin/python lrwxr-xr-x 1 root wheel 72 Oct 26 17:59 /usr/bin/python@ -> ../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/python $ I set PYTHONPATH to System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5 The Python interpreter works OK, far as I can tell. wx sort of works, but all the functionality is not there. For example, working through the exercises in "WxPython in Action" by Noel Rappin, I find that while I can create and display a frame, and create an app, stuff like wx.MessageBox() just doesn't work. The same exercises work just fine on a Python 2.5.1 installation on my wife's Windows XP machine. Any help appreciated. (I am obviously both a Python and a Wx beginner. And not much of a Unix expert either. :-) -- http://mail.python.org/mailman/listinfo/python-list
Re: FtpUtils Progress Bar
[EMAIL PROTECTED] wrote: > Hi, > I can successfully upload and download files using Stefan's Schwarzer's > ftputil script. > > The problem is that as some of the files are quite large you cannot see > how much has been downloaded/uploaded. > Even a percentage or just dots going across the screen would be better > than nothing. > > Does anyone have an example on how to show the progress of the > upload/download when using ftputil? > > Thanks in advance. > > Kind regards > Ian Cook > > try this def _reporthook(numblocks, blocksize, filesize, url=None): base = os.path.basename(url) try: percent = min((numblocks*blocksize*100)/filesize, 100) except: percent = 100 if numblocks != 0: print str(percent)+'%') -- http://mail.python.org/mailman/listinfo/python-list
threads and return values
say i'm issuing t = Thread(target=lambda: WeeklyReportPDF.MakeReport(self.UserNameValue, self.PassWordValue,ReportType,self.db)) t.start() which works just fine, BUT how do i get access to the return value of WeeklyReportPDF.MakeReport() ?? -- http://mail.python.org/mailman/listinfo/python-list
Re: sending bytes to parallel port
Diez B. Roggisch wrote: >> *sigh* >> if only pyparallel would install >> > > *sigh* If only you said _what_ failed we could maybe help you make it > work... :) > > Diez > titan# python setup.py install running install running build running build_py Traceback (most recent call last): File "setup.py", line 19, in ? package_data = data_files File "/usr/local/lib/python2.4/distutils/core.py", line 149, in setup dist.run_commands() File "/usr/local/lib/python2.4/distutils/dist.py", line 946, in run_commands self.run_command(cmd) File "/usr/local/lib/python2.4/distutils/dist.py", line 966, in run_command cmd_obj.run() File "/usr/local/lib/python2.4/distutils/command/install.py", line 506, in run self.run_command('build') File "/usr/local/lib/python2.4/distutils/cmd.py", line 333, in run_command self.distribution.run_command(command) File "/usr/local/lib/python2.4/distutils/dist.py", line 966, in run_command cmd_obj.run() File "/usr/local/lib/python2.4/distutils/command/build.py", line 112, in run self.run_command(cmd_name) File "/usr/local/lib/python2.4/distutils/cmd.py", line 333, in run_command self.distribution.run_command(command) File "/usr/local/lib/python2.4/distutils/dist.py", line 965, in run_command cmd_obj.ensure_finalized() File "/usr/local/lib/python2.4/distutils/cmd.py", line 117, in ensure_finalized self.finalize_options() File "/usr/local/lib/python2.4/distutils/command/build_py.py", line 60, in finalize_options self.data_files = self.get_data_files() File "/usr/local/lib/python2.4/distutils/command/build_py.py", line 120, in get_data_files filenames = [ File "/usr/local/lib/python2.4/distutils/command/build_py.py", line 128, in find_data_files globs = (self.package_data.get('', []) AttributeError: 'NoneType' object has no attribute 'get' titan# -- http://mail.python.org/mailman/listinfo/python-list
Re: sending bytes to parallel port
Diez B. Roggisch wrote: >> >>> fd = open('/dev/ppi0','w') >> >>> fcntl.ioctl(fd.fileno(),'PPISCTRL',1000) >> Traceback (most recent call last): >> File "", line 1, in ? >> TypeError: an integer is required >> >> i guess i'm failing to properly define the int i need for the 8byte >> value ineed to send the port to set pins high /low >> > > Python doesn't know about PPISCTRL - it has no way of knowing all > "secret", OS-specific constants for ioctl-calls. > > So, you need to figure out the numeric value of that constant .- look it > up in the appropriate header-file. > > Then, you do have the next problem with passing that 1000 value of > yours. ioctl expects strings or buffers as parameters which contain a > byte-representation of the value you want to set. This is an snippet I > use to read the event device capabilities under linnux: > > > buf = array.array('c', [' ' for i in xrange(EV_MAX / 8 + 1)]) > fcntl.ioctl(self._fd, EVIOCGBIT(0, len(buf)), buf, True) > caps = struct.unpack("I", buf)[0] > > HTH, > > Diez > *sigh* if only pyparallel would install -- http://mail.python.org/mailman/listinfo/python-list
Re: sending bytes to parallel port
Dennis Lee Bieber wrote: > On Sat, 29 Jul 2006 13:59:02 +1000, Timothy Smith > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > >> and yes i've done quite a bit of googling, i never expected it to be >> this difficult. i've done work with serial ports before. never parallel but. >> > > Parallel gets ugly -- there are something like three different types > of parallel port hardware, and they behave slightly differently (status > bits, bidirectionality, etc.). > > http://www.amazon.com/gp/product/0965081915/qid=1154149492/sr=2-1/ref=pd_bbs_b_2_1/002-3804298-8662433?s=books&v=glance&n=283155 > > is MS-DOS/Windows biased, but may give hints... > > > (a few years ago I had to program a W98 laptop to write 6 data pins -- > representing three rs-422 style balanced signals -- in response to a > 1KHz clock signal coming in on another pin... I had it working, but > couldn't get rid of every last W98 OS interrupt, such that I had a 1-3 > clock length skip about every 700 clocks) > i think fcntl is what i'm after, although i've never done any system level stuff like this before so it's a learning curve for me. right now i'm attempting to use it like so and getting the following error. >>> fd = open('/dev/ppi0','w') >>> fcntl.ioctl(fd.fileno(),'PPISCTRL',1000) Traceback (most recent call last): File "", line 1, in ? TypeError: an integer is required i guess i'm failing to properly define the int i need for the 8byte value ineed to send the port to set pins high /low -- http://mail.python.org/mailman/listinfo/python-list
Re: sending bytes to parallel port
Grant Edwards wrote: > On 2006-07-29, Grant Edwards <[EMAIL PROTECTED]> wrote: > > >> I'd particularly recommend taking a look at the pyparallel >> module found here: >> >> http://pyserial.sourceforge.net/ >> > > Oops, there isn't actually a link to pyparallel from that page > (I swear there used to be). Here's the pyparallel page: > > http://pyserial.sourceforge.net/pyparallel.html > > i've had people suggest using fcntl to set the pins status, i'm looking to that if anyone has any suggestions -- http://mail.python.org/mailman/listinfo/python-list
Re: sending bytes to parallel port
Grant Edwards wrote: > On 2006-07-28, Timothy Smith <[EMAIL PROTECTED]> wrote: > > >> i've been trying to send an 8 byte string to my parallel port >> under freebsd. the purpose is it to control a relay board. the >> board simply responds to the output byte coming from the port. >> eg. 0001 will set pin 1 high and flick the relay open. >> todate i've attempted this with merely open() on /dev/ppi0 and >> numpy for the byte array, but i just can't seem to get it >> working. i know the parallel port works and i know the relay >> board works (tested it with it's own windows ultility) so it's >> just my crappy programming keeping me from success. >> > > I'm guessing there's an implied request for help there > somewhere. This would be a good start: > > http://www.google.com/search?q=python+parallel+port > > I'd particularly recommend taking a look at the pyparallel > module found here: > > http://pyserial.sourceforge.net/ > > I've not used pyparallel, but based on my experience with > pyserial and some of Chris Liechti's other work, I'd bet > dollars to doughnuts it's your best option. > > yes, i did try pyparallel however it will not install on freebsd, setup.py errors. and yes i've done quite a bit of googling, i never expected it to be this difficult. i've done work with serial ports before. never parallel but. -- http://mail.python.org/mailman/listinfo/python-list
sending bytes to parallel port
hello people. i've been trying to send an 8 byte string to my parallel port under freebsd. the purpose is it to control a relay board. the board simply responds to the output byte coming from the port. eg. 0001 will set pin 1 high and flick the relay open. todate i've attempted this with merely open() on /dev/ppi0 and numpy for the byte array, but i just can't seem to get it working. i know the parallel port works and i know the relay board works (tested it with it's own windows ultility) so it's just my crappy programming keeping me from success. -- http://mail.python.org/mailman/listinfo/python-list
Re: an intriguing wifi http server mystery...please help
Paul McNett wrote: >[EMAIL PROTECTED] wrote: > > >>1) >>Laptop wired, client >>Desktop wired, server >>GREAT! >>webpage served in 2 seconds >> >>2) >>Laptop wired, server >>Deskop wired, client >>GREAT! >>webpage served in 2 seconds >> >>3) >>Laptop wireless, client >>Desktop wireless, server >>GREAT! >>webpage served in 2 seconds >> >>4) >>Laptop wireless, server >>Desktop wireless, client >>CRAP! >>webpage served in 90 seconds >> >> >>What the heck is happening? >> >> > >Please post your routing tables and, if you are referencing your server >machine >by name, your name server addresses (/etc/resolv.conf on Linux). > > > > i'm inclined to agree, your client and server might be taking totally different routes to get to each other and hence the 90ms -- http://mail.python.org/mailman/listinfo/python-list
Re: Python obfuscation
> Reliability is >important but so is protecting your code in an effective manner > > there is no way to prevent people disassembling your code compiled or otherwise. once you give then the program they can easily take it apart. no if's, no but's; do NOT rely on binary's for security. > >the big software companies might say 'trusted computing will save us' >but I for one will never truly trust it. > > trusted computing it about your computer not trusting YOU. the computer you pay for will decied based on some other company's whim's what you are and are not allowed to do. >Perhaps a comprehensive protection for interpreted languages can never >be built because of their high level nature? > > i repeat. there is no such thing as protected code. i've seen people de construct exe's written in C. -- http://mail.python.org/mailman/listinfo/python-list
Re: non descriptive error
Fredrik Lundh wrote: >Timothy Smith wrote: > > >>i have reproduced the error in this code block >> >>#save values in edit >>self.FinaliseTill.SaveEditControlValue() >>if >>Decimal(self.parent.TillDetails[self.TillSelection.GetStringSelection()]['ChangeTinBalance'])) >>== Decimal('0'): >>#box must be checked before continuing >>if self.PlacedInSafe.GetValue() != 1: >>self.parent.Popup("You must place the till draw back in the >>safe","Till draw") >>else: >>#finalise the till draw >>if Decimal(self.TillFloat.GetLabel().split('$')[1]) != Decimal('0'): >>Prompt = wx.MessageDialog(self,"""The correct amount has not been >>returned from the till draw float to the main float! >>If you proceed please contact your manager""","Change tin doesn't >>balance!",wx.YES_NO) >>if Prompt.ShowModal() == wx.ID_YES: >>self.Submit() >>else: >>self.parent.Popup('You have an outstanding change tin balance on this >>till','Change tin') >> >>i have NO idea what in there could be making it have such a strange >>error. it just says "error" when you try run it. there nothing terribly >>strange being done. >> >> > >the snippet you posted gives > >$ python script.py > File "script.py", line 2 >self.FinaliseTill.SaveEditControlValue() >^ >SyntaxError: invalid syntax > >on my python 2.3 install. > >are you sure you don't have some weird sitecustomize file on your >machine? (more likely, it's a wxPython issue. can you reproduce >this without using wxPython ?) > > > > > > > i am still coming across this error it's driving me nuts. usually i can find what's wrong, but it is becoming an increasingly annoying problem. i also get the same problem on a windows machine with the same installed. this time it's nothing to do with the decimal module. help! -- http://mail.python.org/mailman/listinfo/python-list
Re: non descriptive error
Neil Hodgson wrote: >Timothy Smith: > > > >>FYI i have located where the problem was. in the first if statement >>there was an unbalanced ). now since when does python not give a >>descriptive error for that? >> >> > >I see this with the arrow pointing at the extra ')': > > >pythonw -u "xx.py" > File "xx.py", line 3 > if >Decimal(self.parent.TillDetails[self.TillSelection.GetStringSelection()]['ChangeTinBalance'])) > >== Decimal('0'): > > ^ >SyntaxError: invalid syntax > >Neil > > it is definately a bug in 2.3 when using the decimal module. i can reproduce it. from decimal import Decimal a = Decimal('0' and when you attempt to run it you will get "error" of course i do understand that decimal wasn't part of 2.3, but atleast now when if anyone gets that terse message they know where to start looking :) -- http://mail.python.org/mailman/listinfo/python-list
Re: non descriptive error
[EMAIL PROTECTED] wrote: >On Mon, Oct 10, 2005 at 09:12:13AM +1000, Timothy Smith wrote: > > >>FAYI i have already found it and it was a wrongly indented code block :/ >> >> > >When indentation leaves an illegal program structure, Python gives a very >informative error message, such as > > File "/tmp/x.py", line 3 >return 3 > ^ >IndentationError: unindent does not match any outer indentation level > >Jeff > > not in my first case it didn't. i simply tabbed an incorrect block in and it worked. i should have saved it to show you -- http://mail.python.org/mailman/listinfo/python-list
Re: non descriptive error
Timothy Smith wrote: >i have reproduced the error in this code block > >#save values in edit > self.FinaliseTill.SaveEditControlValue() > if >Decimal(self.parent.TillDetails[self.TillSelection.GetStringSelection()]['ChangeTinBalance'])) > >== Decimal('0'): > #box must be checked before continuing > if self.PlacedInSafe.GetValue() != 1: > self.parent.Popup("You must place the till draw > back in the >safe","Till draw") > else: > #finalise the till draw > if > Decimal(self.TillFloat.GetLabel().split('$')[1]) != Decimal('0'): > Prompt = wx.MessageDialog(self,"""The > correct amount has not been >returned from the till draw float to the main float! > If you proceed please contact your > manager""","Change tin doesn't >balance!",wx.YES_NO) > if Prompt.ShowModal() == wx.ID_YES: > self.Submit() > else: > self.parent.Popup('You have an outstanding change tin > balance on this >till','Change tin') > > >i have NO idea what in there could be making it have such a strange >error. it just says "error" when you try run it. there nothing terribly >strange being done. > > FYI i have located where the problem was. in the first if statement there was an unbalanced ). now since when does python not give a descriptive error for that? -- http://mail.python.org/mailman/listinfo/python-list
Re: non descriptive error
i have reproduced the error in this code block #save values in edit self.FinaliseTill.SaveEditControlValue() if Decimal(self.parent.TillDetails[self.TillSelection.GetStringSelection()]['ChangeTinBalance'])) == Decimal('0'): #box must be checked before continuing if self.PlacedInSafe.GetValue() != 1: self.parent.Popup("You must place the till draw back in the safe","Till draw") else: #finalise the till draw if Decimal(self.TillFloat.GetLabel().split('$')[1]) != Decimal('0'): Prompt = wx.MessageDialog(self,"""The correct amount has not been returned from the till draw float to the main float! If you proceed please contact your manager""","Change tin doesn't balance!",wx.YES_NO) if Prompt.ShowModal() == wx.ID_YES: self.Submit() else: self.parent.Popup('You have an outstanding change tin balance on this till','Change tin') i have NO idea what in there could be making it have such a strange error. it just says "error" when you try run it. there nothing terribly strange being done. -- http://mail.python.org/mailman/listinfo/python-list
Re: non descriptive error
Terry Hancock wrote: >On Thursday 06 October 2005 11:57 pm, Timothy Smith wrote: > > >>i try to run my app and i get this >> >>%python DutyShift.py >>error >> >>thats it. thats the error. mya pp was previously working, and i did make >>some fairly large changes to it, but i'd expect a more descriptive >>message then just "error". anyidea where i need to start looking? >> >> > >By looking at the source code for DutyShift.py? > > > well DUH thank you captain obvious! i ment what KIND of code error would make it flip out like that. FAYI i have already found it and it was a wrongly indented code block :/ -- http://mail.python.org/mailman/listinfo/python-list
non descriptive error
i try to run my app and i get this %python DutyShift.py error thats it. thats the error. mya pp was previously working, and i did make some fairly large changes to it, but i'd expect a more descriptive message then just "error". anyidea where i need to start looking? -- http://mail.python.org/mailman/listinfo/python-list
Re: catching all tracebacks
Timothy Smith wrote: >iw ant to use a singel try except statment with my main app loop in the >middle and catch all tracebacks and email them to myself as a bug >report. however it seems a little more tricky then i thought > >try: >Main.Main() >except Exception, err_o: >print err_o.__class__.__name__, '//', err_o, '//', err_o.args > >that was suggested to me however it doesn't catch the errors i made in >the program, it just spits out a traceback. > > never mind it works now. -- http://mail.python.org/mailman/listinfo/python-list
catching all tracebacks
iw ant to use a singel try except statment with my main app loop in the middle and catch all tracebacks and email them to myself as a bug report. however it seems a little more tricky then i thought try: Main.Main() except Exception, err_o: print err_o.__class__.__name__, '//', err_o, '//', err_o.args that was suggested to me however it doesn't catch the errors i made in the program, it just spits out a traceback. -- http://mail.python.org/mailman/listinfo/python-list
Re: services on linux
Martin Franklin wrote: >Christoph Haas wrote: > > >>On Tue, Sep 20, 2005 at 02:57:26AM -0500, pt python wrote: >> >> >> >>>im moving from the windows world to the linux world and i need to make >>>a python script to see if a service is instaled (ex: apache), if it is >>>running or stoped and to start/stop a service like apache or mysql. >>>Theres an API on windows to manage services and i need to know how to >>>do that on linux. Can anyone help me with the module and API to work >>>with services on linux? >>> >>> >>Unless you really want to do that in Python. It's just a matter of "ps" >>and "grep". Simple shell stuff. >> >>Example: ps ax | grep apache >> >> >> > > >On RedHat based distro's (fedora in my case) > > >/sbin/service sshd status > > >gives me (as a normal user) the status of my ssh server not sure if >other distro's have this... > > > > > >>>by the way, im developing a app, maybe multi-plataform, to install and >>>manage several open source packages like apache, mySQL, phpwebadmin, >>>phpnuke, etc... if anyone have nice ideais i apreciate that.. >>> >>> >>That's usually the Linux distribution's job to handle the installed >>packages. Some distributions do that better than others >>(Debian). ;) Or what did you mean when you said "install >>and manage"? >> >> >> > > >yeah you really need to look at the tools you have been given with your >distro, rpm, deb, etc for the best way. If it's pure python then the >distutils package (in the python standard library) may help, also I >noticed that PyInstaller 1.0 has just been released > > > i'd be very careful using a distro specific tool. it's no good if it only works on redhat. >http://pyinstaller.hpcf.upr.edu/pyinstaller > > >and has options to create single file installers for Linux / IRIX and >Windows... > > > > > > > > > -- http://mail.python.org/mailman/listinfo/python-list
Re: OCR librarys
Larry Bates wrote: >You need to specify a "platform" you will be running on. I've had >good experience with ExperVision's RTK toolkit on Windows. It is not >free, but it is very, very good. Sometimes software is actually >worth paying for ;-). > >Larry Bates > > >Timothy Smith wrote: > > >>i'm looking for ocr librarys with reasonably free licensing and the >>ablity to use python with them. c library's that i can call from python >>are acceptable. >>so far all i have run into is voodoo and wild claims. i've tried gocr, >>and it wasn't very impressive. i'm like to be able to ocr handwriting >>but it's not a major requirment. anyone with any pointers or idea's i'm >>all ears. i'd really not like to have to use somthing like imagemagick >>and start from scratch. >> >> i know it's worth paying for a good one. i built a system that read barcodes off images once and it used a paid for library. -- http://mail.python.org/mailman/listinfo/python-list
OCR librarys
i'm looking for ocr librarys with reasonably free licensing and the ablity to use python with them. c library's that i can call from python are acceptable. so far all i have run into is voodoo and wild claims. i've tried gocr, and it wasn't very impressive. i'm like to be able to ocr handwriting but it's not a major requirment. anyone with any pointers or idea's i'm all ears. i'd really not like to have to use somthing like imagemagick and start from scratch. -- http://mail.python.org/mailman/listinfo/python-list
Re: startfile problems
Michael Hoffman wrote: >Timothy Smith wrote: > > > >>yep the program is executed in the same dir as the pdf file. like i said >>it actually opens it, but throws up an exception as well. >> >> > >You are far more likely to get informed help if you post the traceback >here, as has been suggested twice already. > > i can't since it's a remote site and i can't reproduce the error. the best i have is a screen shot. besdies which the only information it gives is the names and line numbers of the my py modules, nothing more. the only real info it gives i have posted already, in my inital post (the last line of it, WindowsError etc..) other then that there's no more information to be had. it's a bloody simple 2 line function, nothing funky about it. -- http://mail.python.org/mailman/listinfo/python-list
Re: startfile problems
Dennis Lee Bieber wrote: >On Tue, 02 Aug 2005 17:35:27 +1000, Timothy Smith ><[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > > >>it's iterally just >> >>PDFname = 'tmp.pdf' >>os.startfile(PDFname) >> >>thats the code. >> >> >> > No "import os"? > And the full traceback? > > > >>so obviously it contains no errnous characters. see my update btw. it >>actually DOES open the report, but throws up the exception as well. >> >> > > Must not have made it to my server yet, assuming it was posted >after my comment. > >import os > >PDFname = "test.pdf" >os.startfile(PDFname) > > No errors if I'm in the directory with the PDF when I execute >the program... > >E:\UserData\Dennis Lee Bieber\My Documents>script1.py > >E:\UserData\Dennis Lee Bieber\My Documents>python script1.py > >E:\UserData\Dennis Lee Bieber\My Documents> > > > > > yep the program is executed in the same dir as the pdf file. like i said it actually opens it, but throws up an exception as well. if i hadn't seen it with my own eyes i wouldn't believe it. -- http://mail.python.org/mailman/listinfo/python-list
Re: startfile problems
Dennis Lee Bieber wrote: >On Tue, 02 Aug 2005 15:10:23 +1000, Timothy Smith ><[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > >>i'm very curious as to what everyone thinks >> >> > > I suspect most of us think: Where's the code? > followed by: Where's the traceback? > > As for your statement of verifying the path and filename... We >haven't seen it so can't guess... (part of the "where's the code") > > Does the path contain \n, \t, \r, \f, etc. If it does, and you >are not using a raw string, you are looking for a file with newline, >tab, carriage return, formfeed, etc. respectively in the name. > > >fid = "c:\temp\something.pdf" #bad, this is ># c:emp\something.pdf ># assuming \s isn't some special character > >fid = r"c:\temp\something.pdf" #good >fid = "c:\\temp\\something.pds" #okay > > > it's iterally just PDFname = 'tmp.pdf' os.startfile(PDFname) thats the code. so obviously it contains no errnous characters. see my update btw. it actually DOES open the report, but throws up the exception as well. -- http://mail.python.org/mailman/listinfo/python-list
startfile problems
hello i have a very odd issue with os.startfile() ok basicly my app works perfectly on every single other pc todate. i cannot recreate this issue on any system. so i've already ruled out any obvious coding issues, such as wrong file names etc. this issue only occurs on this one old pc. upon trying to os.startfile() a pdf document (that i create) i get the error - Windows error [erro2]"System cannot find the specified file" however when i go in to the program directory, the file is there, and i can open it. i have ruled out the following: the pdf viewer is working. the path and file name are correct the path and file name do not contain any spaces and what not. it's a windows xp system and i'm using python 2.3 i'm very curious as to what everyone thinks -- http://mail.python.org/mailman/listinfo/python-list
multi threading and win9x
i want to run my sql statements on a seperate thread to prevent my app from stop responding to input (atm is says "not responding" under windows until the sql is finished) but i'm hesitant because i have to still support win9x and i'm not sure how well this will play. -- http://mail.python.org/mailman/listinfo/python-list
decimal and trunkating
i want to trunkate 199.999 to 199.99 getcontext.prec = 2 isn't what i'm after either, all that does is E's the value. do i really have to use floats to do this? -- http://mail.python.org/mailman/listinfo/python-list
Re: query progress bar
Bernhard Holzmayer wrote: >Timothy Smith wrote: > > > >>i'm using pypgsql >> >> > >Assuming you work with PostgreSQL, then: >You know the EXPLAIN command? > >EXPLAIN will give you a very accurate estimation for the expense for the >query. >(You'll have to find out what cost means in terms of your progress.) > >I did never try this using pypgsql, but if it works, this might be your >solution... > >The precision of EXPLAIN, however, depends on the modifications since the >last time you ran VACUUM on the DB. >If the size of tables or indices didn't suffer considerable changes since >then, the estimation should be quite accurate. > >Bernhard > > > i've never heard of pypgsql supporting andthing like that, but i'll have a look -- http://mail.python.org/mailman/listinfo/python-list
Re: Windows distribution suggestions?
Ivan Voras wrote: >Paul Rubin wrote: > > > >>>your active code is then in some library.zip shared between the >>>three, and you need never change alice.exe, bob.exe, and carol.exe >>> >>> >>I think I understand what you're saying and it sounds like a very >>good idea. Thanks. >> >> > >One thing about updating files - sorry if I'm stating general and >universal knowledge, but beware that on Windows you can't delete and/or >replace a file if it's opened by any process. > > hence i found you must do this immediately after updating sys.path_importer_cache.clear() zipimport._zip_directory_cache.clear() then unload your app -- http://mail.python.org/mailman/listinfo/python-list
Re: Windows distribution suggestions?
Toby Dickenson wrote: >On Tuesday 17 May 2005 09:35, Timothy Smith wrote: > > >>mate dont bugger around with all that. py2exe will make you a windows >>native exe to run. and for updates you just need to update it's >>library.zip. >> >> > >py2exe is working great for me too. > > > >>>My app contains three different programs (say alice.py, bob.py, and >>>carol.py) that need to be independently launchable, and a dozen or >>>so other .py files that get imported into those first three >>> >>> > >One tip: make sure your three top-level scripts are as empty as possible: just >import some other module and call a function. All your active code is then in >some library.zip shared between the three, and you need never change >alice.exe, bob.exe, and carol.exe > > > >>use NSIS for the installer, it can do anything you want an >>it's free. it couldn't be more simple, shoot me an email if you >>need more >> >> > >Ive not used NSIS, but I have had good results from the free WiX tools, at >http://sourceforge.net/projects/wix/. Documentation is poor, but examples are >plenty. > > > another good one is Inno, although it's not as easy to use as NSIS. Inno and NSIS can do anything a commercial installer can do, Inno especially. -- http://mail.python.org/mailman/listinfo/python-list
Re: Windows distribution suggestions?
Paul Rubin wrote: >Bernhard Holzmayer <[EMAIL PROTECTED]> writes: > > >>I can feel your unhappiness, and I share it. Hi Paul! >>Here are some hints... >> >> > >Thanks! ;-) > > > >>Since your installer needs to run before Python is installed, you need >>something else. Go to http://www.wisesolutions.com >>You'll find a Windows installer program, with a demo-version (30days >>license). Try this, it would be my best recommendation. >> >> > >Hmm, ok, it looks like the paid version is around 500 USD. Since this >is a Windows thing I'm ok in principle with using a payware packaging >app, but that's a bit on the expensive side. I'll see what the >customer says but I think they might resist. > > > >>You'll have to test your application on Windows, in any case. >>I've built lots of applications which run in both worlds (Linux/Windows). >>Usually this works, but occasionally you'll have to deal with strange >>things. One is, if you use ODBC. There's good chance that you'll have to >>deal with access restrictions in the %SYSTEM% directory, unless you require >>an administrator's account for your application. >> >> > >The app works ok under Windows now. I don't use ODBC. I might need >some database connectivity later and will probably use MySQL. I don't >want to need an admin account. Right now the app just has a Tkinter >gui, reads and writes a few files and talks to some sockets. I might >need to add some C extensions later but those should be pretty portable. > > > >>If you test your app on a Windows machine, you can easily install >>Python 2.3 and Python 2.4 on the same machine without >>conflicts. Just try out, if your app works with either. If it works >>with both, why not use 2.3? >> >> > >I guess I could do that. I believe I make some minor use of 2.4 features >but I can probably retrofit those things. > > > >>>There's also py2exe--is that as good? >>> >>> >>Depends on your application, if that is acceptable. >>I have no experiences with that. >> >> > >Me neither. I was hoping to find out its good and bad points as compared >with alternatives. > > > >>Who are your customer's (the recipients of your program releases)? >>Usually, you cannot rely that they have online access to your repository. >>Then, they are potentionally interested in security issues and/or stability >>of the program. I'd not like a program which is said to require frequent >>updates - I'd guess that there's not much quality inside... >> >> > >The program is under active development and sprouting new features >every few minutes. The idea is to release a new development build once >a week or so, for internal use by the customer. > > > >>If your application has a GUI, a menu entry might fetch your update files >>and place them wherever they must reside. your update.py might feed that >>menu entry. Quite easy. >> >> > >Hmm, that's another thing I'd have to code--maybe it's feasible. I'll >think about it. > > > >>If you have command line apps, why not provide an additional update.py >>and then, if you provide updates, just install them using your installed >>update.py. The only thing: How do you keep track of path/desktop/file >>information and how do you deal with user rights etc.? >>Are you aware of how this is done under WindowsXP? It's quite different from >>older Windows platforms! Therefore it might be easier, to leave this to >>professional installation tools. >> >> > >No I'm really ignorant about Windows. I just put the app's files in >C:/Program Files/appname because that's what one of the other developers >said to do. > > > >>>I do have Visual C++ installed on the development machine, if that helps. >>> >>> >>Isn't Visual C++ still coming with a restricted version of InstallShield? >>If so, check if you can use that. It might give your release a sort of >>professional shine... >> >> > >Hmm, that's really really interesting. How would I find out? > > > >>You'll certainly find out, that managing the registry/desktop file system >>will cost most energy, if you want to release your apps to WindowsXP. >>Once Python is running your apps, the rest is peanuts. >> >> > >Oh man, I was hoping to avoid that level of hassle. My app doesn't >use any registry keys of its own, but I guess the Python executable >does, and that stuff presumably has to be updated with every >reinstall, and something is sure to eventually go wrong and corrupt >the registry, if this is anything like the Windows that I'm used to >hearing about. Sigh. Just how bad is that under Windows XP? >I'm used to Windows 95 completely falling apart at the slightest >error but I have the impression that XP is a bit more solid. > >Maybe I'll have to just tell them to install Python 2.4 from its >distro MSI and then I can put together a distutils setup.py thingie >which they'd run separately. That might be acceptable to the customer >if it saves a lot of development effort and prevents user
Re: Windows distribution suggestions?
Paul Rubin wrote: >As what must be penance for something or other, I'm needing to release >a Python app for use under Windows XP. Please be gentle with me since >I'm a Un*x weenie and the only thing I've had much practice with under >Windows is rebooting it. > >My app contains three different programs (say alice.py, bob.py, and >carol.py) that need to be independently launchable, and a dozen or so >other .py files that get imported into those first three. What I'd >really really like is to make a single installer called (say) >"app.exe". Launching app.exe should completely install Python, unpack >all the necessary modules, and make three icons (alice, bob, carol) on >the desktop. > >I know there's various ways of building Windows distros like that, but >am not sure what's currently preferred. Gordon McMillan's site >www.mcmillan-inc.com has had its domain expire (he really should renew >it before some squatter grabs it!) and the mirror that I've found >indicates that it was last updated for Python 2.3. I wrote my app >under 2.4 and while I don't think I depend heavily on any 2.4 >features, I'd rather not have to downgrade just to make this exe >installer. There's also py2exe--is that as good? > >Also, what's the preferred way of releasing updates? That is, let's >say I want to update my .py files and release a new version fairly >frequently--should I just make a new .exe every time? Would launching >the new one cleanly overwrite or uninstall the old one? Total >coolness would be a way to ship an "update.py" along with the app, >that syncs the app up to a Subversion repository, but that may be >asking a bit much. > >I do have Visual C++ installed on the development machine, if that helps > > i have just gone through this process myself. if your sure your only distributing the app to windows xp system, then it's perfectly possible to update from an svn by using pysvn. pysvn doesn't currently work on win9x clients. py2exe - use it, it's damn good. it puts all your library's in a library.zip file which can then use to update your app. make a nice neat installer using NSIS, you can even use it to send manual patches if you need to. if you need any help making the pysvn or other parts work give me an email i can help. -- http://mail.python.org/mailman/listinfo/python-list
Re: query progress bar
Harald Massa wrote: >>it's for wx, the problem isn't making the progress bar itself, it's >>knowing how long the query is going to run for. >>i'm using pypgsql >> >> > >It is quite easy: > >from timemachine import oracle > >guesser=oracle(guess="SQL") >guesser.set_hint(driver="pypgsql") >guesser.set_hint(gui="wx") > >expected_runtime=guesser.estimate("") > >Only problem is that the timemachine module is currently only installed >on Guidos and Tims Python. > >Harald > > man thats exactly what i'm looking for. it won't install on standard 2.3 ? -- http://mail.python.org/mailman/listinfo/python-list
Re: query progress bar
[EMAIL PROTECTED] wrote: >What type of UI is this for? The Python Cookbook, 2nd Ed. has a nice >textual solution. I'm not sure if this is the same one, but here is href="http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/168639";>one >from ASPN. Here is one href="http://wxpython.org/docs/api/wx.ProgressDialog-class.html";> for >wxPython. > > > it's for wx, the problem isn't making the progress bar itself, it's knowing how long the query is going to run for. i'm using pypgsql -- http://mail.python.org/mailman/listinfo/python-list
Re: Python on a public library computer
John J. Lee wrote: >"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > > >>Here's my situation: >> >>I'm typing this in a public library on a computer with OS windows 2000 >>server. I can run Internet explorer, word, excel and powerpoint, that's >>it. Maybe java, but it seems to be flaky. >> >>I want to run python scripts from this computer. At home I have a >>multi-computer network (from better times) but no internet access >> >> >[...] > >Why not Jython? > > >John > > how locked down is the computer? there's a few (brave) public access unix shell providers out there. if you could run telnet you could use them -- http://mail.python.org/mailman/listinfo/python-list
query progress bar
is it possible to mke a progress bar for queries? say i have a query that will take 20 seconds, i'd like to give some feed back to users on how long this will take. -- http://mail.python.org/mailman/listinfo/python-list
urllib download insanity
ok what i am seeing is impossible. i DELETED the file from my webserver, uploaded the new one. when my app logs in it checks the file, if it's changed it downloads it. the impossible part, is that on my pc is downloading the OLD file i've deleted! if i download it via IE, i get the new file. SO, my only conculsion is that urllib is caching it some where. BUT i'm already calling urlcleanup(), so what else can i do? here is the code LastModified = urllib2.urlopen('http://x.x.x.x/library.zip') LastModified = LastModified.headers['Content-Length'] LocalFile = os.stat('library.zip') LocalFile = int(LocalFile.st_size) if LocalFile != int(LastModified): urllib.urlcleanup() urllib.urlretrieve('http://x.x.x.x/library.zip','library.zip') as a test i got someone in the office to login and try it - worked properly for them. i'm on a different ISP to them however, so my other idea is that possibly my isp has a transparent proxy setup that urllib is using, but IE isn't??? -- http://mail.python.org/mailman/listinfo/python-list
Re: sync dir's
Gerhard Haering wrote: >On Tue, May 10, 2005 at 05:21:30PM +1000, Timothy Smith wrote: > > >>i need something which has a python library, so far i haven't seen >>anything like that for rsync. i'll check out the others but >> >> > >http://osx.freshmeat.net/projects/pysync/ > >""" >Pysync has both a demonstration implementation of the rsync and >related algorithms in pure Python, and a high speed librsync Python >extension. The pure Python is not fast and is not optimized, however >it does work and provides a simple implementation of the algorithm >for reference and experimentation. It includes a combination of >ideas taken from librsync, xdelta, and rsync. The librsync Python >extension is less flexible and harder to understand, but is very >fast. >""" > > pysync hasn't been worked on in years by the looks of it. no new releases since 03. and the last release was for 2.1, so i'm dubious about it working at all? the windows installer doesn't work either. -- http://mail.python.org/mailman/listinfo/python-list
Re: sync dir's
Fredrik Lundh wrote: >Timothy Smith wrote: > > > >>what would be the best tool to use to sync my local dir with a remote >>one, say off a http resorce (although i'm open to other options there) i >> >> > >rsync? wget --mirror? > > > > > > > i need something which has a python library, so far i haven't seen anything like that for rsync. i'll check out the others but -- http://mail.python.org/mailman/listinfo/python-list
sync dir's
what would be the best tool to use to sync my local dir with a remote one, say off a http resorce (although i'm open to other options there) i haven't gotten any feed back on my problems with loading pysvn on win98, and i can apprechiate if the dev's are too busy/can't be bothered with win98. but i still need to find a solution that can achieve the same result, and i'm starting to look for other options. -- http://mail.python.org/mailman/listinfo/python-list
RE: py23-pysvn-svn114-1.2.0-415.exe << won't load on win98
hello there, i get the following error when attempting to load pysvn on a win98 system Traceback (most recent call last): > File "PubWare.py", line 11, in ? > File "Main.pyc", line 46, in ? > File "pysvn\__init__.pyc", line 12, in ? > File "pysvn\_pysvn.pyc", line 9, in ? > File "pysvn\_pysvn.pyc", line 7, in __load >ImportError: DLL load failed: A device attached to the system is not >functioning. i installed the package on a windows xp system, and on other xp systems it is also fine, however on win98 systems it errors ok i have installed win98 on a test machine and sure enough i get the exact same error on trying to import pysvn. it's python 2.3, pysvn 1.2.0 build 415. it's a totally virgin install, nothing but those 2 are installed on the system. note that is' standard win98, not win98 SE now how do i start trying to track down whats wrong and do you think it will be possible to fix it? -- http://mail.python.org/mailman/listinfo/python-list
Re: computer unable to load _pysvn.pyc
vincent wehren wrote: >"Timothy Smith" <[EMAIL PROTECTED]> schrieb im Newsbeitrag >news:[EMAIL PROTECTED] >| Timothy Smith wrote: >| >| >this is truely maddening >| > >| >Traceback (most recent call last): >| > File "PubWare.py", line 11, in ? >| > File "Main.pyc", line 46, in ? >| > File "pysvn\__init__.pyc", line 12, in ? >| > File "pysvn\_pysvn.pyc", line 9, in ? >| > File "pysvn\_pysvn.pyc", line 7, in __load >| >ImportError: DLL load failed: A device attached to the system is not >| >functioning. >| > >| >any ideas? it works perfectly on another computer >| > >| > >| ok more information - windows 98 computers have this issue, xp computers >| are fine. >| how do i work around this? obviously one of the pysvn dll's won't load >| on win98. > >First, you will need to establish which .dll this is. Than check if the .dll >has any dependencies that are not present on the host system (using >depends.exe for example) -- i.e. function calls that are not supported. > >-- > >Vincent Wehren > > >| note this is py2exe package made on a windows xp system >| > > > > i think i'll wait for a response from barry scott the maintainer of pysvn. buggering around trying to find some dll that it's calling most likely won't get me anywhere anyway. bloody windows - DLL HELL -- http://mail.python.org/mailman/listinfo/python-list
Re: computer unable to load _pysvn.pyc
Timothy Smith wrote: >this is truely maddening > >Traceback (most recent call last): > File "PubWare.py", line 11, in ? > File "Main.pyc", line 46, in ? > File "pysvn\__init__.pyc", line 12, in ? > File "pysvn\_pysvn.pyc", line 9, in ? > File "pysvn\_pysvn.pyc", line 7, in __load >ImportError: DLL load failed: A device attached to the system is not >functioning. > >any ideas? it works perfectly on another computer > > ok more information - windows 98 computers have this issue, xp computers are fine. how do i work around this? obviously one of the pysvn dll's won't load on win98. note this is py2exe package made on a windows xp system -- http://mail.python.org/mailman/listinfo/python-list
computer unable to load _pysvn.pyc
this is truely maddening Traceback (most recent call last): File "PubWare.py", line 11, in ? File "Main.pyc", line 46, in ? File "pysvn\__init__.pyc", line 12, in ? File "pysvn\_pysvn.pyc", line 9, in ? File "pysvn\_pysvn.pyc", line 7, in __load ImportError: DLL load failed: A device attached to the system is not functioning. any ideas? it works perfectly on another computer -- http://mail.python.org/mailman/listinfo/python-list
Re: py2exe + svn - the final drama
David Bolen wrote: >Timothy Smith <[EMAIL PROTECTED]> writes: > > > >>what i do is as soon as the update is complete i close the app, but it >>still gives the error, i tried clear() after update and before it, it >>still got the same error. it's be nice to not have to fiddle around >>with the zip file, i really think making py2exe create a dir instead >>of a zip will be much better >> >> > >Well, you'd still potentially have a problem if the update changed a >file in that directory that hadn't been imported yet, but now depended >on other updated files that your application had already loaded old >versions for. That's a general problem of updating modules beneath >the executing application, and not really specific to the zip file, >although you're getting a zip importer specific error related to that >in this case. > > > >>here what i do anyway >> >>if (os.name == 'nt') or (os.name == 'win32'): >> client = pysvn.Client() >>#get current revision number >>CurrentRev = client.info('').revision.number >> Check = client.update('') >>sys.path_importer_cache.clear() >> if Check.number > CurrentRev: >>self.Popup('Update installed, click ok and restart >>','Update installed') >>self.Destroy() >> else: >>InfoMsg.Update(3,'No Updates needed') >> >> > >Ah, it's more devious than I thought. Just pointed out the other >missing piece in his response. > >Apparently there are two levels of caching that you've got to defeat >if you change the underlying zip: > >1. A global file set of file directory cache information for any opened > zip file (for all files in the zip). This is held in the zipimport > module global _zip_directory_cache. >2. Individual file cached information within the zipimporter instance > that is kept in the path importer cache (sys.path_importer_cache). > Technically these are just references to the same individual entries > being held in the dictionary from (1). > >So when you cleared out (2), it still found the cached directory at >the zipimport module level and re-used that information. But if you only >clear out (1), then the reference in (2) to the directory entries for >currently imported modules remains and still gets used. > >I tried testing this with a small zip file that I first built with normal >compression on the entries, then imported one from a running interpreter, >and then rebuilt the zip without compression. I couldn't seem to get the >precise error you were getting, but doing this gave me a decompression >error upon an attempted reload of an imported module, since the cached >information still thought it was compressed. > >After clearing both sys.path_importer_cache and >zipimport._zip_directory_cache, the reload went fine. > >It's sort of unfortunate that you have to cheat with the "private" >cache clearing in this case. It might be worth an enhancement request >to see if zipimport could know to update itself if the timestamp on >the zip file changes, but this is sort of a very specialized scenario. >Although maybe just a public way to cleanly flush import cache >information would be useful. > >-- David > > awesome it looks like it's working now! it's a very convenient why of keeping them all up today, now instead of stuffing around making setup packages i can just run my makeexe.bat file to create the py2exe files, svn commit -m "new package" and i'm done. also there's no way for the staff to bugger it up ( well, it's fairly safe) thanks very very much to everyone who made suggestions, this is what makes OSS so good - the community input and support. -- http://mail.python.org/mailman/listinfo/python-list
Re: py2exe + svn - the final drama
Just wrote: >In article <[EMAIL PROTECTED]>, > David Bolen <[EMAIL PROTECTED]> wrote: > > > >>Are you perhaps trying to update the zip file in-place while it is still >>being used by the application? I'm not sure that's a safe operation. >> >> > >I'm sure it's not :) > >[lots of useful help snipped] > >the zipimport module has an attr called _zip_directory_cache, which is a >dict you can .clear(). Still, reloading modules is hairy at best, its >probably easiest to relaunch your app when the .zip file has changed. > >Just > > what i do is as soon as the update is complete i close the app, but it still gives the error, i tried clear() after update and before it, it still got the same error. it's be nice to not have to fiddle around with the zip file, i really think making py2exe create a dir instead of a zip will be much better here what i do anyway if (os.name == 'nt') or (os.name == 'win32'): client = pysvn.Client() #get current revision number CurrentRev = client.info('').revision.number Check = client.update('') sys.path_importer_cache.clear() if Check.number > CurrentRev: self.Popup('Update installed, click ok and restart ','Update installed') self.Destroy() else: InfoMsg.Update(3,'No Updates needed') -- http://mail.python.org/mailman/listinfo/python-list
Re: py2exe + svn - the final drama
Timothy Smith wrote: >ok, i am updating my program from my svn - this works, however, i am >getting the following error when i close the program. the zip file >successfully updates, so i'm curious as to the meaning of this. > >Traceback (most recent call last): > File "Main.pyo", line 820, in ValidateLogin > File "Main.pyo", line 863, in ShowMainFrameItems > File "glob.pyo", line 22, in glob > File "glob.pyo", line 50, in glob1 > File "fnmatch.pyo", line 42, in filter >zipimport.ZipImportError: bad local file header in Z:\temp\library.zip > >not that once i have finished client.update(''), it has successfully >updated the zipfile, i open a dialoge box saying "click ok and restart >program" AFTER i click on the above error pops up and my app shuts down >as intended. > >ideas? > > ok i have done some digging and i cound this /* Check to make sure the local file header is correct */ fseek(fp, file_offset, 0); l = PyMarshal_ReadLongFromFile(fp); if (l != 0x04034B50) { /* Bad: Local File Header */ PyErr_Format(ZipImportError, "bad local file header in %s", archive); fclose(fp); can anyone explain to me about zip file headers and why it would be different/incorrect and give me this error? return NULL; -- http://mail.python.org/mailman/listinfo/python-list
py2exe + svn - the final drama
ok, i am updating my program from my svn - this works, however, i am getting the following error when i close the program. the zip file successfully updates, so i'm curious as to the meaning of this. Traceback (most recent call last): File "Main.pyo", line 820, in ValidateLogin File "Main.pyo", line 863, in ShowMainFrameItems File "glob.pyo", line 22, in glob File "glob.pyo", line 50, in glob1 File "fnmatch.pyo", line 42, in filter zipimport.ZipImportError: bad local file header in Z:\temp\library.zip not that once i have finished client.update(''), it has successfully updated the zipfile, i open a dialoge box saying "click ok and restart program" AFTER i click on the above error pops up and my app shuts down as intended. ideas? -- http://mail.python.org/mailman/listinfo/python-list
Re: py2exe and library.zip
David Bolen wrote: >Peter Hansen <[EMAIL PROTECTED]> writes: > > > >>Do you know that Subversion has (as I understand it) a fairly >>intelligent binary file comparison routine, and it will (again, as I >>understand it) not transmit the entire contents of the zip file but >>would actually send only the portions that have changed? At least, >>that's if the file isn't compressed in some way that prevents this >>algorithm from working well. (Note to self: check if zip files that >>can be in sys.path can be compressed, and if py2exe compresses them.) >> >> > >Even if the files were compressed, which has a net result similar to >randomizing the contents and will certainly extend the portion that >appears "changed", the worst that would happen is that subversion >(which does use a binary delta algorithm) would end up downloading the >single file portion of the zip file rather than the smaller change >within the file. It should still be efficient. > >But to be honest, for something like the OPs purpose, it's not clear >that an SCM is needed, since all he's trying to accomplish is bring a >remote copy up to date with the central one. For that you could just >publish a location containing the necessary files and have the users >use something like rsync directly (which is just as efficient in terms >of a binary delta) to update their own local version. > >Of course, if the Subversion server is already in place so it's a >convenient server, or if more of the user base already has the client >in place, it should work just about as well. > >-- David > > I've got this working now, and fyi it downloads the entire zip every time. and svn appears to be very slow at it to. -- http://mail.python.org/mailman/listinfo/python-list
Re: Py2Exe security
i used to work in a place that did this exact same thing. they attempted to hide passwords in source code. there is an even bigger problem with this then security of it in source - if someone comprimises the password, how are you going to change it quickly? all those systems will have to update their exe. keep in mind they could get it any other number of ways forcing you to change it. it's the same reason it's not a good idea to put static address's in source. -- http://mail.python.org/mailman/listinfo/python-list
utf encoding error
hi there, this one is in relation to my py2exe saga. when i compile a package using py2exe i get the error msg below, if i just run the py files it doesn't error, so i assume pysvn is trying to use something thats not being included in the build. only i have no idea where to start looking. Traceback (most recent call last): File "Main.pyc", line 819, in ValidateLogin File "Main.pyc", line 861, in ShowMainFrameItems LookupError: unknown encoding: utf-8 and here is my setup.py for py2exe for good measure from distutils.core import setup import py2exe package_dir = ['c:\python23\reportlab', 'c:\python23\lib', 'Z:\Projects\PubWare\trunk\python'] setup(windows=[ "Z:\\Projects\\PubWare\\trunk\\python\\PubWare.py"]) -- http://mail.python.org/mailman/listinfo/python-list
Re: py2exe and library.zip
Peter Hansen wrote: >Timothy Smith wrote: > > >>Peter Hansen wrote: >> >> >>>Anything's possible. Maybe you could explain what you're actually >>>trying to accomplish (or the reasons) so we can better understand >>>where you're going with this... >>> >>> >>> >>exactly what i just stated, i don't want py2exe to zip up it's >>library's, but to put them in a sub dir. >>the reason for this, is so that when users login and update from svn, >>they only have to download some tiny pyc files, not a great big zip file >>with everything in it ( 99% of which never changes) >> >> > >More detail on this version control thing would probably help. (Things >like that are why I asked fo more background... "exactly what I stated" >isn't as useful as something like (for example) "I want my app users to >use Subversion to retrieve updates to the application without having to >download a big zip file".) > >Do you know that Subversion has (as I understand it) a fairly >intelligent binary file comparison routine, and it will (again, as I >understand it) not transmit the entire contents of the zip file but >would actually send only the portions that have changed? At least, >that's if the file isn't compressed in some way that prevents this >algorithm from working well. (Note to self: check if zip files that can >be in sys.path can be compressed, and if py2exe compresses them.) > >Anyway, while this sort of thing isn't directly supported (probably >since almost nobody would want to do it, for reasons similar to what >Simon has explained), you should be able to work it out yourself. The >.exe produced by py2exe contains a "stub" executable that basically sets > sys.path to point to the .zip file, then runs the main .py which has >been integrated into the .exe file (not even compiled to a .pyc, just >like normal). If you modify your main .py to adjust sys.path to point >to an external subdirectory, you should be able to leave .py files (or >.pyc files) there and use svn to update them. > >I'll leave it as an exercise for the reader (mainly because I don't know >how to do it offhand) what you should do to prevent py2exe from putting >all your files in its zip. It should probably still put the standard >library modules there, since otherwise you'd have little reason to be >using py2exe in the first place... > >-Peter > > ideally i'd love to not to have to use py2exe at all, then they can just update from the stable branch of my svn. the problem with THAT is how to install python, wx,pysvn,reportlab etc etc on their systems with no fuss(py2exe convienently packages all dll's together for me). if you know of a way i can achieve that i'd be your best friend forever. the whole reason i'm going with the svn updating method is there is no user interaction required. even getting users to click a single button to update has proven too much to ask of them :/ the other reason is my particular project gets updated very often, so you can imagine the combination of users resistant to any kind of computer use with an environment requiring frequent updating. i have some other problems to solve before i get to that point, mainly svn related eg. pysvn whinges because files exist in the working directory that it wants to update ( with the same name ), only they aren't under version control. -- http://mail.python.org/mailman/listinfo/python-list
Re: py2exe and library.zip
Simon Brunning wrote: >On 5/4/05, Timothy Smith <[EMAIL PROTECTED]> wrote: > > >>Simon Brunning wrote: >> >> >>>The zip file is a generated artifact. I've always found it a good rule >>>of thumb that you should keep source artifacts in your version control >>>system, not generated artifacts. >>> >>> >>> >>> >>> >>version control systems are used for many purposes. it's just as >>important to keep track of your packaged releases and documentation as >>it is source code. >>its also a very convenient method of keeping people up with the lastest >>version. >> >> > >Well, they may be used for many things, but what they are *good* at is >what they were designed for. Use them to do a job that they *weren't* >designed for, and they don't do so well. > > > don't do so well how. all it does is keep of files and tracks their revisions. >The zip file essentially contains the whole system in on lump. Change >the system, and naturally your users will have to download the whole >lump again. (In my 'day job', I'm a Java web app developer. We keep >the source for our systems in SVN, any 3rd party JARs, and our build >scripts. We *used* to keep the installable WAR files in there too, but >we've stopped doing that now, for this reason amongst others.) > > but if it was just a dir, when they update from the svn at log in, all they do is download the extra\changed files. much much quicker then downloading a 4 meg uncompressed zip file. there's no technical reason for this not to work that i can see, apart from py2exe's ability/inablity to not use a zip file. > > >>i know i've seen what i'm asking for before, but no one seems to be able >>to tell me. >> >> > >Sorry, but I'm not aware that py2exe can do this, or has ever been >able to. Again, it's designed to build you a minimum-file-count >distributable, and that's what it's good at. > > > -- http://mail.python.org/mailman/listinfo/python-list
Re: py2exe and library.zip
Peter Hansen wrote: >Timothy Smith wrote: > > >>is it possible instead of py2exe putting all library's in a zip file, to >>just put them in a sub dir? >> >> > >Anything's possible. Maybe you could explain what you're actually >trying to accomplish (or the reasons) so we can better understand where >you're going with this... > >-Peter > > exactly what i just stated, i don't want py2exe to zip up it's library's, but to put them in a sub dir. the reason for this, is so that when users login and update from svn, they only have to download some tiny pyc files, not a great big zip file with everything in it ( 99% of which never changes) -- http://mail.python.org/mailman/listinfo/python-list
py2exe and library.zip
is it possible instead of py2exe putting all library's in a zip file, to just put them in a sub dir? -- http://mail.python.org/mailman/listinfo/python-list
pysvn install on freebsd
has anyone used or installed this on fbsd the install for it is totally redundant. i get this error for it make -f freebsd.mak clean all test cd ../Source && make -f pysvn_freebsd_py.mak clean make: cannot open pysvn_freebsd_py.mak. *** Error code 2 Stop in /usr/home/timothy/pysvn-1.1.2/Extension/Builder. -- http://mail.python.org/mailman/listinfo/python-list
pysvn install on freebsd
has anyone used or installed this on fbsd the install for it is totally redundant. i get this error for it make -f freebsd.mak clean all test cd ../Source && make -f pysvn_freebsd_py.mak clean make: cannot open pysvn_freebsd_py.mak. *** Error code 2 Stop in /usr/home/timothy/pysvn-1.1.2/Extension/Builder. -- http://mail.python.org/mailman/listinfo/python-list
Re: cross platform use of set locale
Serge Orlov wrote: Timothy Smith wrote: Serge Orlov wrote: Timothy Smith wrote: thats ok, but how do i get it to group thousands with a , ? and thats would mean i'd have to run everything through a formatter before i displayed it :/ it'd be nicer if i could just select a proper locale I think you're misusing locale. There is no guarantee that any specific locale will have properties (like grouping) set to a known value. Are you trying to format money? Then you need a special class so that you can say: d = Dollars(100.01) print "You have %s in your account" % d and get You have $1,000,000.01 in your account. Serge. thats exactly what i'm trying to do, only having to do that for all my outputs is more work then i'd like :/ SUS has added numeric grouping For some numeric conversions a radix character (`decimal point') or thousands' grouping character is used. The actual character used depends on the LC_NUMERIC part of the locale. The POSIX locale uses `.' as radix character, and does not have a grouping character. Thus, printf("%'.2f", 1234567.89); results in `1234567.89' in the POSIX locale, in `1234567,89' in the nl_NL locale, and in `1.234.567,89' in the da_DK locale. but they hasn't added monetary grouping. I don't think you'll get monetary grouping anytime soon. Besides as far as I understood your question, you *always* want grouping, right? Actually I don't think a cryptic flag is better than an explicit formatter. What do you think is more clear for a maintainer of your code? print "%'.2f" % amount or print "%s" % dollars(amount) why is this a misuse of locale? it's exactly what locale is meant for isn't it? I just reacted to your words "select a proper locale" and "how do i get it to group thousands with a ,". It's just not a good idea to select a locale and expect the grouping character to be "," or expect grouping, see nl_NL locale example above. Serge. i'm pretty sure english au uses thousands grouping with , i've managers to make this work, however it just isn't cross platform at all. -- http://mail.python.org/mailman/listinfo/python-list
Re: cross platform use of set locale
Serge Orlov wrote: Timothy Smith wrote: thats ok, but how do i get it to group thousands with a , ? and thats would mean i'd have to run everything through a formatter before i displayed it :/ it'd be nicer if i could just select a proper locale I think you're misusing locale. There is no guarantee that any specific locale will have properties (like grouping) set to a known value. Are you trying to format money? Then you need a special class so that you can say: d = Dollars(100.01) print "You have %s in your account" % d and get You have $1,000,000.01 in your account. Serge. thats exactly what i'm trying to do, only having to do that for all my outputs is more work then i'd like :/ why is this a misuse of locale? it's exactly what locale is meant for isn't it? -- http://mail.python.org/mailman/listinfo/python-list
Re: cross platform use of set locale
Marc 'BlackJack' Rintsch wrote: In <[EMAIL PROTECTED]>, Timothy Smith wrote: hi there i need to set my locale so that when i output a number it's formatted with thousands grouped. the problem i've found is there doesn't seem to be very good cross platform support for locales, even between unix's it's horrid. Have you tried this:: import locale locale locale.setlocale(LC_ALL, '') locale.format('%.2f', 100, True) The `True` turns on grouping. Should work cross platform. Ciao, Marc 'BlackJack' Rintsch thats ok, but how do i get it to group thousands with a , ? and thats would mean i'd have to run everything through a formatter before i displayed it :/ it'd be nicer if i could just select a proper locale -- http://mail.python.org/mailman/listinfo/python-list
cross platform use of set locale
hi there i need to set my locale so that when i output a number it's formatted with thousands grouped. the problem i've found is there doesn't seem to be very good cross platform support for locales, even between unix's it's horrid. -- http://mail.python.org/mailman/listinfo/python-list
Re: fastest postgresql module
Leif B. Kristensen wrote: Timothy Smith skrev: my only issue with psycopg, is last time i looked they had no win32 port? Uh, in that case, maybe you should consider changing platform? 8^) my app has to be multiplatform, but i would gladly rip windows from the drives of every computer with my bare hands. -- http://mail.python.org/mailman/listinfo/python-list
Re: fastest postgresql module
Leif B. Kristensen wrote: Timothy Smith skrev: has anyone got some hard numbers on which pg access module is the fastest, i currently use pypgsql, but i can't help but feel it's a little slow. 3 seconds to connect, send one query, get th return data. i'm on a adsl 1.5mbit/256kbit link, the server is on a 10/10mbit, and i have a ping of 245ms average. maybe pypgsql does too much backand forth, i don't know. You might want to try psycopg, it's claimed to be optimized for speed. my only issue with psycopg, is last time i looked they had no win32 port? -- http://mail.python.org/mailman/listinfo/python-list
fastest postgresql module
has anyone got some hard numbers on which pg access module is the fastest, i currently use pypgsql, but i can't help but feel it's a little slow. 3 seconds to connect, send one query, get th return data. i'm on a adsl 1.5mbit/256kbit link, the server is on a 10/10mbit, and i have a ping of 245ms average. maybe pypgsql does too much backand forth, i don't know. -- http://mail.python.org/mailman/listinfo/python-list
Re: locale support and 4.10
Martin v. Löwis wrote: Timothy Smith wrote: >>> locale.setlocale(locale.LC_NUMERIC, 'us') the exact same thing works under windows xp. do i have to compile it with locale support? No. You have to choose a locale name that is supported by your operating system (which appears to be FreeBSD). Read your OS documentation for what valid locale names are; most likely, "en_US" or "en_US.ISO-8859-1" are supported. also my second question. once i have this working how do i set the thousands_sep character to be a "," ? You don't directly set it. It is a property of the locale. Regards, Martin something strange is happening, no matter what i try nothing is a supported locale and yes it's freebsd 4.10 -- http://mail.python.org/mailman/listinfo/python-list
locale support and 4.10
i'm trying to setlocale() on 4.10, and it appears the python package doesn't support this under 4.10. Python 2.3.3 (#2, Apr 28 2004, 22:48:37) [GCC 2.95.4 20020320 [FreeBSD]] on freebsd4 Type "help", "copyright", "credits" or "license" for more information. >>> import locale >>> locale.setlocale(locale.LC_NUMERIC, 'us') Traceback (most recent call last): File "", line 1, in ? File "/usr/local/lib/python2.3/locale.py", line 381, in setlocale return _setlocale(category, locale) locale.Error: unsupported locale setting >>> the exact same thing works under windows xp. do i have to compile it with locale support? also my second question. once i have this working how do i set the thousands_sep character to be a "," ? -- http://mail.python.org/mailman/listinfo/python-list