Weekly Python Patch/Bug Summary

2005-01-23 Thread Kurt B. Kaiser
org/sf/1105706 opened by dcrosta null source chars handled oddly (2005-01-19) http://python.org/sf/1105770 opened by Reginald B. Charney bug with idle's stdout when executing load_source (2005-01-20) http://python.org/sf/1105950 opened by imperialfists os.stat int/float od

Re: add indexes on the fly to lists

2005-01-24 Thread Diez B. Roggisch
ip] = town Hope that makes it clear to you - look into the tutorial for a chapter about python data structures. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: add indexes on the fly to lists

2005-01-26 Thread Diez B. Roggisch
> If you want only "search and found" element, look dictionnary ; if you > want also to have the order, see the module set. Erg - no. Sets are mathematically defined as having no order. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: OT

2005-01-26 Thread Diez B. Roggisch
> However, i know for a fact that phr is _not_ a user at > sextans.lowell.edu. > > Is this a problem with my dns? Most probably - he shows up as [EMAIL PROTECTED] for me. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: 4suite XSLT thread safe ?

2005-01-26 Thread Diez B. Roggisch
art it, and some time later the result is there. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: 4suite XSLT thread safe ?

2005-01-26 Thread Diez B. Roggisch
this is Uche himself, I'm confident that this is not the case - modern OO-style apis associate state usually on a per-object base. And 4suite is heavily OO-styled. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: 4suite XSLT thread safe ?

2005-01-26 Thread Diez B. Roggisch
or.run(source))).start() # comment the following line to make things crash. time.sleep(5) threading.Thread(target=lambda: results.append(processor.run(source2))).start() time.sleep(5) print results -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: 4suite XSLT thread safe ?

2005-01-26 Thread Diez B. Roggisch
you can get a processor for one transformation, it should be safe to get another one in another thread for another transformation, as this is the preceived use case. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Why do look-ahead and look-behind have to be fixed-width patterns?

2005-01-28 Thread Diez B. Roggisch
y willing to do :) But I wanted to point out that there is a "real" technical reason for that, not just a lack of feature or willingness to implement one. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Proccess termination

2005-01-28 Thread Diez B. Roggisch
ve a second thread waiting for process termination - and sending the own process a signal. If I'm not mistaken, that will be propagated to the main thread. All this is meant to be running on unix - not sure how thinks work out on windows. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: a sequence question

2005-01-28 Thread Diez B. Roggisch
l = [1,2,3,4] for a, b in zip(l[::2], l[1::2]): print a,b -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Dynamic class methods misunderstanding

2005-01-28 Thread Diez B. Roggisch
lf, method): self.m = new.instancemethod(method, self, Test) def m(self): print self Test(m).m() -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Installing Numeric with ATLAS and LAPACK

2005-01-28 Thread Diez B. Roggisch
> Could someone please provide instructions for install Numeric > with ATLAS and LAPACK? No idea - but telling us what os and versions of python and numeric you use might make others comment on that. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Weekly Python Patch/Bug Summary

2005-01-29 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 280 open ( +7) / 2747 closed ( +1) / 3027 total ( +8) Bugs: 803 open ( +6) / 4799 closed (+10) / 5602 total (+16) RFE : 167 open ( +1) / 141 closed ( +0) / 308 total ( +1) New / Reopened Patches __ tarfile.E

Re: variable declaration

2005-01-31 Thread Diez B. Roggisch
def schnarz(self): pass So that makes class statements not as declarative as they are in languages like java. So to sum it up (for me at least): things like metaclasses, decorators and so on make me write code more declarative - if they are a declaration in the strict sense, I don't bot

Re: type of simple object

2005-02-01 Thread Diez B. Roggisch
> Can you tell me how can I check if an object is a sequence (you are > right, this is actually what I want)? read the docs for the module "types." -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Next step after pychecker

2005-02-01 Thread Diez B. Roggisch
y don't force you to specify a type, but a variable has an also variable type, that gets inferned upon the usage and is then fixed. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Awkwardness of C API for making tuples

2005-02-01 Thread Diez B. Roggisch
f I'm overlooking something obvious, please clue me in! If you already know _how_ to create a function like PyTuple_FromArray() - why don't you define it yourself and use it? -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Save the Canvas!

