Python/Django linux build consultant required

2010-04-04 Thread Si
Hi, we are a San Francisco based startup company and are looking for a Python/Django person to help us roll out our recently completed. We're looking for 5 years + Python experience with a knowledge of tools such as pyinstall (or other build systems). Please contact me directly interested. Rgds. -

Re: Encryption source code with md5

2010-04-04 Thread geremy condra
On Sun, Apr 4, 2010 at 8:42 PM, Robert Kern wrote: > On 2010-04-04 17:44 , geremy condra wrote: >> >> On Sun, Apr 4, 2010 at 6:03 PM, Robert Kern  wrote: >>> >>> On 2010-04-03 20:21 , Lawrence D'Oliveiro wrote: In message<4baf3ac4$0$22903$e4fe5...@news.xs4all.nl>, Irmen de Jong wrot

Re: passing command line arguments to executable

2010-04-04 Thread Joshua
On 4/3/10 12:09 PM, mcanjo wrote: I have an executable (I don't have access to the source code) that processes some data. I double click on the icon and a Command prompt window pops up. The program asks me for the input file, I hit enter, and then it asks me for and output filename, I hit enter a

unset TCL_LIBRARY and TK_LIBRARY

2010-04-04 Thread Wolfman
Hello- was hoping someone could give me a hand in permanently setting my TCL_LIBRARY and TK_LIBRARY. I downloaded Python2.6 to a ThinkPad that came installed with Python2.2, and I can not run IDLE as something automatically sets TCL_LIBRARY and TK_LIBRARY to C:\IBMTools\Python22\ each time i open

Re: Incorrect scope of list comprehension variables

2010-04-04 Thread Stephen Hansen
On 2010-04-04 14:50:54 -0700, Paul Rubin said: Alain Ketterlin writes: d[r] = [r for r in [4,5,6]] THe problem is that the "r" in d[r] somehow captures the value of the "r" in the list comprehension, and somehow kills the loop interator. Yes, this is a well known design error in Python 2.x.

Re: Incorrect scope of list comprehension variables

2010-04-04 Thread Stephen Hansen
On 2010-04-04 17:01:20 -0700, Steven D'Aprano said: On Sun, 04 Apr 2010 05:50:01 -0700, Ethan Furman wrote: Yes, this has been fixed in later revisions, but I'm curious to know what led you to believe that a list comprehension created a new scope. I don't that was ever promised. Common sens

Re: Encryption source code with md5

2010-04-04 Thread Robert Kern
On 2010-04-04 17:44 , geremy condra wrote: On Sun, Apr 4, 2010 at 6:03 PM, Robert Kern wrote: On 2010-04-03 20:21 , Lawrence D'Oliveiro wrote: In message<4baf3ac4$0$22903$e4fe5...@news.xs4all.nl>, Irmen de Jong wrote: On 28-3-2010 12:08, Lawrence D'Oliveiro wrote: Don’t use MD5. Also, m

Re: (a==b) ? 'Yes' : 'No'

2010-04-04 Thread Steven D'Aprano
On Mon, 05 Apr 2010 12:08:31 +1200, Gregory Ewing wrote: > Steven D'Aprano wrote: > >> Not according to the PEP. No fewer than 16 alternatives were put to a >> vote, and with no clear winner (but many obvious losers) Guido made the >> final decision. > > As I remember, the decision made on the b

Re: Incorrect scope of list comprehension variables

2010-04-04 Thread Steven D'Aprano
On Sun, 04 Apr 2010 14:50:54 -0700, Paul Rubin wrote: > Alain Ketterlin writes: >> d[r] = [r for r in [4,5,6]] >> THe problem is that the "r" in d[r] somehow captures the value of the >> "r" in the list comprehension, and somehow kills the loop interator. > > Yes, this is a well known design

Re: Incorrect scope of list comprehension variables

2010-04-04 Thread Steven D'Aprano
On Sun, 04 Apr 2010 05:50:01 -0700, Ethan Furman wrote: >>>Yes, this has been fixed in later revisions, but I'm curious to know >>>what led you to believe that a list comprehension created a new scope. >>>I don't that was ever promised. >> >> >> Common sense about how programming languages shou

Re: reduce in loop

2010-04-04 Thread Terry Reedy
On 4/4/2010 7:46 PM, monkeys paw wrote: Why does the following fail with the Traceback? def add(x,y): return x+y for rrr in range(1,20): I presume that this was 'for r...' reduce(add, range(1, r)) and that this was indented. Traceback (most recent call last): File "", line 2, in TypeErr

Re: (a==b) ? 'Yes' : 'No'

2010-04-04 Thread Gregory Ewing
Steven D'Aprano wrote: Not according to the PEP. No fewer than 16 alternatives were put to a vote, and with no clear winner (but many obvious losers) Guido made the final decision. As I remember, the decision made on the basis of the vote was *not* to add a conditional expression at all, beca

Re: In disGuiodoise?

2010-04-04 Thread Steven D'Aprano
On Sun, 04 Apr 2010 19:06:18 +0200, Alf P. Steinbach wrote: > * Patrick Maupin: >> On Apr 4, 11:14 am, "Alf P. Steinbach" wrote: >>> "He walks among you, and you don't recognize him" - Old jungle proverb >>> >>> Hm, interesting Google results for that phrase. >> >> Interesting self-promotion :-)

