Programming languages "national brotherhood week"
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 it? It was quite funny, I think it was more than five years ago though. Gerrit. -- Temperature in Luleå, Norrbotten, Sweden: | Current temperature 05-09-24 15:59:53 12.1 degrees Celsius ( 53.9F) | -- Det finns inte dåligt väder, bara dåliga kläder. -- http://mail.python.org/mailman/listinfo/python-list
Re: New-style classes questions
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 >>> class Bar: pass ... >>> type(Bar) I like this. However, perhaps other people reading my source code won't like it, because when they see 'class Foo:', they might expect an old-style class. But it's so much better to type and to read, that I prefer this. Does the Python style guide have any severe penalty for using this? regards, Gerrit. -- Temperature in Luleå, Norrbotten, Sweden: | Current temperature 05-09-25 15:19:47 11.0 degrees Celsius ( 51.9F) | -- Det finns inte dåligt väder, bara dåliga kläder. -- http://mail.python.org/mailman/listinfo/python-list
Re: Documenting properties
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 put a # in front of every line otherwise. Except, of course, code that contains string literals with triple quotes. And with a good editor, it's not too difficult to insert a # in front of hundreds of lines (:%s/^/#/g). Gerrit. -- Temperature in Luleå, Norrbotten, Sweden: | Current temperature 05-09-27 20:19:549.8 degrees Celsius ( 49.7F) | -- Det finns inte dåligt väder, bara dåliga kläder. -- http://mail.python.org/mailman/listinfo/python-list
Re: A Moronicity of Guido van Rossum
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å, Norrbotten, Sweden: | Current temperature 05-09-29 18:19:556.8 degrees Celsius ( 44.3F) | -- Det finns inte dåligt väder, bara dåliga kläder. -- http://mail.python.org/mailman/listinfo/python-list
Re: A Moronicity of Guido van Rossum
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; 'from:name:tony meyer': 0.16; > 'obvious,': 0.16; 'spambayes': 0.16; 'subject:Guido': 0.16; > 'trolling,': 0.16; 'regret': 0.82; 'lee,': 0.91; 'viagra': 0.91; > 'mailings': 0.93; 'probability': 0.93 > This is a feature, not a bug. It's the same feature that means that > messages talking about spam on the spambayes mailing list, or the > legitimate mail I get about viagra , get through to me. True. However, most mail to this mailinglist has less than 0.001 spam probability. As you can see, this one had 0.048 - a vast score, almost enough to put it in my unsure box. It seems to be just not hammy enough. It's interesting to see that no none of the foul language words used by Xah Lee ever occurs in any spam I receive - spam is not that stupid. Gerrit. -- Temperature in Luleå, Norrbotten, Sweden: | Current temperature 05-09-30 12:49:54 11.1 degrees Celsius ( 51.9F) | -- Det finns inte dåligt väder, bara dåliga kläder. -- http://mail.python.org/mailman/listinfo/python-list
Re: A Moronicity of Guido van Rossum
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 > (the "from:addr:ihug.co.nz", "from:name:tony meyer", and "spambayes" > tokens make it seem that way)... It is, and that's very surprising, but apparantly it was not really hammy enough. But don't worry, by ham_cutoff is 0.2, and out of the 10 'unsure' messages per week, 2 are spam, 2 are ham, and 6 are, well, unsure. Note that with all my mailinglists, the number of messages handled is more than 2500 per week, so I'm very, very happy with spambayes... Gerrit. -- Temperature in Luleå, Norrbotten, Sweden: | Current temperature 05-10-01 09:49:529.7 degrees Celsius ( 49.5F) | -- Det finns inte dåligt väder, bara dåliga kläder. -- http://mail.python.org/mailman/listinfo/python-list
Re: Class methods
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-abbreviation down (-; Gerrit. -- Temperature in Luleå, Norrbotten, Sweden: | Current temperature 05-10-05 21:59:48 10.7 degrees Celsius ( 51.3F) | -- Det finns inte dåligt väder, bara dåliga kläder. -- http://mail.python.org/mailman/listinfo/python-list
Re: Well written open source Python apps
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.) Mailman - http://www.list.org/ Spambayes - http://www.spambayes.org Those are written by experienced Python programmers, some of them Python developers. It looks like well written code to me. Gerrit. -- Temperature in Luleå, Norrbotten, Sweden: | Current temperature 05-10-14 10:19:498.3 degrees Celsius ( 47.0F) | -- Det finns inte dåligt väder, bara dåliga kläder. -- http://mail.python.org/mailman/listinfo/python-list
Re: Problems with properties
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 your classes new-style. Gerrit. -- Temperature in Luleå, Norrbotten, Sweden: | Current temperature 05-10-14 17:59:487.9 degrees Celsius ( 46.3F) | -- Det finns inte dåligt väder, bara dåliga kläder. -- http://mail.python.org/mailman/listinfo/python-list
Re: your mail
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 temperature 05-10-17 22:29:599.6 degrees Celsius ( 49.2F) | -- Det finns inte dåligt väder, bara dåliga kläder. -- http://mail.python.org/mailman/listinfo/python-list
Re: hello, I want to change n bytes of a binary file
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/listinfo/python-list
Re: pre-PEP: Object-oriented file module
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 degrees Celsius ( 53.3F) | -- In the councils of government, we must guard against the acquisition of unwarranted influence, whether sought or unsought, by the military-industrial complex. The potential for the disastrous rise of misplaced power exists and will persist. -Dwight David Eisenhower, January 17, 1961 -- http://mail.python.org/mailman/listinfo/python-list
Re: defining __repr__
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 in Luleå, Norrbotten, Sweden: | Current temperature 05-09-15 19:19:587.8 degrees Celsius ( 46.0F) | -- Det finns inte dåligt väder, bara dåliga kläder. -- http://mail.python.org/mailman/listinfo/python-list
Re: Free seminar on domain-specific modeling
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 Tolvanen, Jack Greenfield, Steven Kelly and > Krzysztof Czarnecki about DSM and how to implement it. > > Time: Friday, October 21, 2005. 8:00am - 12:00noon. Right after > OOPSLA. > Place:Town & Country Resort & Convention Center, San Diego. Will the trip there be free as well? Gerrit. (sorry, couldn't resist) -- Temperature in Luleå, Norrbotten, Sweden: | Current temperature 05-09-19 19:09:599.5 degrees Celsius ( 49.0F) | -- Det finns inte dåligt väder, bara dåliga kläder. -- http://mail.python.org/mailman/listinfo/python-list
Re: Memory Allocation?
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? Why do you want it? regards, Gerrit. -- In the councils of government, we must guard against the acquisition of unwarranted influence, whether sought or unsought, by the military-industrial complex. The potential for the disastrous rise of misplaced power exists and will persist. -Dwight David Eisenhower, January 17, 1961 -- http://mail.python.org/mailman/listinfo/python-list
Re: Possible to import a module whose name is contained in a variable?
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 following: > > exec("from %s import *" % modulename) No. Gerrit. -- Weather in Twenthe, Netherlands 07/03 13:25: 4.0ÂC Few clouds mostly cloudy wind 5.4 m/s NW (57 m above NAP) -- In the councils of government, we must guard against the acquisition of unwarranted influence, whether sought or unsought, by the military-industrial complex. The potential for the disastrous rise of misplaced power exists and will persist. -Dwight David Eisenhower, January 17, 1961 -- http://mail.python.org/mailman/listinfo/python-list
Re: [OT] Re: Hi Guys. First Time Poster
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, we must guard against the acquisition of unwarranted influence, whether sought or unsought, by the military-industrial complex. The potential for the disastrous rise of misplaced power exists and will persist. -Dwight David Eisenhower, January 17, 1961 -- http://mail.python.org/mailman/listinfo/python-list
Re: ANN: 2005 International Obfuscated Ruby Code Contest (IORCC)
[EMAIL PROTECTED] wrote: > IMMEDIATE RELEASE: Fri Mar 18 16:34:52 CST 2005 > LOCATION: http://iorcc.dyndns.org/2005/press/031805.html > ANNOUNCEMENT: International Obfuscated Ruby Code Contest (IORCC) >Entry Deadline, Midnight on March 31st, 2005 > > > 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 acquisition of unwarranted influence, whether sought or unsought, by the military-industrial complex. The potential for the disastrous rise of misplaced power exists and will persist. -Dwight David Eisenhower, January 17, 1961 -- http://mail.python.org/mailman/listinfo/python-list
Re: help with getting selection from wxChoice with out after it has changed
'@'.join([..join(['fred', 'dixon']), ..join(['gmail', 'com'])]) wrote: > From: "'@'.join([..join(['fred', 'dixon']), ..join(['gmail', 'com'])])" > <[EMAIL PROTECTED]> 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:55: 10.0ÂC mist overcast wind 0.9 m/s None (57 m above NAP) -- In the councils of government, we must guard against the acquisition of unwarranted influence, whether sought or unsought, by the military-industrial complex. The potential for the disastrous rise of misplaced power exists and will persist. -Dwight David Eisenhower, January 17, 1961 -- http://mail.python.org/mailman/listinfo/python-list
Re: [perl-python] Python documentation moronicities (continued)
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 ... > > > Fucking morons ... fucking stupid ... fuckhead coders ... fuckheads ... > > > you fucking asses. > > > > > paypal me a hundred dollars and i'll rewrite the whole re doc in a few > > > hours. > > > > Can we paypal you a hundred dollars to leave us alone? I'll pledge $10. > > Are there another nine people here who'll do the same? > > Why don't we pay him $100 to re-write the PERL docs? Interestingly, Richard Hindle's message was classified as ham by my spambayes, whereas your message was unsure. Could it be the second-to-last word doing it? (-; Gerrit. -- Weather in Twenthe, Netherlands 12/04 19:55: 13.0ÂC wind 2.2 m/s NNW (57 m above NAP) -- In the councils of government, we must guard against the acquisition of unwarranted influence, whether sought or unsought, by the military-industrial complex. The potential for the disastrous rise of misplaced power exists and will persist. -Dwight David Eisenhower, January 17, 1961 -- http://mail.python.org/mailman/listinfo/python-list
Re: printing variables
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... > eg print var* ?? > i don't want to do : > > print var1, var2, var3, var4 ..etc... Don't do this: >>> import fnmatch >>> var1, var2, var3 = "foo", "bar", "baz" >>> for k in fnmatch.filter(locals(), "var*"): ... print locals()[k] ... foo baz bar This is evil. It's unpythonic. This is yet another way to do it - QED. Gerrit. -- http://mail.python.org/mailman/listinfo/python-list
Re: file system iteration
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, but under the circumstances currently, I can > only use the standard Python library. Any ideas on how to do this better? The very least you can try: import string string.ascii_uppercase for c in string.ascii_uppercase: if os.path.isdir('%s:/' % c): ... etc. But I suppose there should be a better way. Gerrit. -- http://mail.python.org/mailman/listinfo/python-list
Re: Using Gnutar to remove a list of files
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 the list and delete those files from my > system. That part is easy, but what I'm stuck on is getting the list > of files in an archive into a list variable. If I use the -t parameter > in gnutar, it prints a list of the files in a seperate cmd screen, but > only returns 0. Is there any way to make it return a list, or to copy > the information over? Thanks in advance! Use the commands module. Or tarfile of course. http://docs.python.org/lib/module-commands.html http://docs.python.org/lib/module-tarfile.html Gerrit. -- http://mail.python.org/mailman/listinfo/python-list
Re: Motions.
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 that binary (choose a suitable treshhold, 100 or so) and you'll get a matrix for each frame with value 1 for the position of the bird. Been there, done that, though my problem was slightly easier: I had a few dozen of equal balls flying around and all I needed was the average total position, not tracking each individually. How to do that if birds pass each other (projecting 3D on 2D) I don't know, but I'm sure it's been done before (not necessarily in Python though). Gerrit. -- http://mail.python.org/mailman/listinfo/python-list
Re: Best IDE?
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: matrix Multiplication
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 range(len(A)): D.append(0) > > >for i in range(len(A)): C.append(D) > > > > append doesn't copy data, so you're basically adding len(A) references to > > the same D list to C. for more on this, see: > > > > http://pyfaq.infogami.com/how-do-i-create-a-multidimensional-list > > > > > > Ok!! Tank you very much, i understand now. You might also want to look at numpy/numarray. Gerrit. -- http://mail.python.org/mailman/listinfo/python-list
Re: A Comparison Of Dynamic and Static Languiges
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 (spambayes), not hiding ones address on the internet. Gerrit. -- http://mail.python.org/mailman/listinfo/python-list
Re: Is there a way to get utf-8 out of a Unicode string?
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 hackish: return ''.join(chr(ord(c)) for c in s) Gerrit. -- http://mail.python.org/mailman/listinfo/python-list
PEP 358 and operations on bytes
Hi, In Python 3, reading from a file gives bytes rather than characters. Some operations currently performed on strings also make sense when performed on bytes, either if it's binary data or if it's text of unknown or mixed encoding. Those include of course slicing and other operators that exist in lists, but also other operations that aren't currently defined in PEP 358, like: - 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 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.python.org/mailman/listinfo/python-list
Re: PEP 358 and operations on bytes
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 certainly share a lot of properties > > and possible operations one might want to perform. > > > > I look at it this way:: > Processing text? Use unicode. > Binary structures and file I/O, interfacing to 8-bit-wide channels? Use > bytes. But can I use regular expressions on bytes? Regular expressions are not limited to text. Gerrit. -- http://mail.python.org/mailman/listinfo/python-list
Re: How can I know the name of "caller"
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 things on a regular basis, it will sooner or later become your enemy. Gerrit. -- http://mail.python.org/mailman/listinfo/python-list