2005-02-02 Thread Diez B. Roggisch
Sean McIlroy wrote: > I'd like to be able to save a Tkinter Canvas in a format other than > postscript (preferably gif). Is there a tool out there for > accomplishing that? Any help will be much appreciated. pnmtools - for converting. -- Regards, Diez B. Roggisch -- http://m

Re: Python Code Auditing Tool

2005-02-02 Thread Diez B. Roggisch
es the work for annotating all functions/methods properly. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Code Auditing Tool

2005-02-02 Thread Diez B. Roggisch
one language which comes closer is Eiffel which has require and ensure > clauses on every method (following Meyer's Programming by contract > philosophy). Full ack again. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: access to serial port

2005-02-02 Thread Diez B. Roggisch
ys: Google is your friend: google: python serial port -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: XML with Unicode: what am I doing wrong?

2005-02-02 Thread Diez B. Roggisch
needs a string will result in a conversion - which fails because of the ascii encoding. Do this: parser.Parse(html.encode('utf-8')) -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Python for S60 mentioned in a mainstream Finnish e-news website

2005-02-02 Thread Diez B. Roggisch
#x27;t think that in the end, things are much different - just a layer of indirection for a jump target. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: ModPython: passing variables between handlers?

2005-02-03 Thread Diez B. Roggisch
ring u in req like this: def authenhandler(): # Store information about the user in an object req.u = new User(req.user, pass) -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Python-list Digest, Vol 17, Issue 54

2005-02-03 Thread Diez B. Roggisch
unless req is a global > variable?). > > Do you have any other suggestions as to how this might be implemented? If the code you showed us _is_ what you use - then req seems to be a global variable. Otherwise it won't work. -- Regards, Diez B. Roggisch -- http://mail.python.

Re: Calling a method using an argument

2005-02-03 Thread Diez B. Roggisch
def test(self,arg): return getattr(self, arg) -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling a method using an argument

2005-02-03 Thread Diez B. Roggisch
Diez B. Roggisch wrote: > def test(self,arg): > return getattr(self, arg) > Oops, missed the calling: def test(self,arg): return getattr(self, arg)() If you have more args, do this: def test(self, *args): return getattr(self, args[0])(*args[1:]) -- Regards, Diez B.

Re: Calling a method using an argument

2005-02-03 Thread Diez B. Roggisch
> > def test(self, method, *args): > return getattr(self, method)(*args) Yup, forgot abount that. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Weekly Python Patch/Bug Summary

2005-02-03 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 284 open ( +4) / 2748 closed ( +1) / 3032 total ( +5) Bugs: 804 open ( +1) / 4812 closed (+13) / 5616 total (+14) RFE : 167 open ( +0) / 142 closed ( +1) / 309 total ( +1) New / Reopened Patches __ Patch for

Re: Regular expression match objects - compact syntax?

2005-02-04 Thread Diez B. Roggisch
return not self.m is None Then you can do m = Matcher(rex) if m.match(line): print m.m Of course you can enhance the class mather so that all methods it does not define by itself are delegated to self.m, which would be more convient. But I'm currently too lazy to write that down :) --

Re: Alternative to standard C "for"

2005-02-05 Thread Diez B. Roggisch
there other good ways for this simple problem? Generators? Use xrange(). It computes the values as they are needed - not an entire list. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: oddness in super()

2005-06-18 Thread Diez B. Roggisch
Michael P. Soulier wrote: Why the difference? Is Python portability overrated? Is this a bug? Certainly a bug - but not in python. The super-method works for new-style classes only. The attached script reproduces your observed behaviour. So kit seems that whatever toolkit you use, it uses n

Re: calling subclass constructor question

2005-06-19 Thread Diez B. Roggisch
In Han Kang wrote: > Hello everyone and thank you for being such a good community. > > Anyway, I was wondering...I have an super class which is the superclass > for 5 other classes. However, I want to be able to call the subclass > constructors from the super class. Is this possible? If you h

Re: functions with unlimeted variable arguments...

2005-06-19 Thread Diez B. Roggisch
Xah Lee wrote: > oops... it is in the tutorial... sorry. > > though, where would one find it in the python reference? > i.e. the function def with variable/default parameters. > > This is not a rhetorical question, but where would one start to look > for it in the python ref? > a language is use

Re: references/addrresses in imperative languages

2005-06-19 Thread Diez B. Roggisch
> > In hindsight analysis, such language behavior forces the programer to > fuse mathematical or algorithmic ideas with implementation details. A > easy way to see this, is to ask yourself: how come in mathematics > there's no such thing as "addresses/pointers/references". Mathematics also has no