Irony overload [was Re: off topic but please forgive me me and answer]

2010-04-04 Thread Steven D'Aprano
On Sun, 04 Apr 2010 08:00:41 -0700, rantingrick wrote: > A while back i had wondered why Guido never posts to c.l.py anymore. Was > it because he thinks himself better than us, no, it's because of the > "low-brow-infantile-Jerry-Springer-ish-nature" that this list has > imploded into. *puke* Comp

Re: reduce in loop

2010-04-04 Thread Benjamin Kaplan
On Sun, Apr 4, 2010 at 7:46 PM, monkeys paw wrote: > Why does the following fail with the Traceback? > > def add(x,y): return x+y > for rrr in range(1,20): >        reduce(add, range(1, r)) > > Traceback (most recent call last): >  File "", line 2, in > TypeError: reduce() of empty sequence with

reduce in loop

2010-04-04 Thread monkeys paw
Why does the following fail with the Traceback? def add(x,y): return x+y for rrr in range(1,20): reduce(add, range(1, r)) Traceback (most recent call last): File "", line 2, in TypeError: reduce() of empty sequence with no initial value -- http://mail.python.org/mailman/listinfo/pytho

Re: def method with variable no of parameters file.writeStuff(n, a1, a2, ...an)

2010-04-04 Thread alex23
"vlad_fig" wrote: > file.writeStuff(2,a1,a2) > file.writeStuff(3,a1,a2,a3) > > file.writeStuff(n,a1,a2,...an) > --- > so i want a method i can call based on the number of parameters > n , and that allows me to add these extra parameters based on n It's not necessary to have to specify the nu

Re: def method with variable no of parameters file.writeStuff(n, a1, a2, ...an)

2010-04-04 Thread Joaquin Abian
On Apr 2, 1:25 pm, "vlad_fig" wrote: > Hello all, > > I would like some help with setting up a method that would allow me to change > its number of parameters. For example: > > #- > class createfile(object): > > def __init__(self, > modelName = None, > someLines = None): > > s

Re: In disGuiodoise?

2010-04-04 Thread r
On Apr 4, 11:14 am, "Alf P. Steinbach" wrote: > > Perhaps Guido provides subtle guidance under some unrecognized nick? > "He walks among you, and you don't recognize him" - Old jungle proverb Ah yes i have often wondered who could it be? I have a few good suspects who could be Guido's sock-puppet

Re: def method with variable no of parameters file.writeStuff(n, a1, a2, ...an)

