python-dev Summary for 2006-08-16 through 2006-08-31

2006-10-18 Thread steven . bethard
python-dev Summary for 2006-08-16 through 2006-08-31 .. contents:: [The HTML version of this Summary is available at http://www.python.org/dev/summary/2006-08-16_2006-08-31] = Announcements =

Re: Plotting histograms

2006-10-18 Thread [EMAIL PROTECTED]
Thanks Robert, My previous problem is solved(I was using 'from matplotlib.pylab import *') but now I am facing another problem. I want to plot the histogram of eigenvalues calculated and I am using the following code: ___ import

Re: string splitting

2006-10-18 Thread George Sakkis
[EMAIL PROTECTED] wrote: Hello, I have thousands of files that look something like this: wisconsin_state.txt french_guiana_district.txt central_african_republic_province.txt I need to extract the string between the *last* underscore and the extention. So based on the files above, I want

Re: I would like write some data recovery software

2006-10-18 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], gel wrote: Dennis Lee Bieber wrote: On 17 Oct 2006 20:18:40 -0700, gel [EMAIL PROTECTED] declaimed the following in comp.lang.python: […] You also need very good documentation of the file system […] Yes, OK I guess NTFS would be of most interest to me. Then you'll

Re: Plotting histograms

2006-10-18 Thread Robert Kern
[EMAIL PROTECTED] wrote: Thanks Robert, My previous problem is solved(I was using 'from matplotlib.pylab import *') but now I am facing another problem. I want to plot the histogram of eigenvalues calculated and I am using the following code:

Re: creating many similar properties

2006-10-18 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Lee Harr wrote: But what if I have a whole bunch of these pwm properties? I made this: class RC(object): def _makeprop(name): prop = '_%s' % name def _set(self, v): v_new = v % 256 setattr(self, prop, v_new)

Re: Python wrapper for C++ core

2006-10-18 Thread Carl Banks
[EMAIL PROTECTED] wrote: Hi All Apologies in advance for the pretty basic question - but I can't seem to find an answer anywhere else. I am developing a fluid sim in C++ and have heard that many people use Python in conjunction with C++ for this sort of thing (especially in games dev).

Re: creating many similar properties

2006-10-18 Thread Michele Simionato
Lee Harr wrote: I understand how to create a property like this: class RC(object): def _set_pwm(self, v): self._pwm01 = v % 256 def _get_pwm(self): return self._pwm01 pwm01 = property(_get_pwm, _set_pwm) But what if I have a whole bunch of these pwm

Flexable Collating (feedback please)

2006-10-18 Thread Ron Adam
I put together the following module today and would like some feedback on any obvious problems. Or even opinions of weather or not it is a good approach. While collating is not a difficult thing to do for experienced programmers, I have seen quite a lot of poorly sorted lists in commercial

Re: I would like write some data recovery software

2006-10-18 Thread Laurent Pointal
gel a écrit : I would like to write some data recovery software as a learning thing. The sort of thing that you would use to recover data from a currupt HDD or floppy etc. I would like to be pointed in the right direction as far as modules to use and suggested approaches. Once you get a

What happened to RuleDispatch

2006-10-18 Thread exhuma.twn
Hi all, yesterday I wanted to install TurboGears, which depends on RuleDispatch. However, I failed to download it. First I got the error Bad Gateway from the server, today it's simply a Not Found error. So what happened to it? Does somebody know? I would really need to install TurboGears in the

Re: People's names (was Re: sqlite3 error)

2006-10-18 Thread Hendrik van Rooyen
Florian Diesch [EMAIL PROTECTED]wrote: 8-- In Germany von is just a part of the name since 1919 when the nobility was abolished by law. Thanks - was not aware of this - 1919 - just after the Great War, 1914-1918... - Hendrik --

[OT] a little about regex

2006-10-18 Thread Fulvio
*** Your mail has been scanned by InterScan MSS. *** Hello, I'm trying to get working an assertion which filter address from some domain but if it's prefixed by '.com'. Even trying to put the result in a negate test I can't get the wanted result. The

Re: Flexable Collating (feedback please)