Re: Embedded Systems Python?

2005-06-20 Thread Diez B. Roggisch
Dennis Clark wrote: > I'm a bit of a newb when it comes to Python, is there anyone with experience > compiling it on Linux platforms that can offer me pointers to try this out > myself? Seatch for cross-compiling python patches. I'm working on an XScale255 platform with python2.2 and soon 2.3 -

Re: Python and encodings drives me crazy

2005-06-20 Thread Diez B. Roggisch
Oliver Andrich wrote: > Well, I narrowed my problem down to writing a macroman or cp850 file > using the codecs module. The rest was basically a misunderstanding > about codecs module and the wrong assumption, that my input data is > iso-latin-1 encode. It is UTF-8 encoded. So, curently I am at the

Weekly Python Patch/Bug Summary

2005-06-21 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 338 open ( +0) / 2866 closed ( +5) / 3204 total ( +5) Bugs: 914 open ( +5) / 5060 closed (+13) / 5974 total (+18) RFE : 188 open ( +0) / 170 closed ( +0) / 358 total ( +0) New / Reopened Patches __ update th

Re: Odd slicing behavior?

2005-06-22 Thread Diez B. Roggisch
Dave Opstad wrote: > So given the equality of their slice representations, why do the v2[::] > and v2[0:10:1] assignments behave differently? My reading of section > 5.3.3 of the manual suggests that these should behave the same. > > If I'm just not seeing something obvious, please let me know!

Re: Odd slicing behavior?

2005-06-22 Thread Diez B. Roggisch
Dave Opstad wrote: > In article <[EMAIL PROTECTED]>, > "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > >>So - the rationale seems to be: "When using slice-assignment, a form >>like l[a:b:c] imposes possibly a non-continous section in l, fo

Re: Is this a bug? I don't know where to start

2005-06-22 Thread Diez B. Roggisch
jim bardin wrote: > Is this a python bug, or do i not understand > something? > > http://www.linuxquestions.org/questions/showthread.php?s=&threadid=336118 > > It seems to me that this should output each value > once, but i get some seemingly random duplicates. Your targets contains duplicates -

Re: Looking For Geodetic Python Software

2005-06-23 Thread Diez B. Roggisch
Tim Daneliuk wrote: > Casey Hawthorne wrote: >> >> Do your planes fly over the earth's surface or through the ground? > > > Why do you presume this has anything to do with airplanes? > That was supposed to be a funny remark regarding that your "straight-line-distance" makes no sense at all -

Re: Looking For Geodetic Python Software

2005-06-23 Thread Diez B. Roggisch
> For spherical earth, this is easy, just treat the 2 locations as > vectors whose origin is at the center of the earth and whose length is > the radius of the earth. Convert the lat-long to 3-D rectangular > coordinates and now the angle between the vectors is > arccos(x dotproduct y). The over

Re: newbie - modules for jython (under grinder 3) ?

2005-06-23 Thread Diez B. Roggisch
bugbear wrote: > I'm just trying to use Grinder 3 to beat > up my http-app. > > Grinder 3 comes with its own jython.jar. > > Some of the sample scripts: > http://grinder.sourceforge.net/g3/script-gallery.html > use import statements that don't work for me. > > Reading around, these are reference

Re: newbie - modules for jython (under grinder 3) ?

2005-06-23 Thread Diez B. Roggisch
OK - of course this means I'll have to tell Grinder to > use "my" Jython, not "its" Jython. > > Hopefully that's well documented :-) If they use 2.1 - which you should hope :) - teaching it shouldn't be much more as issuing -Dpython.home= as argument to the VM. Diez -- http://mail.python.o

Re: OT: Re: Looking For Geodetic Python Software

2005-06-24 Thread Diez B. Roggisch
Dennis Lee Bieber wrote: > Of course, the great circle arc, except for paths with start/end > latitude of 0 (equator) or with (lon1 - lon2) = 0, require a constant > variation in compass heading -- and I don't think IFR currently make use > of great circle arcs (and GPS to maintain them). I'

Re: Getting binary data out of a postgre database

2005-06-24 Thread Diez B. Roggisch
ata? I tried > PgSQL.PgUnQuoteBytea(rec[0]), but that didn't work. What does print rec[0] give you? -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: Re: Looking For Geodetic Python Software

