Re: How can I know the name of "caller"

2007-06-19 Thread gerrit . holl
On Jun 19, 10:50 pm, Stefan Sonnenberg-Carstens <[EMAIL PROTECTED]> wrote: > billiejoex schrieb: > > ...(if it is possible) how can I get, from method "called", the name > > of function/method that called it (in this case "caller")? > inspect.stack is your friend ;-) If you start doing such thing

Re: Is there a way to get utf-8 out of a Unicode string?

2006-10-29 Thread Gerrit Holl
Hei, On 2006-10-30 08:25:41 +0100, thebjorn wrote: > def unfk(s): > return eval(repr(s)[1:]).decode('utf-8') > > i.e. chopping off the u in the repr of a unicode string, and relying on > eval to interpret the \xHH sequences. > > Is there a less hack'ish way to do this? Slightly lack hac

Re: A Comparison Of Dynamic and Static Languiges

2006-10-21 Thread Gerrit Holl
On 2006-10-21 20:41:42 +0200, Scott M. wrote: > Also, widely posting your real (unaltered) email address in forums like this > is a sure way to get noticed by spammers. This newsgroup is mirrored by a mailing-list, so many people use their real address. The solution to spam is spamfiltering (spam

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=[] > > >

Re: Best IDE?

2006-10-13 Thread Gerrit Holl
On 2006-10-13 16:31:37 +0200, Ahmer wrote: > Subject: Best IDE? cat > foo.py > How much does it cost? 0 -- http://mail.python.org/mailman/listinfo/python-list

Re: Motions.

2006-10-11 Thread Gerrit Holl
On 2006-10-11 00:26:38 +0200, Dr. Pastor wrote: > I would like to track the motions of > small birds in short (20-30sec) .avi films. > What tool-set/programs would be wise to use? > Thanks for any guidance. I'd use PIL with numpy and subtract a birdless background picture from each picture. Make t

Re: Using Gnutar to remove a list of files

2006-10-10 Thread Gerrit Holl
On 2006-10-10 14:35:30 +0200, [EMAIL PROTECTED] wrote: > Hi folks, I've got a question for yas. I'm trying to write code that > will open up a gzipped tar file using gnutar, and copy the list of > files(including their directories) to a list variable in python. From > there, I want to go through

Re: file system iteration

2006-10-09 Thread Gerrit Holl
On 2006-10-09 14:45:35 +0200, rick wrote: > import os.path > > paths = [] > > if os.path.isdir('A:/'): > paths.append('A:/') > > if os.path.isdir('B:/'): > paths.append('B:/') > > ... > > That's a kludge, but it works OK. I'm sure WMI may have a function that > returns mounted volumes

Re: printing variables

2006-10-06 Thread Gerrit Holl
On 2006-10-06 04:50:33 +0200, [EMAIL PROTECTED] wrote: > say i have variables like these > > var1 = "blah" > var2 = "blahblah" > var3 = "blahblahblah" > var4 = "" > var5 = "...".. > > bcos all the variable names start with "var", is there a way to > conveniently print those variables out... >

Re: PEP 358 and operations on bytes

2006-10-04 Thread Gerrit Holl
On 2006-10-04 05:10:32 +0200, John Machin wrote: > > - str methods endswith, find, partition, replace, split(lines), > > startswith, > > - Regular expressions > > > > I think those can be useful on a bytes type. Perhaps bytes and str could > > share a common parent class? They certain

PEP 358 and operations on bytes

2006-10-03 Thread Gerrit Holl
on parent class? They certainly share a lot of properties and possible operations one might want to perform. kind regards, Gerrit Holl. -- My first English-language post ever was made to this newsgroup: http://groups.google.com/group/comp.lang.python/msg/f957acf785ddfb71 :) -- http://mail.pyt

Re: hello, I want to change n bytes of a binary file

2005-11-01 Thread Gerrit Holl
could ildg wrote: > > b = encrypt(a) > > Thank you~~,but where is the encrypt defined? > I suppose it's left as an exercise for the reader. Gerrit. -- Temperature in Kiruna, Lappland, Sweden: Tue Nov 1 15:35:25 2005 [UT] 2.6°C -- http://mail.python.org/mailman/listi

Re: your mail

2005-10-17 Thread Gerrit Holl
Finn Waldrip wrote: > X-Spambayes-Classification: unsure; 0.242 > > > 404 Not Found > > Not Found > The requested URL was not found on this server. > > Apache/1.3.31 > How can my poor Spambayes ever make sense of this? Gerrit. -- Temperature in Luleå, Norrbotten, Sweden: | Current tempera

Re: Problems with properties

2005-10-14 Thread Gerrit Holl
Michael Schneider wrote: > Could someone please point out my error, I have dents in my forehead > for this one. > -- > > from unittest import TestCase > import unittest Here you need to add: __metaclass__ = type this will make you

Re: Well written open source Python apps

2005-10-14 Thread Gerrit Holl
Ben wrote: > Could anyone suggest an open source project that has particularly well > written Python? I am especially looking for code that people would > describe as "very Python-ic". (Not trying to start any kind of war - > just wanted some good examples of a well written Python app to read.)

Re: Class methods

2005-10-05 Thread Gerrit Holl
Laszlo Zsolt Nagy wrote: > >Oh man, it has been a long time I have read such an disturbing question. > > > >RTMF here: http://docs.python.org/lib/built-in-funcs.html#l2h-14 > > > > > I feel I was a bit harsh. Of course, those posts do keep the Google count for the famous four-letter-abbreviatio

Re: A Moronicity of Guido van Rossum

2005-10-01 Thread Gerrit Holl
Tony Meyer wrote: > X-Spambayes-Classification: ham; 0.008 > > On 30/09/2005, at 10:56 PM, Gerrit Holl wrote: > > Tony Meyer wrote: > >> X-Spambayes-Classification: ham; 0.048 > > Unless I'm misreading things, that's *my* message that scored 0.048 > (

Re: A Moronicity of Guido van Rossum

2005-09-30 Thread Gerrit Holl
Tony Meyer wrote: > X-Spambayes-Classification: ham; 0.048 > X-Spambayes-Evidence: '*H*': 0.90; '*S*': 0.00; 'bug.': 0.07; 'flagged': > 0.07; > "i'd": 0.08; 'bayes': 0.09; 'from:addr:ihug.co.nz': 0.09; > 'really,': 0.09; 'cc:no real name:2**0': 0.14; > 'from:addr:t-meyer': 0.16;

Re: A Moronicity of Guido van Rossum

2005-09-29 Thread Gerrit Holl
Xah Lee wrote: > ...What the fuck is the former? > ...What the fuck would anyone to > ...]”, is rather inane, as you can now see. > > ...What the fuck does it mean... > ...you begin to write things like Java... Can you please alter the tone of your voice? Gerrit. -- Temperature in Luleå, Norrb

Re: Documenting properties

2005-09-27 Thread Gerrit Holl
Paul McNett wrote: > > Whatever is preferred, what's the upside/downsides of the two beyond > > what I just explained? > > Nothing really, but something handy to keep in mind is that the string > literal ("""x""") can be used to block out huge sections of code during > testing, where you'd have to

Re: New-style classes questions

2005-09-25 Thread Gerrit Holl
Diez B. Roggisch wrote: > > What is the reason for allowing both styles? (backwards compatibility??) > > yes. Note that there is another way to create new-style classes: __metaclass__ = type before the first class definition: >>> class Foo: pass ... >>> type(Foo) >>> __metaclass__ = type >>>

Programming languages "national brotherhood week"

2005-09-24 Thread Gerrit Holl
Hi, I have once seen a variant of "national brotherhood week" with programming languages; 'all the python folk hate alle the perl folk and all the ... hate all the ... and everybody hates Java', or something like that, but I can't find it anymore. Does anyone remember it and is anyone able to find

Re: Free seminar on domain-specific modeling

2005-09-19 Thread Gerrit Holl
Martijn Iseger wrote: > Domain-specific modeling makes software development 5-10 times faster than > approaches based on UML or MDA. > It accelerates development and reduces complexity by automatically generating > full code from higher-abstraction design models. > Learn from speakers Juha-Pekka

Re: defining __repr__

2005-09-15 Thread Gerrit Holl
sven wrote: > i'd like to define __repr__ in a class to return the standardrepr > a la "<__main__.A instance at 0x015B3DA0>" > plus additional information. > how would i have to do that? > how to get the standardrepr after i've defined __repr__? >>> object.__repr__(4) '' Gerrit. -- Temperature

Re: pre-PEP: Object-oriented file module

2005-08-27 Thread Gerrit Holl
Kenneth McDonald wrote: > Subject: pre-PEP: Object-oriented file module Please have a look at http://topjaklont.student.utwente.nl/creaties/path/pep-.html if you haven't done so already. Gerrit. -- Temperature in Luleå, Norrbotten, Sweden: | Current temperature 05-08-27 22:20:00 11.8 de

Re: [perl-python] Python documentation moronicities (continued)

2005-04-12 Thread Gerrit Holl
Ivan Van Laningham wrote: > Richie Hindle wrote: > > > > [Xah] > > > motherfucking ... fucking ... fucking ... fucking ... fuck ... fucking > > > fucking ... fucking ... mother fucking ... fucking ... piece of shit ... > > > motherfucking ... fucking ... fucking ... big asshole ... masturbation ..

Re: help with getting selection from wxChoice with out after it has changed

2005-03-29 Thread Gerrit Holl
This is a SyntaxError. You want to enclose the dots with '' marks as well, like this: '@'.join(['.'.join(['fred', 'dixon']), '.'.join(['gmail', 'com'])]) regards, Gerrit Holl. -- Weather in Twenthe, Netherlands 29/03 10

Re: ANN: 2005 International Obfuscated Ruby Code Contest (IORCC)

2005-03-20 Thread Gerrit Holl
> > > Dear Rubyists, Perlists, Shellists, Cists and Hackers, What is this doing on comp.lang.python? regards, Gerrit Holl. -- Weather in Twenthe, Netherlands 20/03 16:55: 9.0ÂC wind 4.0 m/s ENE (57 m above NAP) -- In the councils of government, we must guard against the acqui

Re: [OT] Re: Hi Guys. First Time Poster

2005-03-20 Thread Gerrit Holl
Jeff Schwab wrote: > sheldon279 wrote: > Wow, you sold me. > > Does this kinda scam really still work? This kind of replies works to confuse spambayes. Gerrit. -- Weather in Twenthe, Netherlands 20/03 16:55: 9.0ÂC wind 4.0 m/s ENE (57 m above NAP) -- In the councils of government,

Re: Possible to import a module whose name is contained in a variable?

2005-03-07 Thread Gerrit Holl
Ed Leafe wrote: > On Mar 7, 2005, at 5:23 AM, Michael Hoffman wrote: > >Avoiding exec (which is a statement, not a function) is much more > >important. Since it executes arbitrary code, you can get unpredictable > >results from it. > > Is there any way to use __import__ to replace the follow

Re: Memory Allocation?

2005-02-07 Thread Gerrit Holl
Chris S. wrote: > Is it possible to determine how much memory is allocated by an arbitrary > Python object? There doesn't seem to be anything in the docs about this, > but considering that Python manages memory allocation, why would such a > module be more difficult to design than say, the GC?