2006-10-18 Thread Ron Adam
Fixed... Changed the collate() function to return None the same as sort() since it is an in place collate. A comment in _test() doctests was reversed. CAPS_FIRST option puts words beginning with capitals before, not after, words beginning with lower case of the same letter. It seems I

Re: [OT] a little about regex

2006-10-18 Thread Fredrik Lundh
Fulvio wrote: ... if deny.search(adr): cnt += 1 ... if allow.search(adr): cnt += 1 hint: under what circumstances are cnt decremented in the above snippet? /F -- http://mail.python.org/mailman/listinfo/python-list

RE: Where to find pydoc?

2006-10-18 Thread Wijaya Edward
Hi, Can you be specific on which URLs can I find python-tools. Cause I tried the one under easy_install, I still can't find it. Thanks and hope to hear from you again. -- Edward WIJAYA SINGAPORE From: [EMAIL PROTECTED] on behalf of Fredrik Lundh Sent: Mon

How to convert this list to string?

2006-10-18 Thread Jia Lu
Hi all I have a list like: list [1, 2, 3] list[1:] [2, 3] I want to get a string 2 3 str(list[1:]) '[2, 3]' How can I do that ? thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: How to convert this list to string?

2006-10-18 Thread Theerasak Photha
On 18 Oct 2006 00:20:50 -0700, Jia Lu [EMAIL PROTECTED] wrote: I want to get a string 2 3 str(list[1:]) '[2, 3]' How can I do that ? ' '.join(str(i) for i in list[1:]) -- Theerasak -- http://mail.python.org/mailman/listinfo/python-list

Re: How to convert this list to string?

2006-10-18 Thread Travis E. Oliphant
Jia Lu wrote: Hi all I have a list like: list [1, 2, 3] list[1:] [2, 3] I want to get a string 2 3 str(list[1:]) '[2, 3]' How can I do that ? .join(str(x) for x in list) -Travis -- http://mail.python.org/mailman/listinfo/python-list

Re: stdout not flushed before os.execvp()

2006-10-18 Thread Fulvio
On Wednesday 18 October 2006 00:25, Fredrik Lundh wrote: |feature. the exec system call operates on a lower level than the |stdio buffering system. I did in this manner: for exe in ('imap4', 'pop3'): if exe in cfgfil[optsrv + '.protocol']: exe = exe[:4]; exe =

Re: creating many similar properties

2006-10-18 Thread Carl Banks
Lee Harr wrote: I understand how to create a property like this: class RC(object): def _set_pwm(self, v): self._pwm01 = v % 256 def _get_pwm(self): return self._pwm01 pwm01 = property(_get_pwm, _set_pwm) But what if I have a whole bunch of these pwm

Re: Where to find pydoc?

2006-10-18 Thread Fredrik Lundh
Wijaya Edward wrote: Can you be specific on which URLs can I find python-tools. Cause I tried the one under easy_install, I still can't find it. it's an RPM. you should be able to get it from where you get other RedHat packages. /F -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] a little about regex

2006-10-18 Thread Ron Adam
Fulvio wrote: *** Your mail has been scanned by InterScan MSS. *** Hello, I'm trying to get working an assertion which filter address from some domain but if it's prefixed by '.com'. Even trying to put the result in a negate test I can't get

Re: How to convert this list to string?

2006-10-18 Thread Fredrik Lundh
Jia Lu wrote: Hi all I have a list like: list [1, 2, 3] list[1:] [2, 3] I want to get a string 2 3 str(list[1:]) '[2, 3]' How can I do that ? http://effbot.org/zone/python-list.htm#printing /F -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for assignement operator

2006-10-18 Thread Tommi
Could the traits package be of help? http://code.enthought.com/traits/ Alexander Eisenhuth wrote: Hello, is there a assignement operator, that i can overwrite? class MyInt: def __init__(self, val): assert(isinstance(val, int)) self._val = val a =

Re: creating many similar properties

2006-10-18 Thread George Sakkis
Michele Simionato wrote: Lee Harr wrote: I understand how to create a property like this: class RC(object): def _set_pwm(self, v): self._pwm01 = v % 256 def _get_pwm(self): return self._pwm01 pwm01 = property(_get_pwm, _set_pwm) But what if I