2005-06-25 Thread Diez B. Roggisch
> The article implied that the automated system would allow for > /shorter paths/ (the shortest path is the great circle, so this > statement indicates that trans-oceanic flights are not using great > circle/GPS routing). Most likely, the flights are using 50 minute "plumb > lines", with a he

Re: accessing object attribute as parameter

2005-06-26 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hello, > > I would like to access object parameter / variable from a function. > > For example : > class A: > def __init__(self, x,y): > self.x = x > self.y = y > > in the main program, I have a list of obj A: > L = [A(1,2), A(2,3)] > > Now I need to acces

Re: Getting binary data out of a postgre database

2005-06-27 Thread Diez B. Roggisch
projecktzero wrote: > Sorry for the late reply. I didn't check the group/list over the > weekend. > > Anyway, I added a print rec[0] just after the fetchone. Then I ran it > from the command line, and it spewed a bunch of binary gibberish nearly > locking up Putty. > > To me, it seems like it's c

Weekly Python Patch/Bug Summary

2005-06-29 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 344 open ( +6) / 2875 closed ( +9) / 3219 total (+15) Bugs: 897 open (-17) / 5094 closed (+34) / 5991 total (+17) RFE : 191 open ( +3) / 170 closed ( +0) / 361 total ( +3) New / Reopened Patches __ fileinput

Re: how to shrink a numarray array?

2005-06-30 Thread Diez B. Roggisch
Qiangning Hong wrote: > To draw a large array of data on a small panel, I need to shrink it to a > given size. e.g: > > To draw numarray.arange(1) on a panel of width of 100, I only need > to draw the points of (0, 100, 200, 300, ...) instead of (0, 1, 2, ...). > So I need a method to shrink

Re: website catcher

2005-07-03 Thread Diez B. Roggisch
jwaixs wrote: > Thank you, but it's not what I mean. I don't want some kind of client > parser thing. But I mean the page is already been parsed and ready to > be read. But I want to store this page for more use. I need some kind > of database that won't exit if the cgi-bin script has finished. Thi

Re: website catcher

2005-07-03 Thread Diez B. Roggisch
jwaixs wrote: > If I should put the parsedwebsites in, for example, a tablehash it will > be at least 5 times faster than just putting it in a file that needs to > be stored on a slow harddrive. Memory is a lot faster than harddisk > space. And if there would be a lot of people asking for a page al

Re: How to dump an interpreter image?

2005-07-03 Thread Diez B. Roggisch
VansMll wrote: > Hi, is it possible to save a state of the python interpreter to disk and > load it later? Should be doable in stackless python. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: How do you program in Python?

2005-07-03 Thread Diez B. Roggisch
anthonyberet wrote: > My question isn't as all-encompassing as the subject would suggest... > > I am almost a Python newbie, but I have discovered that I don't get > along with IDLE, as i can't work out how to run and rerun a routine > without undue messing about. > > What I would really like i

Re: Using regular expressions in internet searches

2005-07-03 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > What is the best way to use regular expressions to extract information > from the internet if one wants to search multiple pages? Let's say I > want to search all of www.cnn.com and get a list of all the words that > follow "Michael." > > (1) Is Python the best language

Re: f*cking re module

2005-07-04 Thread Diez B. Roggisch
jwaixs wrote: > arg... I've lost 1.5 hours of my precious time to try letting re work > correcty. There's really not a single good re tutorial or documentation > I could found! There are only reference, and if you don't know how a > module work you won't learn it from a reference! > > This is the

Weekly Python Patch/Bug Summary

2005-07-05 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 348 open ( +4) / 2879 closed ( +4) / 3227 total ( +8) Bugs: 898 open ( +1) / 5103 closed ( +9) / 6001 total (+10) RFE : 193 open ( +2) / 170 closed ( +0) / 363 total ( +2) New / Reopened Patches __ tarfile.p

Weekly Python Patch/Bug Summary

2005-07-11 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 349 open ( +1) / 2880 closed ( +1) / 3229 total ( +2) Bugs: 897 open ( -1) / 5119 closed (+16) / 6016 total (+15) RFE : 194 open ( +1) / 170 closed ( +0) / 364 total ( +1) New / Reopened Patches __ PEP 343 d

Weekly Python Patch/Bug Summary