2010-04-04 Thread Iuri
What you need is var-args: def func(*args): for arg in args: print arg func(1,2,3,4) On Fri, Apr 2, 2010 at 8:25 AM, vlad_fig wrote: > Hello all, > > I would like some help with setting up a method that would allow me to > change its number of parameters. For example: > > #

Re: Encryption source code with md5

2010-04-04 Thread geremy condra
On Sun, Apr 4, 2010 at 6:03 PM, Robert Kern wrote: > On 2010-04-03 20:21 , Lawrence D'Oliveiro wrote: >> >> In message<4baf3ac4$0$22903$e4fe5...@news.xs4all.nl>, Irmen de Jong wrote: >> >>> On 28-3-2010 12:08, Lawrence D'Oliveiro wrote: >>> Don’t use MD5. >>> >>> Also, md5 is not an encryptio

Re: Getting Local MAC Address

2010-04-04 Thread Michael Torrie
On 04/02/2010 04:01 PM, Dan McLeran wrote: > which is why my OP stated the solution was for windows: > > "for windows parse > p.stdout.read():" Gotcha. Definitely missed that! -- http://mail.python.org/mailman/listinfo/python-list

def method with variable no of parameters file.writeStuff(n, a1, a2, ...an)

2010-04-04 Thread vlad_fig
Hello all, I would like some help with setting up a method that would allow me to change its number of parameters. For example: #- class createfile(object): def __init__(self, modelName = None, someLines = None): self.modelName = modelName if someLines is None: self.someL

Re: local variable referenced before assignment

2010-04-04 Thread Alf P. Steinbach
* Stephen Hansen: On 2010-04-04 15:22:48 -0700, Alf P. Steinbach said: * johngilbrough: I cannot make sense of what's happening here ... I'm getting the following error: (1) At least in Py3 you can declare the variable as 'global', like this: global lastModifiedTime within the function

Re: local variable referenced before assignment

2010-04-04 Thread Stephen Hansen
On 2010-04-04 15:22:48 -0700, Alf P. Steinbach said: * johngilbrough: I cannot make sense of what's happening here ... I'm getting the following error: (1) At least in Py3 you can declare the variable as 'global', like this: global lastModifiedTime within the function. Actually, what

Re: local variable referenced before assignment

2010-04-04 Thread Alf P. Steinbach
* johngilbrough: I cannot make sense of what's happening here ... I'm getting the following error: initializing last modified time /home/john/Dropbox/Projects/python/scripts/src 29 referencing last modified time /home/john/Dropbox/Projects/python/scripts/src 29 referencing last modified time Tr

Re: passing command line arguments to executable

