Re: Python profiler usage with objects

2010-06-29 Thread rik
Ben Kaplan case.edu> writes: > > Let's take this code as an example: > > def foo() : > return None > > import profile > profile.run(foo()) > > What does the profile.run call do? > > First thin it does is evaluate foo(), which returns None. So you're calling > profile.run(None) > > Ther

RE: Python profiler usage with objects

2010-06-29 Thread Ben Kaplan
> -Original Message- > From: python-list-bounces+bsk16=case@python.org [mailto:python-list- > bounces+bsk16=case@python.org] On Behalf Of rik > Sent: Tuesday, June 29, 2010 10:52 PM > To: python-list@python.org > Subject: Re: Python profiler usage with objects > > harit gmail.co

Re: Python profiler usage with objects

2010-06-29 Thread rik
harit gmail.com> writes: > > Hi, > > I have a specific question regarding the usage of profiler. I am new > to python programming I am trying to profile a function which I want > to invoke as a class method, something like this > > import profile > > class Class: > > def doSomething(): > >

Re: Why Is Escaping Data Considered So Magical?

2010-06-29 Thread Carl Banks
On Jun 28, 2:44 am, Gregory Ewing wrote: > Carl Banks wrote: > > Indeed, strncpy does not copy that final NUL if it's at or beyond the > > nth element.  Probably the most mind-bogglingly stupid thing about the > > standard C library, which has lots of mind-boggling stupidity. > > I don't think it

Re: Why Python3

2010-06-29 Thread John Yeung
On Jun 28, 1:58 pm, "OKB (not okblacke)" wrote: > Steven D'Aprano wrote: > > For the rest of us, you can do a lot with just Python 3.1, > > with or without C modules. Whether it does *enough* to be > > considered for deployment depends on what you're deploying > > it to do. I for one would not hes

Re: [OT] Re: Why Is Escaping Data Considered So Magical?

2010-06-29 Thread Michael Torrie
On 06/29/2010 10:17 PM, Michael Torrie wrote: > On 06/29/2010 10:05 PM, Michael Torrie wrote: >> #include >> >> int main(int argc, char ** argv) >> { >> char *buf = malloc(512 * sizeof(char)); >> const int a = 2, b = 3; >> snprintf(&buf, sizeof buf, "%d + %d = %d\n", a, b, a + b); >

Re: [OT] Re: Why Is Escaping Data Considered So Magical?

2010-06-29 Thread Michael Torrie
On 06/29/2010 10:05 PM, Michael Torrie wrote: > #include > > int main(int argc, char ** argv) > { > char *buf = malloc(512 * sizeof(char)); > const int a = 2, b = 3; > snprintf(&buf, sizeof buf, "%d + %d = %d\n", a, b, a + b); ^^ Make that 512*size

Re: Why Is Escaping Data Considered So Magical?

2010-06-29 Thread Michael Torrie
On 06/29/2010 06:26 PM, Lawrence D'Oliveiro wrote: >> I'm not sure you understood me correctly, because I advocate >> *not* doing input sanitization. Hard or not -- I don't want to know, >> because I don't want to do it. > > But no-one has yet managed to come up with an alternative that involves l

Re: [OT] Re: Why Is Escaping Data Considered So Magical?

2010-06-29 Thread Michael Torrie
On 06/29/2010 06:25 PM, Lawrence D'Oliveiro wrote: > I have yet to find an architecture or C compiler where it DOESN’T work. > > Feel free to try and prove me wrong. Okay, I will. Your code passes a char** when a char* is expected. Every compiler I know of will give you a *warning*. Mistaking c

The Icelandic Sheepdog,

2010-06-29 Thread Camelot Entertainment
The Icelandic Sheepdog, http://noizeystatic.blogspot.com/2070/06/icelandic-sheepdog-noizey-static-free.html inherently comes from the spitz type, the dogs that landed on iceland by the Vikings. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why are String Formatted Queries Considered So Magical?