2005-07-20 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 350 open ( +1) / 2882 closed ( +2) / 3232 total ( +3) Bugs: 889 open ( -8) / 5141 closed (+22) / 6030 total (+14) RFE : 189 open ( -5) / 178 closed ( +8) / 367 total ( +3) New / Reopened Patches __ Add unico

Weekly Python Patch/Bug Summary

2005-07-28 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 357 open ( +7) / 2885 closed ( +3) / 3242 total (+10) Bugs: 898 open ( +9) / 5144 closed ( +3) / 6042 total (+12) RFE : 191 open ( +2) / 178 closed ( +0) / 369 total ( +2) New / Reopened Patches __ shutil.co

Weekly Python Patch/Bug Summary

2005-08-02 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 354 open ( -3) / 2888 closed ( +3) / 3242 total ( +0) Bugs: 909 open (+11) / 5152 closed ( +8) / 6061 total (+19) RFE : 191 open ( +0) / 178 closed ( +0) / 369 total ( +0) Patches Closed __ PEP 342 Generator enhance

Weekly Python Patch/Bug Summary

2005-08-10 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 352 open ( -2) / 2896 closed ( +8) / 3248 total ( +6) Bugs: 913 open ( +4) / 5162 closed (+10) / 6075 total (+14) RFE : 191 open ( +0) / 178 closed ( +0) / 369 total ( +0) New / Reopened Patches __ compiler

Re: Using globals with classes

2005-08-12 Thread Diez B. Roggisch
> Is there a way to make a Python function "remember" the values of certain > variables ? Or use fortran 95 like use module, only : varname, type of > within a def ? I'm not sure what you are trying to do here - but it seems to me that you are not properly designing your application. You really s

Re: Using globals with classes

2005-08-12 Thread Diez B. Roggisch
> Is there a way to make a Python function "remember" the values of certain > variables ? Or use fortran 95 like use module, only : varname, type of > within a def ? I'm not sure what you are trying to do here - but it seems to me that you are not properly designing your application. You really s

Re: Testing for presence of arguments

2005-08-17 Thread Diez B. Roggisch
I don't have the details ready - but in the ASPN cookbook are recipes to e.g. figure insied a function f out how many results the caller of f expects - and act accordingly. This boils down to inspect the call-stack. So it ceratinly is possible. However, I'd say it is almost 100% a design flaw. Or

Re: Testing for presence of arguments

2005-08-17 Thread Diez B. Roggisch
> I am writing some code for a measurement application (would have used > fortran 95 if a library had been available for linux-gpib, but python is a > lot friendlier than C without the irritating and utterly pointless braces) > where one of the input parameters for the GPIB command is optional, and

Re: Really virtual properties

2005-08-18 Thread Diez B. Roggisch
I don't think so - the reason is that property() is evaluated in the baseclass, and stores a callable, not a name. the only thing you could do is either - create a level of indirection, using lambda, to force the lookup: x = property(lamda self: self.get_x()) - use a metaclass, that tries to

Re: Really virtual properties

2005-08-18 Thread Diez B. Roggisch
I don't think so - the reason is that property() is evaluated in the baseclass, and stores a callable, not a name. the only thing you could do is either - create a level of indirection, using lambda, to force the lookup: x = property(lamda self: self.get_x()) - use a metaclass, that tries to

Re: Sandboxes

2005-08-20 Thread Diez B. Roggisch
> Would this sufficient? Are there any drawbacks or giant gaping holes? > I'm anticipating that I'd also need to block 'exec' and 'eval' to > prevent an import from being obfuscated past the pre-parse. > > Or is this a hopeless cause? Yes. There have been numerous discussions about this, and t

Re: Version of TAR in tarfile module? TAR 1.14 or 1.15 port to Windows?

2005-08-20 Thread Diez B. Roggisch
Claudio Grondi wrote: > remember. I work in a Windows command shell > (DOS-box) and mount says: > j: on /cygdrive/j , but I don't know how to write > the entire path > "j:\o\archives\images\dump.tar", > so that the file can be found by tar.exe and > unpacked to "i:\images" . > tar.exe --extract --d

Re: Sanitizing untrusted code for eval()

2005-08-22 Thread Diez B. Roggisch
> Does anyone know of any other "gotchas" with eval() I have not found? Or > is eval() simply too evil? Yes - and from what I can see on the JSON-Page, it should be _way_ easier to simply write a parser your own - that ensures that only you decide what python code gets called. Diez _ -- http:

Re: Running multiple console processes and watching their output