2010-04-04 Thread Gabriel Genellina
On 4 abr, 06:17, Francesco Bochicchio wrote: > On 3 Apr, 19:20, mcanjo wrote: > > On Apr 3, 11:15 am, Patrick Maupin wrote: > > > On Apr 3, 11:09 am, mcanjo wrote: > > > > > I have an executable (I don't have access to the source code) that > > > > processes some data. I double click on the ico

local variable referenced before assignment

2010-04-04 Thread johngilbrough
I cannot make sense of what's happening here ... I'm getting the following error: initializing last modified time /home/john/Dropbox/Projects/python/scripts/src 29 referencing last modified time /home/john/Dropbox/Projects/python/scripts/src 29 referencing last modified time Traceback (most recen

Re: Incorrect scope of list comprehension variables

2010-04-04 Thread Paul Rubin
Alain Ketterlin writes: > d[r] = [r for r in [4,5,6]] > THe problem is that the "r" in d[r] somehow captures the value of the > "r" in the list comprehension, and somehow kills the loop interator. Yes, this is a well known design error in Python 2.x. The 3.x series fixes this error but intro

Re: Encryption source code with md5

2010-04-04 Thread Robert Kern
On 2010-04-03 20:21 , Lawrence D'Oliveiro wrote: In message<4baf3ac4$0$22903$e4fe5...@news.xs4all.nl>, Irmen de Jong wrote: On 28-3-2010 12:08, Lawrence D'Oliveiro wrote: Don’t use MD5. Also, md5 is not an encryption algorithm at all, it is a secure hashing function. You can use hash func

Re: C-style static variables in Python?

2010-04-04 Thread Patrick Maupin
On Apr 4, 1:57 pm, John Nagle wrote: >     If you want functions with state, use an object. That's what they're > for.  Don't muck with the internal representation of functions. > While "Don't muck with the internal representation of functions" is excellent advice over 99% of the time, it is also

Re: In disGuiodoise?

2010-04-04 Thread Emile van Sebille
On 4/4/2010 9:14 AM Alf P. Steinbach said... * ratingrick: A while back i had wondered why Guido never posts to c.l.py anymore. As I recall, about the time of the 1.6/2.0 schism (2000?) the primary developers split off as python had grown to the point where there was enough new user support

Re: In disGuiodoise?

2010-04-04 Thread John Nagle
Alf P. Steinbach wrote: * ratingrick: A while back i had wondered why Guido never posts to c.l.py anymore. Was it because he thinks himself better than us, no, it's because of the "low-brow-infantile-Jerry-Springer-ish-nature" that this list has imploded into. Maybe Google is making him do

Re: C-style static variables in Python?

2010-04-04 Thread John Nagle
kj wrote: When coding C I have often found static local variables useful for doing once-only run-time initializations. If you want functions with state, use an object. That's what they're for. Don't muck with the internal representation of functions. John N

Re: off topic but please forgive me me and answer

2010-04-04 Thread Lie Ryan
On 04/04/10 13:01, Patrick Maupin wrote: > On Apr 3, 9:24 pm, Steven D'Aprano cybersource.com.au> wrote: >> To put it another way, even though there are an infinite number of >> rationals, they are vanishingly rare compared to the irrationals. If you >> could choose a random number from the real n

Re: In disGuiodoise?

2010-04-04 Thread MRAB
Alf P. Steinbach wrote: * Patrick Maupin: On Apr 4, 11:14 am, "Alf P. Steinbach" wrote: "He walks among you, and you don't recognize him" - Old jungle proverb Hm, interesting Google results for that phrase. Interesting self-promotion :-) No, I'm not Guido. That's exactly what the true G

Re: In disGuiodoise?

2010-04-04 Thread Alf P. Steinbach
* Patrick Maupin: On Apr 4, 11:14 am, "Alf P. Steinbach" wrote: "He walks among you, and you don't recognize him" - Old jungle proverb Hm, interesting Google results for that phrase. Interesting self-promotion :-) No, I'm not Guido. Cheers, - Alf -- http://mail.python.org/mailman/listin

Re: In disGuiodoise?

2010-04-04 Thread Patrick Maupin
On Apr 4, 11:14 am, "Alf P. Steinbach" wrote: > "He walks among you, and you don't recognize him" - Old jungle proverb > > Hm, interesting Google results for that phrase. Interesting self-promotion :-) http://www.google.com/#q=%22He+walks+among+you,+and+you+don%27t+recognize+him%22&hl=en&safe=of

Re: off topic but please forgive me me and answer

2010-04-04 Thread Patrick Maupin
On Apr 4, 10:00 am, rantingrick wrote: > This is amazing, how can such an off topic post based completely on > lunacy exist so long here? 54 posts and counting. I think i had this > very argument in grade school. We have SD'A, Tim Chase, MSRB, and yes > even Steve Holden again participating in th

In disGuiodoise?

2010-04-04 Thread Alf P. Steinbach
* ratingrick: A while back i had wondered why Guido never posts to c.l.py anymore. Was it because he thinks himself better than us, no, it's because of the "low-brow-infantile-Jerry-Springer-ish-nature" that this list has imploded into. Perhaps Guido provides subtle guidance under some unreco

Re: Is there a standard name for this tree structure?