Re: creating many similar properties

2006-10-18 Thread George Sakkis
Carl Banks wrote: Lee Harr wrote: I understand how to create a property like this: class RC(object): def _set_pwm(self, v): self._pwm01 = v % 256 def _get_pwm(self): return self._pwm01 pwm01 = property(_get_pwm, _set_pwm) But what if I have a

Re: How to convert this list to string?

2006-10-18 Thread Ron Adam
Jia Lu wrote: Hi all I have a list like: list [1, 2, 3] list[1:] [2, 3] I want to get a string 2 3 str(list[1:]) '[2, 3]' How can I do that ? thanks Just to be different from the other suggestions... a = [1, 2, 3] str(a[1:]).strip('[]').replace(',', '') '2 3' By the

Re: python's OOP question

2006-10-18 Thread neoedmund
Bruno Desthuilliers wrote: neoedmund wrote: (snip) So I can reuse a method freely only if it's worth reusing. For the word inheritance, in some aspect, meanings reuse the super class, with the condition: must reuse everything from super class. Not really. In fact, inheritance *is* a

Re: creating many similar properties

2006-10-18 Thread Michele Simionato
George Sakkis wrote: Why is this less hidden or magical than a metaclass ? Because it does not use inheritance. It is not going to create properties on subclasses without you noticing it. Also, metaclasses are brittle: try to use them with __slots__, or with non-standard classes (i.e.

Re: python's OOP question

2006-10-18 Thread Fredrik Lundh
neoedmund wrote: ivestgating the web, i found something similiar with my approch: http://en.wikipedia.org/wiki/Duck_typing Duck-typing avoids tests using type() or isinstance(). Instead, it typically employs hasattr() tests that's not entirely correct, though: in Python, duck-typing

Re: python's OOP question

2006-10-18 Thread neoedmund
Bruno Desthuilliers wrote: neoedmund wrote: (snip) So I can reuse a method freely only if it's worth reusing. For the word inheritance, in some aspect, meanings reuse the super class, with the condition: must reuse everything from super class. Not really. In fact, inheritance *is* a

Re: creating many similar properties

2006-10-18 Thread Michele Simionato
George Sakkis wrote: from itertools import chain, izip, repeat def ByteProperties(*names, **defaulted_names): def byte_property(name, default): return property(lambda self: getattr(self, name, default), lambda self,v: setattr(self, name, v%256)) def

Re: creating many similar properties

2006-10-18 Thread Carl Banks
George Sakkis wrote: Michele Simionato wrote: import sys def defprop(name, default=127): loc = sys._getframe(1).f_locals prop = '_%s' % name def _set(self, v): v_new = v % 256 setattr(self, prop, v_new) def _get(self): return

Re: creating many similar properties

2006-10-18 Thread Michele Simionato
Carl Banks wrote: Devil's Advocate: he did say hidden magic TO YOUR CLASS. If you use a (real) metaclass, then you have the icky feeling of a class permanently tainted by the unclean metaclass (even though the metaclass does nothing other than touch the class dict upon creation); whereas if

Re: creating many similar properties

2006-10-18 Thread Carl Banks
George Sakkis wrote: There's a subtle common bug here: all _get and _set closures will refer to the last property only. You have to remember to write def _set(self,v,prop=prop) and similarly for _get to do the right thing. Sorry. My mistake. By the way, I can't think of a case where the

Re: Looking for assignement operator

2006-10-18 Thread Bruno Desthuilliers
Tommi wrote: (please don't top-post - corrected) Alexander Eisenhuth wrote: Hello, is there a assignement operator, that i can overwrite? class MyInt: def __init__(self, val): assert(isinstance(val, int)) self._val = val a = MyInt(10) # Here i need

Re: dynamic module loading via __import__, nonetype?

2006-10-18 Thread John Allman
Gabriel Genellina wrote: At Monday 16/10/2006 13:33, John Allman wrote: If i manually import a module, this method works a treat, however if i attempt to dynamically load a module at runtime the create method fails with the following error: TypeError: 'NoneType' object is not callable

Re: a little about regex

2006-10-18 Thread Rob Wolfe
Fulvio wrote: I'm trying to get working an assertion which filter address from some domain but if it's prefixed by '.com'. Even trying to put the result in a negate test I can't get the wanted result. [...] Seem that I miss some better regex implementation to avoid that both of the

Re: creating many similar properties

2006-10-18 Thread Carl Banks
Michele Simionato wrote: Carl Banks wrote: Devil's Advocate: he did say hidden magic TO YOUR CLASS. If you use a (real) metaclass, then you have the icky feeling of a class permanently tainted by the unclean metaclass (even though the metaclass does nothing other than touch the class

Wax: problem subclassing TextBox

2006-10-18 Thread alex23
Hey everyone, I've just started looking at Wax and have hit a problem I can't explain. I want an app to respond to every character input into a TextBox. Here's a simple, working example: +++ from wax import * class MainFrame(VerticalFrame): def Body(self): self.search = TextBox(self)

RE: making a valid file name...

2006-10-18 Thread Matthew Warren
Hi I'm writing a python script that creates directories from user input. Sometimes the user inputs characters that aren't valid characters for a file or directory name. Here are the characters that I consider to be valid characters... valid =

Re: creating many similar properties

2006-10-18 Thread Michele Simionato
Carl Banks wrote: Come on, I don't think anyone's under the impression we're being indiscriminate here. Ok, but I don't think that in the case at hand we should recommend a metaclass solution. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Book about database application development?

2006-10-18 Thread Paul Boddie
Dennis Lee Bieber wrote: Python has a half dozen GUI toolkits, and multiple adapters for databases (some don't even follow DB-API2 specs). All independently written. So no, you are not going to find, say, a grid widget that automatically links to a database table/view/cursor, with

Re: Python Web Site?

2006-10-18 Thread Christophe
*% a écrit : Is there a problem with the Python and wxPython web sites? I cannot seem to get them up, and I am trying to find some documentation... Thanks, Mike All the sites hosted on sourceforge that rely on their vhost computer ( ie, site hosted on sourceforge that do not

Re: python's OOP question

2006-10-18 Thread Ben Finney
neoedmund [EMAIL PROTECTED] writes: Bruno Desthuilliers wrote: neoedmund wrote: in real life, a class is not defined so well that any method is needed by sub-class. Then perhaps is it time to refactor. A class should be a highly cohesive unit. If you find yourself needing only a

Re: python's OOP question

2006-10-18 Thread Neil Cerutti
On 2006-10-18, neoedmund [EMAIL PROTECTED] wrote: ivestgating the web, i found something similiar with my approch: http://en.wikipedia.org/wiki/Duck_typing Duck-typing avoids tests using type() or isinstance(). Instead, it typically employs hasattr() tests It's pity it didn't get called quack

portable extensions options for external libraries

2006-10-18 Thread Alexandre Guimond
Hi. I want to create a portable setup.py file for windows / linux for an extension package that i need to link with external libraries (gsl and boost). on windows i do something like this: imaging = Extension( 'pyag.imaging._imaging', sources = ( glob.glob(

matrix Multiplication

2006-10-18 Thread Sssasss
hi evrybody! I wan't to multiply two square matrixes, and i don't understand why it doesn't work. Could you explain me? def multmat(A,B): A*B if len(A)!=len(B): return error D=[] C=[] for i in range(len(A)): D.append(0) for i in range(len(A)): C.append(D) for i in

Re: making a valid file name...

2006-10-18 Thread Fredrik Lundh
Matthew Warren wrote: import re badfilename='£%^£^£$^ihgeroighroeig3645^£$^knovin98u4#346#1461461' valid=':./,^0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ' goodfilename=re.sub('[^'+valid+']',' ',badfilename) to create arbitrary character sets, it's usually best to run the

Re: matrix Multiplication

2006-10-18 Thread Fredrik Lundh
Sssasss wrote: I wan't to multiply two square matrixes, and i don't understand why it doesn't work. def multmat(A,B): A*B if len(A)!=len(B): return error D=[] C=[] for i in range(len(A)): D.append(0) for i in range(len(A)): C.append(D) append doesn't copy data, so

Re: Plotting histograms

2006-10-18 Thread Roberto Bonvallet
[EMAIL PROTECTED] wrote: hi, I have some values(say from -a to a) stored in a vector and I want to plot a histogram for those values. How can I get it done in python. I have installed and imported the Matplotlib package but on executing the code [N,x]=hist(eig, 10) # make a histogram I am

Re: Flexable Collating (feedback please)

2006-10-18 Thread georgeryoung
On Oct 18, 2:42 am, Ron Adam [EMAIL PROTECTED] wrote: I put together the following module today and would like some feedback on any obvious problems. Or even opinions of weather or not it is a good approach. ,,, def __call__(self, a, b): This allows the Collate class work as a

Re: making a valid file name...

2006-10-18 Thread Fabio Chelly
You should use the s.translate() It's 100x faster: #Creates the translation table ValidChars = :./,^0123456789abcdefghijklmnopqrstuvwxyz InvalidChars = .join([chr(i) for i in range(256) if not chr(i).lower() in ValidChars]) TranslationTable = .join([chr(i) for i in range(256)]) def

Re: matrix Multiplication

2006-10-18 Thread Sssasss
Fredrik Lundh wrote: Sssasss wrote: I wan't to multiply two square matrixes, and i don't understand why it doesn't work. def multmat(A,B): A*B if len(A)!=len(B): return error D=[] C=[] for i in range(len(A)): D.append(0) for i in range(len(A)): C.append(D)

codecs.EncodedFile

2006-10-18 Thread Neil Cerutti
Perhaps I'm just bad at searching for bugs, but anyhow, I wanted to know what you all thought about the following behavior. A quick search of pydev archives yielded a nice wrapper to apply to streams to perform decoding and encoding behind the scenes. Assuming I get the correct encodings from

Re: python's OOP question

2006-10-18 Thread Peter Otten
Neil Cerutti wrote: On 2006-10-18, neoedmund [EMAIL PROTECTED] wrote: ivestgating the web, i found something similiar with my approch: http://en.wikipedia.org/wiki/Duck_typing Duck-typing avoids tests using type() or isinstance(). Instead, it typically employs hasattr() tests It's pity it

Re: matrix Multiplication

2006-10-18 Thread Gerrit Holl
On 2006-10-18 14:15:17 +0200, Sssasss wrote: Fredrik Lundh wrote: Sssasss wrote: I wan't to multiply two square matrixes, and i don't understand why it doesn't work. def multmat(A,B): A*B if len(A)!=len(B): return error D=[] C=[] for i in

MemoryError - IMAP retrieve self._sock.recv(recv_size)

2006-10-18 Thread Stephen G
Hi there. I have been receiving MemoryErrors using the Windows version of Python 2.5. The script I have written times the sending and the reception of emails with various attachments. I get many exceptions when using the IMAP downloads. This happens randomly; sometimes the file downloads

Re: MemoryError - IMAP retrieve self._sock.recv(recv_size)

2006-10-18 Thread Fredrik Lundh
Stephen G [EMAIL PROTECTED] wrote: I get many exceptions when using the IMAP downloads. This happens randomly; sometimes the file downloads OK, and other times no. File C:\Python25\lib\socket.py, line 308, in read data = self._sock.recv(recv_size) Is this a know bug or is there

Re: Numpy-f2py troubles

2006-10-18 Thread [EMAIL PROTECTED]
Hi Andrea, you should post this to the numpy list: numpy-discussion@lists.sourceforge.net Cheers! Bernhard Andrea Gavana schrieb: Hello NG, I am using the latest Numpy release 1.0rc2 which includes F2PY. I have switched to Python 2.5 so this is the only alternative I have (IIUC). With

Re: matrix Multiplication

2006-10-18 Thread David
Il 18 Oct 2006 04:17:29 -0700, Sssasss ha scritto: hi evrybody! I wan't to multiply two square matrixes, and i don't understand why it doesn't work. Can I suggest a little bit less cumbersome algorithm? def multmat2(A,B): A*B if len(A)!=len(B): return error # this check is not

Re: matrix Multiplication

2006-10-18 Thread Roberto Bonvallet
Sssasss wrote: hi evrybody! I wan't to multiply two square matrixes, and i don't understand why it doesn't work. Could you explain me? def multmat(A,B): A*B if len(A)!=len(B): return error Wrong validation here: you _can_ multiply two matrices with a different number of rows!

Re: How to convert this list to string?

2006-10-18 Thread Jia Lu
Thank you very much. I memoed all you views. :) -- http://mail.python.org/mailman/listinfo/python-list

PIL: Image.draft -- what are the modes that I can use?

2006-10-18 Thread abcd
I have PIL 1.1.5 on python 2.4.1 and I am attempting to get a smaller (file size) of an image. for example: im = ImageGrab.grab() im.save(tmp.gif) about 1.7mb im.save(tmp.jpeg) about 290kb anyways I want to save the image as a GIF, but not have it be so largeso I thought that

Re: Image.draft -- what are the modes that I can use?

2006-10-18 Thread Fredrik Lundh
abcd wrote: I have PIL 1.1.5 on python 2.4.1 and I am attempting to get a smaller (file size) of an image. for example: im = ImageGrab.grab() im.save(tmp.gif) about 1.7mb im.save(tmp.jpeg) about 290kb anyways I want to save the image as a GIF, but not have it be so

Re: Image.draft -- what are the modes that I can use?

2006-10-18 Thread abcd
Fredrik Lundh wrote: GIF is horribly unsuitable for screenshots on modern machines. have you considered using PNG ? or even better, Flash? well I am trying to take screenshots and make them into an animated GIF, however, putting them into a Flash movie would be coolany idea how to go

Re: Image.draft -- what are the modes that I can use?

2006-10-18 Thread Fredrik Lundh
abcd wrote: or even better, Flash? well I am trying to take screenshots and make them into an animated GIF, however, putting them into a Flash movie would be coolany idea how to go about doing either with python? (windows, possibly linux later) to repeat myself: here's a tool

Re: Image.draft -- what are the modes that I can use?

2006-10-18 Thread abcd
oh and vnc2swf would not be an option, i cant be setting up a vnc server, etc. just need to use python (and necessary packages). animated gif would probably be best i am assuming. -- http://mail.python.org/mailman/listinfo/python-list

Re: Restart a Python COM Server

2006-10-18 Thread m . errami
OK, well thank you for your help (merci pour ton aide!) M.E. MC wrote: Hi! It is the normal behavior of COM. Note that, Python being dynamic, you can modify Python script, OF THE INTERIOR, during execution. -- @-salutations Michel Claveau --

Win32 python and excel macros

2006-10-18 Thread michael . pearmain
Hi Experts, Looking for a very quick bit on of advice on how to make some python code run. I'm a newbie to both VBA and Python, so i apologise if this is very easy but i'm about to tear my hair out after googling for the last 3 days. I have written a large python script which inside of it

Python RPM package arch compatability

2006-10-18 Thread Christopher Taylor
Hello all, A quick question if I may. I'm running RHEL 4 on a x86_64 and I'm curious if any of the packages at http://www.python.org/download/releases/2.4/rpms/ would suite my setup. If they don't can I simply build from source and not overwrite /usr/bin/Python (for the same reasons as listed

Re: Image.draft -- what are the modes that I can use?

2006-10-18 Thread abcd
Fredrik Lundh wrote: to repeat myself: here's a tool that lets you use VNC to capture the screen, and then convert the result to a flash animation: http://www.unixuser.org/~euske/vnc2swf/ /F is there a way to make animated GIFs with python? vnc2swf is to much for what i

Re: Save/Store whole class (or another object) in a file

2006-10-18 Thread alexLIGO
Hi, thanks for the reply,but unfortunately this does not work with the type of classes I am dealing with. When trying to pickle the class I get the following error: File /usr/lib/python2.4/copy_reg.py, line 76, in _reduce_ex raise TypeError(a class that defines __slots__ without TypeError:

Re: Python RPM package arch compatability

2006-10-18 Thread Fredrik Lundh
Christopher Taylor wrote: A quick question if I may. I'm running RHEL 4 on a x86_64 and I'm curious if any of the packages at http://www.python.org/download/releases/2.4/rpms/ would suite my setup. If they don't can I simply build from source and not overwrite /usr/bin/Python (for the

How to execute a linux command by python?

2006-10-18 Thread haishan chang
How to execute a linux command by python? for example: execute ls or useradd oracle Who can help me? thank you! -- http://mail.python.org/mailman/listinfo/python-list

Re: Flexable Collating (feedback please)

2006-10-18 Thread Ron Adam
[EMAIL PROTECTED] wrote: On Oct 18, 2:42 am, Ron Adam [EMAIL PROTECTED] wrote: I put together the following module today and would like some feedback on any obvious problems. Or even opinions of weather or not it is a good approach. ,,, def __call__(self, a, b): This allows

Re: Python RPM package arch compatability

2006-10-18 Thread Christopher Taylor
So just build it from source and use make altinstall instead? That simple huh? Will I need to do anything else to make sure things are put in their correct place? Respectfully, Christopher Taylor On 10/18/06, Fredrik Lundh [EMAIL PROTECTED] wrote: Christopher Taylor wrote: A quick question

Re: Image.draft -- what are the modes that I can use?

2006-10-18 Thread abcd
fredrik, in other posts you have mentioned the use of gifmaker. i have tried that with the following: I am using gifmaker.py from PIL v1.1.5 on python 2.4.1. CODE import ImageGrab, gifmaker seq = [] while keepOnGoing: im

Re: Save/Store whole class (or another object) in a file

2006-10-18 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: thanks for the reply,but unfortunately this does not work with the type of classes I am dealing with. When trying to pickle the class I get the following error: File /usr/lib/python2.4/copy_reg.py, line 76, in _reduce_ex raise TypeError(a class that defines

Re: MemoryError - IMAP retrieve self._sock.recv(recv_size)

2006-10-18 Thread Stephen G
Fredrik, Thanks for the response. I did see that, but having been dated 2005 I thought that it might have been patched. I am also sometimes getting the same problem with the urllib.py module. T his may have to do with the interaction between Python and the mobile optimization client that I

Re: Restart a Python COM Server

2006-10-18 Thread olsongt
[EMAIL PROTECTED] wrote: Hello all. I am desperately in need for you help guys. Here is the story: 1- I have created a small simple COM serve with python (along the lines read in Win32 Programming with python). 2- If I start the server and call a function from VBE everything works fine 3-

Re: a little about regex

2006-10-18 Thread Ant
Rob Wolfe wrote: ... def filter(adr):# note that filter is a builtin function also import re allow = re.compile(r'.*(?!\.com)\.my(|$)') # negative lookbehind deny = re.compile(r'.*\.com\.my(|$)') cnt = 0 if deny.search(adr): cnt += 1 if allow.search(adr): cnt

Re: How to execute a linux command by python?

2006-10-18 Thread Fredrik Lundh
haishan chang wrote: How to execute a linux command by python? for example: execute ls or useradd oracle Who can help me? start here: http://www.python.org/doc/lib/ /F -- http://mail.python.org/mailman/listinfo/python-list

Re: MemoryError - IMAP retrieve self._sock.recv(recv_size)

2006-10-18 Thread Fredrik Lundh
Stephen G wrote: I am hesitant to make any changes to the python libraries as I need to distribute these scripts with a standard Python install. well, you could at least check if the suggestions in that thread makes the problem go away... (if so, shipping a patched version with your program

Re: Save/Store whole class (or another object) in a file

2006-10-18 Thread Michele Simionato
[EMAIL PROTECTED] wrote: Hi, thanks for the reply,but unfortunately this does not work with the type of classes I am dealing with. When trying to pickle the class I get the following error: File /usr/lib/python2.4/copy_reg.py, line 76, in _reduce_ex raise TypeError(a class that

Dictionaries

2006-10-18 Thread Lad
How can I add two dictionaries into one? E.g. a={'a:1} b={'b':2} I need the result {'a':1,'b':2}. Is it possible? Thank you L. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to execute a linux command by python?

2006-10-18 Thread Fredrik Lundh
Fredrik Lundh wrote: start here: http://www.python.org/doc/lib/ make sure you skim though the *entire* list. when you've done that, see the process management section in the os module documentation (make sure to read the entire page before you decide which API to use), and also the

Re: Dictionaries

2006-10-18 Thread Simon Brunning
On 18 Oct 2006 08:24:27 -0700, Lad [EMAIL PROTECTED] wrote: How can I add two dictionaries into one? E.g. a={'a:1} b={'b':2} I need the result {'a':1,'b':2}. a={'a':1} b={'b':2} a.update(b) a {'a': 1, 'b': 2} -- Cheers, Simon B [EMAIL PROTECTED]

Re: doctest quiet again before exit how

2006-10-18 Thread p . lavarre
... every run of doctest after the first is verbose ... *** DocTestRunner.merge: '__main__' in both testers; summing outcomes. Another path to the same bug: import doctest print doctest.testfile(__file__, verbose=False) print doctest.testfile(__file__, verbose=False) Mystifiedly yours, rank

Re: Dictionaries

2006-10-18 Thread Gary Herron
Lad wrote: How can I add two dictionaries into one? E.g. a={'a:1} b={'b':2} I need the result {'a':1,'b':2}. Is it possible? Thank you L. Yes, use update. Beware that this modifies a dictionary in place rather than returning a new dictionary. a={'a':1} b={'b':2} a.update(b)

Re: Dictionaries

2006-10-18 Thread Tim Chase
How can I add two dictionaries into one? E.g. a={'a:1} b={'b':2} I need the result {'a':1,'b':2}. a.update(b) a {'a':1,'b':2} -tkc -- http://mail.python.org/mailman/listinfo/python-list

Re: Win32 python and excel macros

2006-10-18 Thread John Coleman
[EMAIL PROTECTED] wrote: Hi Experts, Looking for a very quick bit on of advice on how to make some python code run. I'm a newbie to both VBA and Python, so i apologise if this is very easy but i'm about to tear my hair out after googling for the last 3 days. I have written a large python

Re: Win32 python and excel macros

2006-10-18 Thread Mike P
Thanks for your advice on this matter, I'm actually using Excel 2003!! so it shows how much i know! i did manage to get the prog to run with the line xl.Application.Run(CTP.xla!sheet1.CTP) but it didn't do anything... i'm guessing it is along the lines of wht you were saying earlier about big

Re: Dictionaries

2006-10-18 Thread Boris Borcic
dict(a.items() + b.items()) Lad wrote: How can I add two dictionaries into one? E.g. a={'a:1} b={'b':2} I need the result {'a':1,'b':2}. Is it possible? -- http://mail.python.org/mailman/listinfo/python-list

Re: Dictionaries

2006-10-18 Thread Steven D'Aprano
On Wed, 18 Oct 2006 08:24:27 -0700, Lad wrote: How can I add two dictionaries into one? E.g. a={'a:1} b={'b':2} I need the result {'a':1,'b':2}. Is it possible? What should the result be if both dictionaries have the same key? a={'a':1, 'b'=2} b={'b':3} should the result be:

Re: Win32 python and excel macros

2006-10-18 Thread Mike P
After just running trying that update it hits the macro perfectly but hten i get an error message after i type in a couple of values.. as per below Traceback (most recent call last): File string, line 148, in ? File COMObject unknown, line 14, in Run File

Re: Image.draft -- what are the modes that I can use?

2006-10-18 Thread Brett Hoerner
abcd wrote: ... Are you sure you can't use VNC? An animated GIF based on full-screen grabs will be amazingly huge and have very low color quality at the same time. Installing VNC on Windows should take you about 30 seconds, honest. Or is this for some sort of project where you can't use

Install from source on a x86_64 machine

2006-10-18 Thread Christopher Taylor
Hello all, Being relatively new to linux I'm a little confused about what options I need to use to build python from source. Currently, I have python installed as part of the inital RHEL4 load located at /usr/bin/Python and /usr/bin/Python2.3 . Some of the files are located in

Re: Image.draft -- what are the modes that I can use?

2006-10-18 Thread abcd
Brett Hoerner wrote: Are you sure you can't use VNC? An animated GIF based on full-screen grabs will be amazingly huge and have very low color quality at the same time. Installing VNC on Windows should take you about 30 seconds, honest. Or is this for some sort of project where you can't

  1   2   3   >