2005-08-22 Thread Diez B. Roggisch
Yoav wrote: > I need to run multiple console apps in the background and to watch their > output. I have no idea if this is possible, and I don't even know where > to start looking. The processes are watchers, meaning that they watch > folders and mail boxes and do operations on items in them . E

Weekly Python Patch/Bug Summary

2005-08-22 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 352 open ( +0) / 2898 closed ( +2) / 3250 total ( +2) Bugs: 926 open (+13) / 5177 closed (+15) / 6103 total (+28) RFE : 190 open ( -1) / 179 closed ( +1) / 369 total ( +0) New / Reopened Patches __ fix smtpl

Re: Sanitizing untrusted code for eval()

2005-08-22 Thread Diez B. Roggisch
> Another thing you can do is use the compile message and then only allow > certain bytecodes. Of course this approach means you need to implement > this in a major version-dependent fashion, but it saves you the work of > mapping source code to python. Eventually there will be another form > ava

Re: What's the difference between built-in func getattr() and normal call of a func of a class

2005-08-23 Thread Diez B. Roggisch
this case) easier to read/write/understand. There are others - e.g. list comprehensions or a < b < c. Regards, Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: where does __class__ come from?

2005-08-23 Thread Diez B. Roggisch
> Where does __class__ come from, what does it mean and what else is > being hidden? > > I am used to using dir(...) to figure out what I can play with. > Clearly that does not always work... :-( Your question has benn answered - let me just add this from the dir()-docs: Note: Because dir() is s

Re: Sandboxes

2005-08-23 Thread Diez B. Roggisch
> Basically I just want a language to allow users to write macros, > interact with application objects, set property values, sequence > operations, supporting loops and branch logic and so forth. > > Something along the lines of a drawing program that allowed uers to > write and/or download scr

Re: how to deal with space between numbers

2005-08-23 Thread Diez B. Roggisch
> Thanks a lot for your valuable answer, i like the way you code , but i > would like to use my own, so if it is possible for you and if you have > time, please could you fix my code, so that i can do what i want. > Because i am using the this out put to another one , and i have the same > proble

Re: Reading just a few lines from a text file

2005-08-23 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Right now my code reads as follows: > > infile=file(FileName) > for line in reversed(infile.readlines()): #Search from the bottom up Not sure if python does some tricks here - but for me that seems to be uneccesary shuffling around of data. Better do for line in reve

Re: where does __class__ come from?

2005-08-24 Thread Diez B. Roggisch
Adriaan Renting wrote: > You might find the chapter 3.3 (in my python 2.3.4, it's "Special Method > names") in the reference manual useful, it is the only place I have found > sofar that describes most of these special methods. It does however not > contain __class__. I don't know where in the

Re: Warning when doubly linked list is defined gloablly

2005-08-24 Thread Diez B. Roggisch
chand wrote: > In my api.py file 'g_opt_list' is defined globally > g_opt_list =[[],[],[],[],[],[],[]] > > I am using this global list in the fucntion > > def function (): > gloabl g_opt_list This is obviously wrong and not the code you wrote, global being written horribly wrong - which shou

Re: variable hell

2005-08-25 Thread Diez B. Roggisch
Nx wrote: > I am unpacking a list into variables, for some reason they need to be > unpacked into variable names like a0,a1,a2upto aN whatever is > in the list. Explain this "some reason". This smells, and the way to go would be to use a dict mapping a_n to whatever is in the list - not cr

Re: DOM text

2005-08-26 Thread Diez B. Roggisch
Richard Lewis wrote: > > I admit I haven't tried very much code yet, but I'm not sure how I'm > going to handle situations like: the user wants to insert a link in the > middle of a paragraph. How can I use the DOM to insert a node into the > middle of some text? Am I right in thinking that the DO

Re: classes and list as parameter, whats wrong?

2005-08-26 Thread Diez B. Roggisch
Dirk Zimmermann wrote: > But still, it is not absolutely clear for me, what is going on. So, at > least just for my understanding: The parameter LL is created just once > for the whole class and not for the object Yes. And because a lists are mutable, you can alter that one instance of the list

Re: need a little help with time

2005-08-26 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hey there. > i have a time string (created with strftime) then read from a file, > i am having some trouble understanding how to get the difference > between times. > i know i can structime(timestring) and get a time value, but i dont > know how to manipulate it. > > bas

Re: Modify a C++ instance from the embed python interpreter

2005-08-27 Thread Diez B. Roggisch
Wezzy wrote: > Hi, is there a tool that automatically expose an object to python? i > have an instance of a C++ (or ObjC) object and i want to pass it to the > embed interpreter that runs inside my program. > Python code have to call c++ method and register some callback. > > I know that swig help

Re: Python built email message doesn't support OutLook Express

2005-08-29 Thread Diez B. Roggisch
That is not what Sybren requested - we need the message text. If you send html, make sure your paragraphs are html paragraphs (enclosed in -tags) and not pure whitespace, as html ignores these. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: NYC Opening

2005-08-29 Thread Diez B. Roggisch
Kevin McGann wrote: > -Expert Java or C++ Now why exactly do you post that in c.l.python? > THEY ARE LOCATED IN NEW YORK, THIS IS FULL-TIME ONLY, WILL NOT CONSIDER > ANYONE FROM OUTSIDE THE US! THIS TEAM IS AN ELITE TEAM, YOU BETTER BE > GOOD I'm pretty sure you've some spelling wrong here,

Re: Adding bound methods dynamically... CORRECTED

2005-09-01 Thread Diez B. Roggisch
> > Yes, but rather than going through the contortions you do to bind a > new method into place, why not make the method in question act as a > proxy for the real method? After all, with first-class functions, > that's easy. Because you don't have to write that proxy. Pure lazyness :) Diez --

Re: cgi, reusing html. common problem?

2005-09-01 Thread Diez B. Roggisch
John M. Gabriele wrote: > I'm putting together a small site using Python and cgi. > > (I'm pretty new to this, but I've worked a little with > JSP/servlets/Java before.) > > Almost all pages on the site will share some common (and > static) html, however, they'll also have dynamic aspects. > I'm

Weekly Python Patch/Bug Summary

2005-09-01 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 903 open (+551) / 5222 closed (+2324) / 6125 total (+2875) Bugs: 903 open (-23) / 5222 closed (+45) / 6125 total (+22) RFE : 187 open ( -3) / 184 closed ( +5) / 371 total ( +2) New / Reopened Patches __ PEP

Re: How to handle video & alpha channel

2005-09-02 Thread Diez B. Roggisch
Mic wrote: > I'm looking for a way to build a little player (if possibile with > python ) that could handle common video file formats (mpeg or other) > with above an image with alpha channel (png or other) > > Is there a way to make this with python and available libs (PIL etc)? Check out pym

Re: python logo

2005-09-03 Thread Diez B. Roggisch
> "A foolish consistency is the hobgoblin of little minds." > - Ralph Waldo Emerson > > Tim C > > PS Yes, I know that I shouldn't feed the trolls (or hobgoblins), but I > invoke Screwtape's Defence: other people who should know better don't > seem to be able to resist the temptation ei

Re: Command config, quitting, binary, Timer

2005-09-04 Thread Diez B. Roggisch
> ! import Tkinter > ! def dogo(): > ! while 1: > ! b.config(command=lambda:None) > ! root = Tkinter.Tk() > ! b = Tkinter.Button(root, text="Go", command=dogo) > ! b.pack() > ! root.mainloop() I guess tkinter has to keep a name-reference pair (some d

regular expression unicode character class trouble

2005-09-04 Thread Diez B. Roggisch
Hi, I need in a unicode-environment the character-class set("\w") - set("[0-9]") or aplha w/o num. Any ideas how to create that? And what performance implications do I have to fear? I mean I guess that the characterclasses aren't implementet as sets, but as comparison-function that compares a

Re: Assigning 'nochage' to a variable.

2005-09-04 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Has anyone else felt a desire for a 'nochange' value > resembling the 'Z'-state of a electronic tri-state output? No. but if you must, you can emulate that using properties or __getattr__/__setattr__- of course then limited to classes, but writen c.var1 instead of var1

Re: regular expression unicode character class trouble

2005-09-05 Thread Diez B. Roggisch
Steven Bethard wrote: > I'd use something like r"[^_\d\W]", that is, all things that are neither > underscores, digits or non-alphas. In action: > > py> re.findall(r'[^_\d\W]+', '42badger100x__xxA1BC') > ['badger', 'x', 'xxA', 'BC'] > > HTH, Seems so, great! Diez -- http://mail.python.org/ma

<    1   2   3   4   5   6   7   8   9   10   >