2010-06-29 Thread Carl Banks
On Jun 28, 3:07 am, Dennis Lee Bieber wrote: > On Sun, 27 Jun 2010 21:02:57 -0700, Stephen Hansen > declaimed the following in > gmane.comp.python.general: > > > (This is an area where parametrized queries is even more important: but > > I'm not sure if MySQL does proper prepared queries and cach

Re: git JSONRPC web service and matching pyjamas front-end

2010-06-29 Thread CM
On Jun 29, 6:54 pm, Luke Kenneth Casson Leighton wrote: > as more than just a proof-of-concept but to get pyjamas out of looking > like "a nice toy, doesn't do much, great demos, shame about real > life", i've created yet another git repository browser.  this one, > thanks to pyjamas, obviously ru

Re: Find slope of function given empirical data.

2010-06-29 Thread duncan smith
Thomas wrote: Hello all. Trying to find slope of function using numpy. Getting close, but results are a bit off. Hope someone out here can help. [snip] Why are you generating y-coordinates from the x-coordinates [-6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4]? If you're going to use the x-coordina

RE: Why Python3

2010-06-29 Thread Dino Viehland
Terry wrote: > > IronPython targets Python 2.6. > > They plan to release a 2.7 version sometime this year after CPython2.7 > is released. They plan to release a 3.2 version early next year, soon > after CPython. They should be able to do that because they already have > a 3.1 version mostly done

Re: Why Is Escaping Data Considered So Magical?

2010-06-29 Thread Lawrence D'Oliveiro
In message , Jorgen Grahn wrote: > On Sat, 2010-06-26, Lawrence D'Oliveiro wrote: > >> In message , Jorgen Grahn >> wrote: >> >>> I thought it was well-known that the solution is *not* to try to >>> sanitize the input -- it's to switch to an interface which doesn't >>> involve generating an inter

Re: [OT] Re: Why Is Escaping Data Considered So Magical?

2010-06-29 Thread Lawrence D'Oliveiro
In message , Kushal Kumaran wrote: > On Tue, Jun 29, 2010 at 5:56 AM, Lawrence D'Oliveiro > wrote: > >> Why does this work, then: >> >> l...@theon:hack> cat test.c >> #include >> >> int main(int argc, char ** argv) >> { >>char buf[512]; >>const int a = 2, b = 3; >>snprintf(&buf, si

[ANN] git JSONRPC web service and matching pyjamas front-end

2010-06-29 Thread Luke Kenneth Casson Leighton
as more than just a proof-of-concept but to get pyjamas out of looking like "a nice toy, doesn't do much, great demos, shame about real life", i've created yet another git repository browser. this one, thanks to pyjamas, obviously runs as both a desktop application and also as a web application -

Re: I strongly dislike Python 3

2010-06-29 Thread Steven D'Aprano
On Tue, 29 Jun 2010 18:56:37 +, Edward A. Falk wrote: > Nice. Once 100% of the installed base is at 2.6, I'll finally be able > to write code that compatible with 3.0. What's "the installed base"? Machines you control? Then just install 2.6 on your installed base and be done with it. Or ev

Re: Python dynamic attribute creation

2010-06-29 Thread Carl Banks
On Jun 29, 9:48 am, WANG Cong wrote: > On 06/27/10 12:01, Carl Banks wrote: > > > > > > > On Jun 25, 8:24 pm, WANG Cong wrote: > >> Understand, but please consider my proposal again, if we switched to: > > >> setattr(foo, 'new_attr', "blah") > > >> by default, isn't Python still dynamic as it is

Testimonial VIDEO for Honorable Prime Minister Vladimir Putin of the Russian Federation

2010-06-29 Thread nanothermite911fbibustards
Testimonial VIDEO for Honorable Prime Minister Vladimir Putin of the Russian Federation http://www.youtube.com/watch?v=LCYKZq9JLnc http://www.youtube.com/watch?v=Cnz5N9OubCQ http://www.youtube.com/watch?v=4nP8IdKP9Bc http://www.youtube.com/watch?v=E0_zG0PEh4o http://www.youtube.com/watch?v=JQzBeXa

Re: Crimes of YanQui Anglo Saxon ODIOUSLY CRIMINAL Bustards - BLACKWATER, CIA, FBI

2010-06-29 Thread nanothermite911fbibustards
KEY VIDEO of FBI BUSTARD ODIOUSLY CRIMINAL RACISTS http://www.youtube.com/watch?v=LCYKZq9JLnc KEY VIDEO of FBI BUSTARD ODIOUSLY CRIMINAL RACISTS http://www.youtube.com/watch?v=LCYKZq9JLnc KEY VIDEO of FBI BUSTARD ODIOUSLY CRIMINAL RACISTS http://www.youtube.com/watch?v=LCYKZq9JLnc KEY VIDEO o

Re: Why Python3

2010-06-29 Thread Martin v. Loewis
Am 29.06.2010 20:30, schrieb Paul Rubin: > "Martin v. Loewis" writes: >> And indeed, that's available, by means of the key= argument to list.sort. > > Unfortunately what's needed for more generality is the ability to supply > a comparison function, which Python2 also offers, but Python3 removes.

Crimes of YanQui Anglo Saxon ODIOUSLY CRIMINAL Bustards - BLACKWATER, CIA, FBI

2010-06-29 Thread nanothermite911fbibustards
Crimes of YANQUI Bustards http://www.youtube.com/watch?v=SYl6NKrmIfQ The FAT per DIEM FBI bustards use our TAX PAYER MONEY and INCOMPETENCE is UNACCEPTABLE. = http://www.youtube.com/watch?v=lX18zUp6WPY http://www.youtube.com/watch?v=XQapkVCx1HI http://www.youtube.com/watch?v=tXJ-k-i

Re: Russian Spies ???? This is Hilarious !!!!! Does anyone BELIEVE it ? after 911 Inside JOB and ANTHRAX

2010-06-29 Thread nanothermite911fbibustards
FBI Bustards - No one believes your ODIOUS LIES !!! http://www.youtube.com/watch?v=NLo6Y0weyro On Jun 29, 11:37 am, small Pox wrote: > http://www.youtube.com/watch?v=Cnz5N9OubCQ > > On Jun 29, 11:18 am, small Pox wrote: > > >http://www.youtube.com/watch?v=oNo2kDkstBohttp://www.youtube.com/watc

Re: Infinite prime number generator

2010-06-29 Thread Thomas Mlynarczyk
Thomas Jollans schrieb: def primes(): yield 1 1 is not a prime number. Greetings, Thomas -- Ce n'est pas parce qu'ils sont nombreux à avoir tort qu'ils ont raison! (Coluche) -- http://mail.python.org/mailman/listinfo/python-list

Re: MURDEROUS CRIMES of ODOUSLY RACIST FBI BUSTARDS !!!

2010-06-29 Thread nanothermite911fbibustards
On Jun 29, 11:35 am, small Pox wrote: > The MURDEROUS Bustards killed a man who was a SAINT . > > He ran a sunday soup and food place for the homeless and hungry. > > http://www.youtube.com/watch?v=Cnz5N9OubCQhttp://www.youtube.com/watch?v=Cnz5N9OubCQhttp://www.youtube.com/watch?v=Cnz5N9OubCQhttp:

Re: validate string representation of a timedelta

2010-06-29 Thread CM
On Jun 29, 8:00 am, Thomas Jollans wrote: > On 06/29/2010 03:41 AM, CM wrote: > > > > > I'm looking for a good way to check whether a certain string is > > valid.  It is a string representation of a Python timedelta object, > > like this:  '0:00:03.695000' > > > (But the first place, the hours, co

Re: Python v3.1.2 documentation question

2010-06-29 Thread Ethan Furman
Stephen Hansen wrote: On 6/29/10 10:01 AM, Ethan Furman wrote: In the glossary section it states: nested scope The ability to refer to a variable in an enclosing definition. For instance, a function defined inside another function can refer to variables in the outer function. Note that nested

Re: refactoring a group of import statements

2010-06-29 Thread Aahz
In article , Thomas Jollans wrote: > >(3) Why not > >try: >import x >import y >import z >except ImportError as exc: >display_error_properly(exc) >raise exc Why not? Because that destroys the original traceback. Inside an except clause, you should almost always use a bare ra

Re: CONTROLLED DEMOLITION INC explosive-charge placement technician Tom Sullivan 911 TESTIMONIAL Video

2010-06-29 Thread Pieyed Piper
On Tue, 29 Jun 2010 12:49:50 -0600, m II wrote: >See you You are worse than Proteus. He IS a retard. You have no excuse, so for you, it must be by choice. Making your mental age below 15 years. How sad. I wonder how long it will take you to notice that I have been calling you "shit for br

Re: I strongly dislike Python 3

2010-06-29 Thread geremy condra
On Tue, Jun 29, 2010 at 2:56 PM, Edward A. Falk wrote: > In article , > Stephen Hansen   wrote: >>> >>> Uhmm, just add the parenthesis to your old scripts. You can >>> do that without breaking on 2.x. >> >>Only sort of. But in Python 2.6+, you only need to "from __future__ >>import print_function"

Re: C++/Python function call

2010-06-29 Thread Stefan Behnel
Rami Chowdhury, 29.06.2010 20:56: On Tuesday 29 June 2010 05:24:26 Zohair M. Abu Shaban wrote: From: rami.chowdh...@gmail.com On Monday 28 June 2010 12:46:13 Zohair M. Abu Shaban wrote: I have this python function defined as: def set_time_at_next_pps(self, *args, **kwargs): """set_time_a

Re: Infinite prime number generator

2010-06-29 Thread John Posner
On 6/29/2010 12:51 PM, Thomas Jollans wrote: def rprimes(): def elim_mult(n): yield n for p in filter((lambda x:x%n != 0), elim_mult(n+1)): yield p yield 1 for p in elim_mult(2): yield p Thomas, take a look at the thread "Generators/iterators, Pythonicity, an

Re: I strongly dislike Python 3

2010-06-29 Thread Edward A. Falk
In article , Stephen Hansen wrote: >> >> Uhmm, just add the parenthesis to your old scripts. You can >> do that without breaking on 2.x. > >Only sort of. But in Python 2.6+, you only need to "from __future__ >import print_function" to make code work in both 2.x and 3.x (at least >insofar as the

Re: C++/Python function call

2010-06-29 Thread Rami Chowdhury
Hi Zohair, On Tuesday 29 June 2010 05:24:26 Zohair M. Abu Shaban wrote: > Dear Rami, > > Thanks for your reply. I am using hardware that uses some libraries on > Linux. def set_time_at_next_pps(*args, **kwargs): > """set_time_at_next_pps(self, usrp2::time_spec_t time_spec) -> > bool""" re

Re: Python as a scripting language. Alternative to bash script?

2010-06-29 Thread Robert Kern
On 6/29/10 4:06 AM, Jorgen Grahn wrote: On Mon, 2010-06-28, John Nagle wrote: On 6/28/2010 7:58 AM, Benjamin Kaplan wrote: How does a program return anything other than an exit code? Ah, yes, the second biggest design mistake in UNIX. Programs have "argv" and "argc", plus environme

Re: Russian Spies ???? This is Hilarious !!!!! Does anyone BELIEVE it ? after 911 Inside JOB and ANTHRAX

2010-06-29 Thread small Pox
http://www.youtube.com/watch?v=Cnz5N9OubCQ On Jun 29, 11:18 am, small Pox wrote: > http://www.youtube.com/watch?v=oNo2kDkstBohttp://www.youtube.com/watch?v=3jNuGBCAAg8http://www.youtube.com/watch?v=9C4umi2eMrM > > http://www.youtube.com/watch?v=PR6s_Ib0I-Mhttp://www.youtube.com/watch?v=ivTcmbqQC

MURDEROUS CRIMES of ODOUSLY RACIST FBI BUSTARDS !!!

2010-06-29 Thread small Pox
The MURDEROUS Bustards killed a man who was a SAINT . He ran a sunday soup and food place for the homeless and hungry. http://www.youtube.com/watch?v=Cnz5N9OubCQ http://www.youtube.com/watch?v=Cnz5N9OubCQ http://www.youtube.com/watch?v=Cnz5N9OubCQ http://www.youtube.com/watch?v=Cnz5N9OubCQ http:

Re: Why Python3

2010-06-29 Thread Paul Rubin
"Martin v. Loewis" writes: > And indeed, that's available, by means of the key= argument to list.sort. Unfortunately what's needed for more generality is the ability to supply a comparison function, which Python2 also offers, but Python3 removes. I gave an example a while back of wanting to compa

Re: CONTROLLED DEMOLITION INC explosive-charge placement technician Tom Sullivan 911 TESTIMONIAL Video

2010-06-29 Thread Bart!
On Tue, 29 Jun 2010 19:58:13 +0200, Thomas 'PointedEars' Lahn wrote: >UltimatePatriot crossposted twice over 4 off-topic newsgroups without >Followup-To, replying to an obvious troll: Whoopie fucking doo, you fucking netkkkop wanna be Usenet PUTZ! Your kill file edit announcement post is

Re: Russian Spies ???? This is Hilarious !!!!! Does anyone BELIEVE it ? after 911 Inside JOB and ANTHRAX

2010-06-29 Thread small Pox
http://www.youtube.com/watch?v=oNo2kDkstBo http://www.youtube.com/watch?v=3jNuGBCAAg8 http://www.youtube.com/watch?v=9C4umi2eMrM http://www.youtube.com/watch?v=PR6s_Ib0I-M http://www.youtube.com/watch?v=ivTcmbqQCFg http://www.youtube.com/watch?v=6JzupsT-8Sc http://www.youtube.com/watch?v=ubacHhs8

Find slope of function given empirical data.

2010-06-29 Thread Thomas
Hello all. Trying to find slope of function using numpy. Getting close, but results are a bit off. Hope someone out here can help. import numpy as np def deriv(y): x = list(range(len(y))) x.reverse() # Change from [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] x = np.array(x) #to [

Re: CONTROLLED DEMOLITION INC explosive-charge placement technician Tom Sullivan 911 TESTIMONIAL Video

2010-06-29 Thread Thomas 'PointedEars' Lahn
UltimatePatriot crossposted twice over 4 off-topic newsgroups without Followup-To, replying to an obvious troll: > [...] One good thing about Usenet is that you don't have to look for people you can safely put into your killfile; they'll agglomerate automatically. F'up2 set accordingly -- Po

Re: Third World War is Coming - Who is Webster Tarpley ?

2010-06-29 Thread small Pox
On Jun 29, 9:41 am, nanothermite911fbibustards wrote: > On Jun 28, 11:25 pm, nanothermite911fbibustards > > wrote: > > Third World War is Coming - Who is Webster Tarpley ? > > >http://www.youtube.com/watch?v=jLaaPBV9nqAhttp://www.youtube.com/watc... > > Third World War is Coming - Who is Webster

Re: CONTROLLED DEMOLITION INC explosive-charge placement technician Tom Sullivan 911 TESTIMONIAL Video

2010-06-29 Thread UltimatePatriot
On Tue, 29 Jun 2010 09:46:06 -0700 (PDT), nanothermite911fbibustards wrote: >I know you are an ODIOUS SPK, which has many aliases on newsnet >like Uncle Al and you have TWO GOALS !!! Yer a goddamned kook, boy. Run over to the kook group. Uncle Al has only ever posted into Usenet under h

Re: CONTROLLED DEMOLITION INC explosive-charge placement technician Tom Sullivan 911 TESTIMONIAL Video

2010-06-29 Thread UltimatePatriot
On Tue, 29 Jun 2010 09:31:07 -0700 (PDT), nanothermite911fbibustards wrote: >They had military type wireless coordinated cutter charges that they >accessed You're a goddamned idiot. You think that we did not go to the moon as well, right? -- http://mail.python.org/mailman/listinfo/python-

Re: Python v3.1.2 documentation question

2010-06-29 Thread Stephen Hansen
On 6/29/10 10:01 AM, Ethan Furman wrote: In the glossary section it states: nested scope The ability to refer to a variable in an enclosing definition. For instance, a function defined inside another function can refer to variables in the outer function. Note that nested scopes work only for r

Re: Python dynamic attribute creation

2010-06-29 Thread Stephen Hansen
On 6/29/10 9:46 AM, WANG Cong wrote: 1) Disallow dynamic attribute creations by assignments _by default_, thus I expect an error when I do: So far I only did tell you _how_ it is in Python. If I understand your question about the design of the language correctly than you would like Python to de

Russian Spies ???? This is Hilarious !!!!! Does anyone BELIEVE it ? after 911 Inside JOB and ANTHRAX

2010-06-29 Thread nanothermite911fbibustards
YanQui cry babies using old RACIST formula of Harassment !!! To Harass Muslims :- Make a Movie of Bin Laden from a Studio in Langley Virginia with an actor with SILICONE mask and release on the internet with FBI working on AUTHENTICATING it. Hey YANK Bustards , NO ONE trust you. You have DESTR

Re: Python dynamic attribute creation

2010-06-29 Thread Stephen Hansen
On 6/29/10 9:48 AM, WANG Cong wrote: On 06/27/10 12:01, Carl Banks wrote: On Jun 25, 8:24 pm, WANG Cong wrote: Understand, but please consider my proposal again, if we switched to: setattr(foo, 'new_attr', "blah") by default, isn't Python still dynamic as it is? (Please teach me if I am wr

Re: Python dynamic attribute creation

2010-06-29 Thread Ethan Furman
WANG Cong wrote: On 06/29/10 17:48, Andre Alexander Bell wrote: As said previously I don't think one should differentiate between meta programming and programming within the language, since the former is nothing different than the latter. If you check other programming language rather than

Re: Python dynamic attribute creation

2010-06-29 Thread Ethan Furman
WANG Cong wrote: On 06/27/10 12:01, Carl Banks wrote: On Jun 25, 8:24 pm, WANG Cong wrote: Understand, but please consider my proposal again, if we switched to: setattr(foo, 'new_attr', "blah") by default, isn't Python still dynamic as it is? (Please teach me if I am wrong here.) This why

Python profiler usage with objects

2010-06-29 Thread harit
Hi, I have a specific question regarding the usage of profiler. I am new to python programming I am trying to profile a function which I want to invoke as a class method, something like this import profile class Class: def doSomething(): do here .. def callMethod(): **self.doSomethin

Re: Python dynamic attribute creation

2010-06-29 Thread Chris Rebert
On Tue, Jun 29, 2010 at 9:48 AM, WANG Cong wrote: > On 06/27/10 12:01, Carl Banks wrote: >> On Jun 25, 8:24 pm, WANG Cong wrote: >>> Understand, but please consider my proposal again, if we switched to: >>> >>> setattr(foo, 'new_attr', "blah") >>> >>> by default, isn't Python still dynamic as it

Infinite prime number generator

2010-06-29 Thread Thomas Jollans
I've been toying with Haskell a bit, and after implementing (essentially) the Sieve of Eratosthenes as an infinite list, thus: primes = 1 : foldr elim_mult [] [2..] where elim_mult n l = n : filter ((/=0) . (`mod` n)) l I wondered how easy it would be to do the same thing in Python. Obviously

Python v3.1.2 documentation question

2010-06-29 Thread Ethan Furman
In the glossary section it states: nested scope The ability to refer to a variable in an enclosing definition. For instance, a function defined inside another function can refer to variables in the outer function. Note that nested scopes work only for reference and not for assignment which w

Re: CONTROLLED DEMOLITION INC explosive-charge placement technician Tom Sullivan 911 TESTIMONIAL Video

2010-06-29 Thread nanothermite911fbibustards
On Jun 29, 5:24 am, "n...@bid.nes" wrote: > On Jun 26, 12:16 pm, nanothermite911fbibustards > > wrote: > >   Let's talk about thermite. SPOOOK MOTHER FUCKER, I will talk what I want to talk. I know you are an ODIOUS SPK, which has many aliases on newsnet like Uncle Al and you have TWO GOALS

Re: Python dynamic attribute creation

2010-06-29 Thread WANG Cong
On 06/27/10 12:01, Carl Banks wrote: > On Jun 25, 8:24 pm, WANG Cong wrote: >> Understand, but please consider my proposal again, if we switched to: >> >> setattr(foo, 'new_attr', "blah") >> >> by default, isn't Python still dynamic as it is? (Please teach me if I >> am wrong here.) >> >> This w

Re: Third World War is Coming - Who is Webster Tarpley ?

2010-06-29 Thread nanothermite911fbibustards
On Jun 28, 11:25 pm, nanothermite911fbibustards wrote: > Third World War is Coming - Who is Webster Tarpley ? > > http://www.youtube.com/watch?v=jLaaPBV9nqAhttp://www.youtube.com/watch?v=KV6oKRnM4mYhttp://www.youtube.com/watch?v=y53R_h-OZAM Third World War is Coming - Who is Webster Tarpley ? ht

Re: Python dynamic attribute creation

2010-06-29 Thread WANG Cong
On 06/29/10 17:48, Andre Alexander Bell wrote: > On 06/25/2010 03:15 PM, WANG Cong wrote: >> 1) Modifying a class attribute is metaprogramming, and this is modifying >> a class, i.e. adding a new attribute to it, thus this should belong >> to metaprogramming. (I know, strictly speaking, maybe my

Re: CONTROLLED DEMOLITION INC explosive-charge placement technician Tom Sullivan 911 TESTIMONIAL Video

2010-06-29 Thread nanothermite911fbibustards
On Jun 29, 5:24 am, "n...@bid.nes" wrote: > On Jun 26, 12:16 pm, nanothermite911fbibustards > > wrote: > >   Let's talk about thermite. > >   Do you know anything about thermite? It's a powdered mixture of a > metal oxide and another pure metal that, when raised to a specific > minimum temperatur

Re: Why Python3

2010-06-29 Thread Martin v. Loewis
> I should point out that this wasn't a mere whimsy on Guido's part. > Mathematically, supporting larger-than and less-than comparisons on > complex numbers *is* a bug -- they're simply meaningless mathematically. > (Which is greater, 2-1i or -1+2i?) However, that's true for many other values t

Re: N00b question: matching stuff with variables.

2010-06-29 Thread Tim Golden
On 29/06/2010 15:14, Stephen Hansen wrote: True: but I've personally never seent he point of the csv module unless we're talking about a more complicated csv format, such as one with quoting in fields. I don't know if that's what the OP is working with, but good point: csv might be a good approac

Re: Why Is Escaping Data Considered So Magical?

2010-06-29 Thread Mark Lawrence
On 29/06/2010 01:55, Roy Smith wrote: [snips] The nice thing about null-terminated strings is how portable they have been over various word lengths. The bad thing about null-terminated strings is the number of off-by-one errors they've helped to create. I obviously have never created an of

Re: python source code -> win/dos executable (on linux)

2010-06-29 Thread Stephen Hansen
On 6/29/10 12:27 AM, Lawrence D'Oliveiro wrote: In message<4c286d71$0$18654$4fafb...@reader3.news.tin.it>, superpollo wrote: Lawrence D'Oliveiro ha scritto: Is it really such a hassle to install things on Windows? no, but it *IS* to explain it to dumb users... :-( Can’t you create an inst

Re: optphart (alpha2)

2010-06-29 Thread Stephen Hansen
On 6/28/10 11:50 PM, rantingrick wrote: You just don't get the point, do you? And just what *point* an i supposed to be "getting" Stephen? That you don't like my contribution? If thats your point then i very much "get" it. This garbage: "optphart is the nemisis of the asinine interfaces and

Re: Why are String Formatted Queries Considered So Magical?

2010-06-29 Thread Stephen Hansen
On 6/29/10 5:41 AM, Roy Smith wrote: Nobody wrote: And what about regular expressions? What about them? As the saying goes: Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems. That's silly. RE is a

Re: N00b question: matching stuff with variables.

2010-06-29 Thread Stephen Hansen
On 6/29/10 2:51 AM, Sion Arrowsmith wrote: Stephen Hansen wrote: On 6/28/10 10:29 AM, Ken D'Ambrosio wrote: for line in file: match = re.search((seek)",(.*),(.*)", line) # Stuck here [ ... ] name, foo, bar = line.split(",") if seek in name: # do something with foo and

Re: More MySQL Stuff

2010-06-29 Thread Victor Subervi
On Mon, Jun 28, 2010 at 2:24 PM, Emile van Sebille wrote: > On 6/28/2010 9:10 AM Victor Subervi said... > >> Any other suggestions? >> > > > http://www.databaseanswers.org/tutorial4_db_schema/index.htm Thanks. Good tutorial. beno -- http://mail.python.org/mailman/listinfo/python-list

Re: Why are String Formatted Queries Considered So Magical?

2010-06-29 Thread Roy Smith
Nobody wrote: > > And what about regular expressions? > > What about them? As the saying goes: > > Some people, when confronted with a problem, think > "I know, I'll use regular expressions." > Now they have two problems. That's silly. RE is a good tool. Like all good tools

Re: CONTROLLED DEMOLITION INC explosive-charge placement technician Tom Sullivan 911 TESTIMONIAL Video

2010-06-29 Thread n...@bid.nes
On Jun 26, 12:16 pm, nanothermite911fbibustards wrote: Let's talk about thermite. Do you know anything about thermite? It's a powdered mixture of a metal oxide and another pure metal that, when raised to a specific minimum temperature, allows the metal to "steal" the oxygen from the metal ox

Re: validate string representation of a timedelta

2010-06-29 Thread Thomas Jollans
On 06/29/2010 03:41 AM, CM wrote: > I'm looking for a good way to check whether a certain string is > valid. It is a string representation of a Python timedelta object, > like this: '0:00:03.695000' > > (But the first place, the hours, could also be double digits) > > In trying to figure out ho

Re: dynamically modify help text

2010-06-29 Thread Thomas Jollans
On 06/29/2010 02:37 AM, Ben Finney wrote: > Brian Blais writes: > >> On Jun 28, 2010, at 14:25 , Chris Rebert wrote: >>> __doc__ is normally defined on classes, e.g. `A`, not instances, >>> e.g. `a`. help() looks for __doc__ accordingly. >> >> so that gets back to my original question: can I chan

Re: Pydev 1.5.8 Released

2010-06-29 Thread Fabio Zadrozny
On Tue, Jun 29, 2010 at 12:37 AM, ejosvp wrote: > On 28 jun, 22:35, ejosvp wrote: >> I have a problem with pydev 1.5.8 >> >> An error has occurred. See error log for more details. >> com.aptana.editor.common.CommonEditorPlugin.getThemeManager()Lcom/ >> aptana/editor/common/theme/IThemeManager; >>

Re: Why are String Formatted Queries Considered So Magical?

2010-06-29 Thread Duncan Booth
Owen Jacobson wrote: > However, not every programming language has > the kind of structural flexibility to do that well: a library similar > to SQLalchemy would be incredibly clunky (if it worked at all) in, say, > Java or C#, and it'd be nearly impossible to pull off in C. I guess you've ne

Re: CONTROLLED DEMOLITION INC explosive-charge placement technician Tom ?Sullivan 911 TESTIMONIAL Video

2010-06-29 Thread Gone Fishin'
> Now is the time to pay back by defending the CONSTITUTION and first > step is spreading the INCONTROVERTIBLE EVIDENCE of the CRIME and the > CRIMINALS. You're right. Now please stop posting here. You're not converting anyone, you're alienating them. I'll meet you in the constitutional and 9

Re: N00b question: matching stuff with variables.

2010-06-29 Thread Sion Arrowsmith
Stephen Hansen wrote: >On 6/28/10 10:29 AM, Ken D'Ambrosio wrote: >> for line in file: >> match = re.search((seek)",(.*),(.*)", line) # Stuck here > [ ... ] > name, foo, bar = line.split(",") > if seek in name: > # do something with foo and bar > >That'll return True if the wo

Re: Python dynamic attribute creation

2010-06-29 Thread Andre Alexander Bell
On 06/25/2010 03:15 PM, WANG Cong wrote: > 1) Modifying a class attribute is metaprogramming, and this is modifying > a class, i.e. adding a new attribute to it, thus this should belong > to metaprogramming. (I know, strictly speaking, maybe my definition of > "metaprogramming" here is incorrect, I

Re: Why are String Formatted Queries Considered So Magical?

2010-06-29 Thread Nobody
On Tue, 29 Jun 2010 12:30:36 +1200, Lawrence D'Oliveiro wrote: >> Seriously, almost every other kind of library uses a binary API. What >> makes databases so special that they need a string-command based API? > > HTML is also effectively a string-based API. HTML is a data format. The sane way to

Re: Python as a scripting language. Alternative to bash script?

2010-06-29 Thread eric dexter
On Jun 28, 5:48 am, Dave Pawson wrote: > I've a fairly long bash script and I'm wondering > how easy it would be to port to Python. > > Main queries are: > Ease of calling out to bash to use something like imageMagick or Java? > Ease of grabbing return parameters? E.g. convert can return both > he

Re: Python as a scripting language. Alternative to bash script?

2010-06-29 Thread Jorgen Grahn
On Mon, 2010-06-28, Dave Pawson wrote: > I've a fairly long bash script and I'm wondering > how easy it would be to port to Python. > > Main queries are: > Ease of calling out to bash to use something like imageMagick or Java? > Ease of grabbing return parameters? E.g. convert can return both > hei

Re: Python as a scripting language. Alternative to bash script?

2010-06-29 Thread Jorgen Grahn
On Mon, 2010-06-28, John Nagle wrote: > On 6/28/2010 7:58 AM, Benjamin Kaplan wrote: >> How does a program return anything other than an exit code? > > Ah, yes, the second biggest design mistake in UNIX. > > Programs have "argv" and "argc", plus environment variables, > going in. So, going

Re: [ANN] optphart (alpha2)

2010-06-29 Thread Steven D'Aprano
On Mon, 28 Jun 2010 22:41:17 -0700, rantingrick wrote: > """ > I am pleased to announce optphart (alpha2)! I'm not sure this counts as a project worthy of an official release announcement and a version number, it's more of a recipe. Perhaps you should put it on the ActiveState cookbook? http:

Re: Python dynamic attribute creation

2010-06-29 Thread Bruno Desthuilliers
Aahz a écrit : In article <4c285e7c$0$17371$426a7...@news.free.fr>, Bruno Desthuilliers wrote: Aahz a écrit : In article <4c2747c1$0$4545$426a7...@news.free.fr>, Bruno Desthuilliers wrote: Python has no pretention at "elegance". That's not true at all. More precisely, I would agree with

Re: 回复: I wander which is better? JSP or Pytho n? And is there a place for JSP?

2010-06-29 Thread 戴清灏
Sorry for having delayed to reply. Your response really inspired me. I am a sophomore student in China,My major is computer network. Since so,besides I really love web development,I should focus more attention on Python as it means a lot to web applications. Python is so laconic that it makes me fe

Re: os.system: string encoding

2010-06-29 Thread Lawrence D'Oliveiro
In message , Peter Kleiweg wrote: > How do I set the string encoding for os.system to anything other then > UTF-8? Works for me (on Debian Unstable): l...@theon:~> echo $LC_ALL en_NZ.utf8 l...@theon:~> python3.1 Python 3.1.2 (r312:79147, May 8 2010, 13:27:06) [GCC 4.4.4] o

Re: python source code -> win/dos executable (on linux)

2010-06-29 Thread Lawrence D'Oliveiro
In message <4c286d71$0$18654$4fafb...@reader3.news.tin.it>, superpollo wrote: > Lawrence D'Oliveiro ha scritto: >> >> Is it really such a hassle to install things on Windows? > > no, but it *IS* to explain it to dumb users... :-( Can’t you create an installation package that specifies Python a