2010-04-04 Thread Patrick Maupin
On Apr 4, 10:41 am, Patrick Maupin wrote: > The primary differences between this structure and just haphazardly > wiring up random objects into a directed graph are that (1) there may > be some performance differences (but when the garbage collector has to > figure out how to break cycles, these

Re: Is there a standard name for this tree structure?

2010-04-04 Thread Patrick Maupin
On Apr 4, 9:06 am, Duncan Booth wrote: > Do you have any carniverous apes? If so it's a directed acyclic graph. Well, since he has a root node, he's really only described the *use* of this data structure implementation for a rooted tree. As you point out, the implementation itself is more genera

Re: off topic but please forgive me me and answer

2010-04-04 Thread superpollo
rantingrick ha scritto: On Apr 1, 3:44 pm, superpollo wrote: how much is one half times one half? This is amazing, how can such an off topic post based completely on lunacy exist so long here? 54 posts and counting. I think i had this very argument in grade school. We have SD'A, Tim Chase, MS

Re: Is there a standard name for this tree structure?

2010-04-04 Thread Stefan Behnel
Steven D'Aprano, 04.04.2010 14:10: I have a hierarchical structure something like a directory tree or a nested tree structure: Mammal +-- Ape : +-- Chimpanzee : +-- Gorilla : +-- Human +-- Carnivore : +-- Cat : +-- Tiger Reptile +-- Lizard +-- Snake +-- Cobra +-- Python

Re: Splitting a string

2010-04-04 Thread Patrick Maupin
On Apr 4, 2:37 am, Steven D'Aprano wrote: > In any case, the *right* test would be: > > a = 1 > assert a == 1 and a*5==5 and str(a)=='1' and [None,a,None][a] is a You're right. I was very tired when I wrote that, and forgot the last 3 assertions... -- http://mail.python.org/mailman/listinfo/py

Re: Splitting a string

2010-04-04 Thread Patrick Maupin
On Apr 4, 4:58 am, Peter Otten <__pete...@web.de> wrote: > Personally, though, I prefer unit tests over assertions. IMO, the primary use cases for assertions and unit tests are not the same. When I have a well-defined, clearly understood specification that I am coding to and fully implementing w

Re: off topic but please forgive me me and answer

2010-04-04 Thread rantingrick
On Apr 1, 3:44 pm, superpollo wrote: > how much is one half times one half? This is amazing, how can such an off topic post based completely on lunacy exist so long here? 54 posts and counting. I think i had this very argument in grade school. We have SD'A, Tim Chase, MSRB, and yes even Steve Hol

Re: Incorrect scope of list comprehension variables

2010-04-04 Thread Brian Blais
On Apr 4, 2010, at 3:17 , Stephen Hansen wrote: Where exactly does this common sense come from? A list comprehension is basically syntactic sugar over a for loop, and... well, since I've been bitten by this particular wart, I was surprised to see that the list comp didn't have it's own sco

Re: Is there a standard name for this tree structure?

2010-04-04 Thread Duncan Booth
Steven D'Aprano wrote: > I have a hierarchical structure something like a directory tree or a > nested tree structure: > > Mammal > +-- Ape >: +-- Chimpanzee >: +-- Gorilla >: +-- Human > +-- Carnivore >: +-- Cat >: +-- Tiger > Reptile > +-- Lizard > +-- Snake > +-- Cobra >

Re: Incorrect scope of list comprehension variables

2010-04-04 Thread D'Arcy J.M. Cain
On Sun, 04 Apr 2010 15:06:46 +0200 "Alf P. Steinbach" wrote: > Common sense is applied first, as a heuristic. You really wouldn't want to > drill > down into the architect's drawings in order to get office 215 in a building. > First you apply common sense. Oh goodie, bad analogies. Can I play

Re: Incorrect scope of list comprehension variables

2010-04-04 Thread Alf P. Steinbach
* Ethan Furman: Steve Howell wrote: On Apr 3, 9:58 pm, Tim Roberts wrote: Alain Ketterlin wrote: I've just spent a few hours debugging code similar to this: d = dict() for r in [1,2,3]: d[r] = [r for r in [4,5,6]] print d Yes, this has been fixed in later revisions, but I'm curious

Re: Incorrect scope of list comprehension variables

2010-04-04 Thread Ethan Furman
Steve Howell wrote: On Apr 3, 9:58 pm, Tim Roberts wrote: Alain Ketterlin wrote: I've just spent a few hours debugging code similar to this: d = dict() for r in [1,2,3]: d[r] = [r for r in [4,5,6]] print d Yes, this has been fixed in later revisions, but I'm curious to know what led

Re: Is there a standard name for this tree structure?

2010-04-04 Thread Alf P. Steinbach
* Steven D'Aprano: I have a hierarchical structure something like a directory tree or a nested tree structure: Mammal +-- Ape : +-- Chimpanzee : +-- Gorilla : +-- Human +-- Carnivore : +-- Cat : +-- Tiger Reptile +-- Lizard +-- Snake +-- Cobra +-- Python This is a forest

Is there a standard name for this tree structure?

2010-04-04 Thread Steven D'Aprano
I have a hierarchical structure something like a directory tree or a nested tree structure: Mammal +-- Ape : +-- Chimpanzee : +-- Gorilla : +-- Human +-- Carnivore : +-- Cat : +-- Tiger Reptile +-- Lizard +-- Snake +-- Cobra +-- Python This is a forest because each top-leve

Re: passing command line arguments to executable

2010-04-04 Thread Simon Brunning
On 3 April 2010 18:20, mcanjo wrote: > I tried doing the following code: > > from subprocess import Popen > from subprocess import PIPE, STDOUT > exefile = Popen('pmm.exe', stdout = PIPE, stdin = PIPE, stderr = > STDOUT) > exefile.communicate('MarchScreen.pmm\nMarchScreen.out')[0] > > and the Comm

Re: off topic but please forgive me me and answer

2010-04-04 Thread Andreas Waldenburger
On Sun, 4 Apr 2010 13:59:57 +0200 Andreas Waldenburger wrote: > Computers by themselves have as much a notion of Rationals as they > have of Irrationals, or, for that matter, the cuteness puppies. Strike that. Floats in computers are Rationals. So computers do know them. However, they are still

Re: off topic but please forgive me me and answer

2010-04-04 Thread Andreas Waldenburger
On Sat, 3 Apr 2010 23:13:51 -0700 (PDT) Mensanator wrote: > On Apr 3, 9:03 pm, Steven D'Aprano cybersource.com.au> wrote: > > On Sat, 03 Apr 2010 09:35:34 -0700, Mensanator wrote: > > > On Apr 3, 10:17 am, Steven D'Aprano > > cybersource.com.au> wrote: > > >> But you're not multiplying four num

Re: Is there any library for indexing binary data?

2010-04-04 Thread Albert van der Horst
In article , =?GB2312?B?zPC5zw==?= wrote: >Well, Database is not proper because 1. the table is very big (~10^9 >rows) 2. we should support very fast *simple* query that is to get >value corresponding to single key (~10^7 queries / second). > >Currently, I have implemented a specific algorithm to

Re: How to access args as a list?

2010-04-04 Thread Francesco Bochicchio
On 4 Apr, 00:58, kj wrote: > Suppose I have a function with the following signature: > > def spam(x, y, z): >     # etc. > > Is there a way to refer, within the function, to all its arguments > as a single list?  (I.e. I'm looking for Python's equivalent of > Perl's @_ variable.) > > I'm aware of

Re: Splitting a string

2010-04-04 Thread Peter Otten
Steven D'Aprano wrote: > On Sat, 03 Apr 2010 11:17:36 +0200, Peter Otten wrote: > >>> That's certainly faster than a list comprehension (at least on long >>> lists), but it might be a little obscure why the "if not s:" is needed, >> >> The function is small; with a test suite covering the corner

Re: passing command line arguments to executable

2010-04-04 Thread Francesco Bochicchio
On 3 Apr, 19:20, mcanjo wrote: > On Apr 3, 11:15 am, Patrick Maupin wrote: > > > > > On Apr 3, 11:09 am, mcanjo wrote: > > > > I have an executable (I don't have access to the source code) that > > > processes some data. I double click on the icon and a Command prompt > > > window pops up. The p

Re: vars().has_key() question about how working .

2010-04-04 Thread Chris Rebert
Ah, (bleep). Disregard both my responses. Darn headache. Cheers, Chris -- Definitely going to bed now. http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list

Re: vars().has_key() question about how working .

2010-04-04 Thread Chris Rebert
> 2010/4/4 Chris Rebert >> >> On Sun, Apr 4, 2010 at 1:42 AM, catalinf...@gmail.com >> wrote: >> > Hi everyone . >> > My questions is "why vars().has_key('b') is False ?' >> > I expecting to see "True" because is a variable ... >> >> The built-in constants and functions aren't global variables, t

Re: vars().has_key() question about how working .

2010-04-04 Thread Cata
So is not possible to testing if a variable is defined with this functions vars(), globals(), locals() ? Or maybe i make confusion with another issue. Please more specific ... Thank you 2010/4/4 Chris Rebert > On Sun, Apr 4, 2010 at 1:42 AM, catalinf...@gmail.com > wrote: > > Hi everyone . > >

Re: vars().has_key() question about how working .

2010-04-04 Thread Paul McGuire
On Apr 4, 3:42 am, "catalinf...@gmail.com" wrote: > Hi everyone . > My questions is "why vars().has_key('b') is False ?' > I expecting to see "True" because is a variable ... > Thanks Yes, 'b' is a var, but only within the scope of something(). See how this is different: >>> def sth(): ... b

Re: vars().has_key() question about how working .

2010-04-04 Thread Chris Rebert
On Sun, Apr 4, 2010 at 1:42 AM, catalinf...@gmail.com wrote: > Hi everyone . > My questions is "why vars().has_key('b') is False ?' > I expecting to see "True" because is a variable ... The built-in constants and functions aren't global variables, they're in the special __builtins__ dictionary/na

vars().has_key() question about how working .

2010-04-04 Thread catalinf...@gmail.com
Hi everyone . My questions is "why vars().has_key('b') is False ?' I expecting to see "True" because is a variable ... Thanks Please see code bellow . >>> x=11 >>> def something(): ... b=25 ... >>> vars().has_key('x') True >>> vars().has_key('b') False >>> globals().has_key('x') True >>> global

"JOBS IN CALIFORNIA" "jobs in california orange county" "jobs in california for british" "jobs in california los angeles" "jobs in california usa" "california jobs" "california jobs for canadians" ON

2010-04-04 Thread saima81
"JOBS IN CALIFORNIA" "jobs in california orange county" "jobs in california for british" "jobs in california los angeles" "jobs in california usa" "california jobs" "california jobs for canadians" ON http://jobsincalifornia-usa.blogspot.com/ "JOBS IN CALIFORNIA" "jobs in california orange coun

Re: Splitting a string

2010-04-04 Thread Steven D'Aprano
On Sat, 03 Apr 2010 20:10:20 -0700, Patrick Maupin wrote: > On Apr 3, 10:00 pm, Steven D'Aprano cybersource.com.au> wrote: >> Tests which you know can't fail are called assertions, pre-conditions >> and post-conditions. We test them because if we don't, they will fail >> :) > > Well, yes, but th

Re: Incorrect scope of list comprehension variables

2010-04-04 Thread Stephen Hansen
On 2010-04-03 23:30:32 -0700, Steve Howell said: On Apr 3, 9:58 pm, Tim Roberts wrote: Alain Ketterlin wrote: I've just spent a few hours debugging code similar to this: d = dict() for r in [1,2,3]:    d[r] = [r for r in [4,5,6]] print d Yes, this has been fixed in later revisions, but