Re: CVS access with Python

2008-02-08 Thread A.T.Hofkamp
On 2008-02-07, Steve Holden <[EMAIL PROTECTED]> wrote: > Ravi Kumar wrote: >> I have to design a Web-based CVS client. I could not find any module, >> cvs-binding in python. There isn't any afaik. CVS was never designed with scripting in mind. You'll have to issue the command, then parse the text

Re: print 'hello' -> SyntaxError: invalid syntax

2008-02-08 Thread ValdezDE
On Feb 7, 10:21 pm, ajaksu <[EMAIL PROTECTED]> wrote: > On Feb 7, 12:52 pm, [EMAIL PROTECTED] wrote: > > > I try to install Python in a Dell D620 with XP PRO version 5.1.2600 > > and I am getting this error. I assume that some dlls are missing but I > > installed form a fresh python-2.5.1.msi with

shelve.open call gives error

2008-02-08 Thread waltbrad
Working through the Mark Lutz book Programming Python 3rd Edition. A couple of modules in the "Preview" chapter give me errors. Both on a shelve.open call: Pretty simple code, (2nd example): =code begin= import shelve from people import Person, Manager bob = Person('Bob Smith', 42, 3

Re: Why does list have no 'get' method?

2008-02-08 Thread cokofreedom
On Feb 8, 8:23 am, Carl Banks <[EMAIL PROTECTED]> wrote: > On Feb 7, 8:44 am, Steve Holden <[EMAIL PROTECTED]> wrote: > > > [EMAIL PROTECTED] wrote: > > > I'd like to know what others think about it, about this anti-feature. > > > What I can say is that other computer languages too think that boole

__builtins__

2008-02-08 Thread loquehumaine
Hi there, I'm a newby in python (I know a little in programmation) and I have a lot of questions on builtins but my first one is about modules... I have seen that if I type help() at a prompt, and then 'modules', I'll be given a list of all modules available, thanks to this group.. But I have s

Re: Pure Python Salsa20 Stream Cipher Implementation

2008-02-08 Thread Paul Rubin
[EMAIL PROTECTED] writes: > for those of you who are familiar with the micropledge.com project, > here is a good opportunity to spend or earn something: > http://micropledge.com/projects/pysalsa20 I don't understand why a pure python version of salsa20 would be interesting. Is there some applicat

Re: Pure Python Salsa20 Stream Cipher Implementation

2008-02-08 Thread Paul Rubin
[EMAIL PROTECTED] writes: > for those of you who are familiar with the micropledge.com project, > here is a good opportunity to spend or earn something: > http://micropledge.com/projects/pysalsa20 By the way, here is a concise implementation of salsa20 in C: http://www.nightsong.com/phr/crypto/

Re: __builtins__

2008-02-08 Thread Marc 'BlackJack' Rintsch
On Fri, 08 Feb 2008 00:25:14 -0800, loquehumaine wrote: > I have seen that if I type help() at a prompt, and then 'modules', > I'll be given a list of all modules available, thanks to this group.. > But I have seen the differences between them and the one in > dir(__builtins__). > Why are some mod

Re: a trick with lists ?

2008-02-08 Thread "S�bastien Vincent"
Thank you, that's very clear indeed. "Helmut Jarausch" <[EMAIL PROTECTED]> a écrit dans le message de news: [EMAIL PROTECTED] > Sébastien Vincent > I've found some class on the Net which takes basically this form : >> >> ## >> class Foo: >> def __init__(self): >> self.tasks = []

Re: a trick with lists ?

2008-02-08 Thread Matthew_WARREN
> On Feb 7, 12:20 pm, "Sébastien Vincent" free.fr> > wrote: > > I've found some class on the Net which takes basically this form : > > > > ## > > class Foo: > > def __init__(self): > > self.tasks = [] > >... > > > > def method1(self): > > tasks = [] > > w

Re: Chinese character error

2008-02-08 Thread Chris
On Feb 8, 11:29 am, John Deas <[EMAIL PROTECTED]> wrote: > Hi, > > I made a small script to recursively copy files from a directory tree > to an exportDir only if they have an mp3 extension : > > a=os.walk(os.getcwd()) > for root, dirs, files in a: > for currFile in files: >

Re: a trick with lists ?

2008-02-08 Thread Helmut Jarausch
Sébastien Vincent I've found some class on the Net which takes basically this form : > > ## > class Foo: > def __init__(self): > self.tasks = [] >... > > def method1(self): > tasks = [] > while True: > ... > append/pop elements into/from tasks > ...

Chinese character error

2008-02-08 Thread John Deas
Hi, I made a small script to recursively copy files from a directory tree to an exportDir only if they have an mp3 extension : a=os.walk(os.getcwd()) for root, dirs, files in a: for currFile in files: pathCurrFile=os.path.join(root, currFile) if mp3Reg.sear

Re: Why not a Python compiler?

2008-02-08 Thread jack trades
"Santiago Romero" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Why not a Python COMPILER? Check out CLPython it has a Python compiler, though I highly doubt it is what you are thinking of. >From http://common-lisp.net/project/clpython/manual.html Sometimes, the generated Pyth

Re: __builtins__

2008-02-08 Thread LHB
Marc 'BlackJack' Rintsch a écrit : > On Fri, 08 Feb 2008 00:25:14 -0800, loquehumaine wrote: > >> I have seen that if I type help() at a prompt, and then 'modules', >> I'll be given a list of all modules available, thanks to this group.. >> But I have seen the differences between them and the one

Re: Why not a Python compiler?

2008-02-08 Thread Ryszard Szopa
On Feb 8, 12:25 am, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: > > Be fair -- he's asking what specific features of Python make it > > hard. That's a reasonable question. > > Indeed. The best explanation I've seen explained goes something like > this: i

Re: Distinguishing between functions and methods in a decorator.

2008-02-08 Thread Berteun Damman
On Thu, 07 Feb 2008 18:22:03 +0100, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Can you provide an example of what you are actually after? The > descriptor-protocol might come to use there. Thanks for your responses. I have read the Descriptor protocol how-to, which clarifies method access on o

Need Smart Phone with new features? please click here

2008-02-08 Thread Farooq
www.enmac.com.hk GSM Mobile Phones, Digital iPods, Digital Clocks, Digital Pens, Digital Quran. Enjoy these products with Islamic Features (Complete Holy Quran with Text and Audio, Tafaseer books, Ahadees Books, Daily Supplications, Universal Qibla Direction, Prayer Timing and much more) visit our

Re: Small problem executing python script as shortcut

2008-02-08 Thread Jorgen Bodde
Hi Larry, Sorry for accidentally mailing you personally. I fixed the problem, it was a problem with the search path, and once that was fixed it works fine! thanks again, - Jorgen On Feb 8, 2008 9:26 AM, Jorgen Bodde <[EMAIL PROTECTED]> wrote: > Hi Larry, > > > Sure there is. Just put double quo

Re: Why does list have no 'get' method?

2008-02-08 Thread Matthew_WARREN
> > val = BETTER foo THAN bar > > > > ;-) > > > > Cobol-strikes-back-ly yours, > > > > George > > I use a ETL language/tool that actually has a function for this kind > of thing: > > NulltoValue(value,defaultValue) > > it returns defaultValue if value is null otherwise value. even Ksh has one

Re: Why not a Python compiler?

2008-02-08 Thread Grant Edwards
On 2008-02-07, Jeroen Ruigrok van der Werven <[EMAIL PROTECTED]> wrote: > -On [20080207 22:09], Reedick, Andrew ([EMAIL PROTECTED]) wrote: >>Errr... didn't one of the novels explain it away by describing the >>kessel run as a region of space warped by black holes or other objects? >>Bragging rights

Re: How to autorun a python script when a specific user logs on?

2008-02-08 Thread jack trades
"Wolfgang Draxinger" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > jack trades wrote: > > > Honestly I never even thought of that, it just sounded like a > > fun, and easy, > > project to put my mediocre programming skills to some use. > > However his main concern is internet predat

Re: brain stuck. whats occurring here?

2008-02-08 Thread Steve Holden
Ben Finney wrote: > "Mariano Suárez-Alvarez" <[EMAIL PROTECTED]> writes: > >> On Feb 7, 3:38 pm, [EMAIL PROTECTED] wrote: >>> [disclaimer dozens of lines long] >> Is this absurd signature really necessary? > > No. > > http://www.goldmark.org/jeff/stupid-disclaimers/> > "Necessary" is depend

Re: Using a signal to terminate a programm running with an asyncore loop

2008-02-08 Thread Larry Bates
[EMAIL PROTECTED] wrote: > I'm developing a program that runs using an asyncore loop. Right now > I can adequately terminate it using Control-C, but as things get > refined I need a better way to stop it. I've developed another > program that executes it as a child process using popen2.Popen4().

Re: How to autorun a python script when a specific user logs on?

2008-02-08 Thread Wolfgang Draxinger
jack trades wrote: > Honestly I never even thought of that, it just sounded like a > fun, and easy, > project to put my mediocre programming skills to some use. > However his main concern is internet predators (too much > Dateline I think) not porn, I should > have worded it differently in the OP

Re: re question

2008-02-08 Thread Hyuga
On Feb 7, 1:47 pm, Amit Gupta <[EMAIL PROTECTED]> wrote: > On Feb 7, 10:38 am, Amit Gupta <[EMAIL PROTECTED]> wrote: > > > > > Python'ites > > > I searched around "google" to find the answer to this question, but I > > can't: > > > I have a named regexp : x = re.compile("(?P[a-z]+)") > > > What I w

Re: Why does list have no 'get' method?

2008-02-08 Thread pruebauno
On Feb 7, 4:36 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > On Feb 7, 4:25 pm, Steven D'Aprano <[EMAIL PROTECTED] > > > > cybersource.com.au> wrote: > > On Thu, 07 Feb 2008 15:59:13 +0100, Wildemar Wildenburger wrote: > > > Arnaud Delobelle wrote: > > >> Personally, between > > > >> * foo if foo

Time conversion between UTC and local time

2008-02-08 Thread andreas . profous
Hi all, I have the following problem: There are strings describing a UTC time, e.g. " 2008-01-15 22:32:30" and a string reflecting the time zone e.g. "-05:00". What is an elegant way of getting the local time (considering DST - daylight saving time) with that data? The date is not important, just

Re: keyword 'in' not returning a bool?

2008-02-08 Thread Richard Brodie
"c james" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] 't' in sample == True > False It's comparison operator chaining: 't' in sample == True is like 't' == sample == True and is equivalent to 't' in sample and sample == True -- http://mail.python.org/mailman/listinfo

RE: keyword 'in' not returning a bool?

2008-02-08 Thread Reedick, Andrew
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of c james > Sent: Friday, February 08, 2008 12:10 PM > To: python-list@python.org > Subject: keyword 'in' not returning a bool? > > Try this > > >>> sample = {'t':True, 'f':False} > >>> 't' in

Re: keyword 'in' not returning a bool?

2008-02-08 Thread Larry Bates
c james wrote: > Try this > sample = {'t':True, 'f':False} 't' in sample > True type('t' in sample) > 't' in sample == True > False > > Why is this? Now try bool('t' in sample) == True > True > > Can someone explain what is going on? > Precedence. In: 't' in sample

Re: shelve.open call gives error

2008-02-08 Thread jim-on-linux
On Friday 08 February 2008 12:10, jim-on-linux wrote: > On Friday 08 February 2008 03:36, waltbrad > > wrote: > > Working through the Mark Lutz book > > Programming Python 3rd Edition. > > > > A couple of modules in the "Preview" > > chapter give me errors. Both on a > > shelve.open call: > > > >

keyword 'in' not returning a bool?

2008-02-08 Thread c james
Try this >>> sample = {'t':True, 'f':False} >>> 't' in sample True >>> type('t' in sample) >>> 't' in sample == True False Why is this? Now try >>> bool('t' in sample) == True True Can someone explain what is going on? -- http://mail.python.org/mailman/listinfo/python-list

Re: Why not a Python compiler?

2008-02-08 Thread Hrvoje Niksic
Ryszard Szopa <[EMAIL PROTECTED]> writes: >> The main determinant of Python's performance isn't the interpreter >> overhead, but the amount of work that must be done at run-time and >> cannot be moved to compile-time or optimized away. > > Well, I am still not convinced that Python is intrinsicall

Re: How to identify which numbers in a list are within each others' range

2008-02-08 Thread Paul McGuire
On Jan 31, 10:12 am, erikcw <[EMAIL PROTECTED]> wrote: > Hi, > > I have a list of numbers each with a +/- margin of error.  I need to > identify which ones overlab each other. > Here's my proposal, using arithmetic instead of sets. Looking at the problem graphically, I drew different numberlines:

Re: Microsoft's challenger to Python

2008-02-08 Thread Steve Holden
Daniel Fetchinson wrote: >>> > I am not, however, an in depth language nutter, so would >>> > appreciate any of our more learned readers comments. > > Maybe I'm missing the obvious here, but what does Cobra have to do > with Microsoft? > (Apart from being .NET oriented.) It seems it's an open so

Re: Time conversion between UTC and local time

2008-02-08 Thread Jeroen Ruigrok van der Werven
-On [20080208 15:16], [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote: >What is an elegant way of getting the local time (considering DST - >daylight saving time) with that data? Perhaps using pytz might be the easiest way: http://pytz.sourceforge.net/ -- Jeroen Ruigrok van der Werven / a

Re: Using a signal to terminate a programm running with an asyncore loop

2008-02-08 Thread [EMAIL PROTECTED]
On Feb 8, 7:04 am, Larry Bates <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I'm developing a program that runs using an asyncore loop. Right now > > I can adequately terminate it using Control-C, but as things get > > refined I need a better way to stop it. I've developed another > >

RE: Dear David

2008-02-08 Thread Blubaugh, David A.
Steve, I have discontinued the use of ?? a long time ago. Why is this still a problem? David -Original Message- From: Steve Holden [mailto:[EMAIL PROTECTED] Sent: Friday, February 08, 2008 10:52 AM To: python-list@python.org Subject: Re: Dear David Dan Upton wrote: > On

Re: keyword 'in' not returning a bool?

2008-02-08 Thread Patrick Dwyer
'in' has a lower operator precedence than '==' ('t' in sample) == True would fix the operator precedence. On Feb 8, 2008 11:09 AM, c james <[EMAIL PROTECTED]> wrote: > Try this > > >>> sample = {'t':True, 'f':False} > >>> 't' in sample > True > >>> type('t' in sample) > > >>> 't' in sample ==

Re: are elements of a list in sequence in list b

2008-02-08 Thread Paul Hankin
[EMAIL PROTECTED] wrote: > I need to search list a for the sequence of list b def list_contains(a, b): return any(a[i:i+len(b)] == b for i in range(len(a) - len(b) + 1)) list_contains(range(1, 7), [2, 3, 4]) -- Paul Hankin -- http://mail.python.org/mailman/listinfo/python-list

Re: shelve.open call gives error

2008-02-08 Thread jim-on-linux
On Friday 08 February 2008 03:36, waltbrad wrote: > Working through the Mark Lutz book > Programming Python 3rd Edition. > > A couple of modules in the "Preview" > chapter give me errors. Both on a > shelve.open call: > > Pretty simple code, (2nd example): from; jim-on-linux http://[EMAIL PROTEC

Re: Dear David

2008-02-08 Thread Daniel Fetchinson
> I have discontinued the use of ?? a long time ago. Why is this > still a problem? Welcome to bewildering yet joyful world of usenet! It seems you are already having quite some fun! -- http://mail.python.org/mailman/listinfo/python-list

multi-Singleton-like using __new__

2008-02-08 Thread Freek Dijkstra
Is there a best practice on how to override __new__? I have a base class, RDFObject, which is instantiated using a unique identifier (a URI in this case). If an object with a given identifier already exists, I want to return the existing object, otherwise, I want to create a new object and add thi

are elements of a list in sequence in list b

2008-02-08 Thread Matthew_WARREN
Hallo, I need to search list a for the sequence of list b First I went >>> a=[1,2,34,4,5,6] >>> b=[2,3,4] >>> a in b False So ''.join([ v.__str__() for v in b ]) in ''.join([ v.__str__() for v in a ]) >>> s=SomeObject() >>> a=[1,2,3,[s,3,[4,s,9]],s,4] >>> b=[3,[s,3,[4,s,9]],s,4] >>> ''.join([

Re: Dear David

2008-02-08 Thread Steve Holden
Dan Upton wrote: > On Feb 7, 2008 8:59 PM, ajaksu <[EMAIL PROTECTED]> wrote: >> On Feb 7, 10:05 pm, "Blubaugh, David A." <[EMAIL PROTECTED]> wrote: >>> I do not understand why people such as yourself cannot construct >>> anything but insults and complaints. >> I can help with that. People asked pol

Re: Why does list have no 'get' method?

2008-02-08 Thread Carl Banks
On Feb 8, 3:38 am, [EMAIL PROTECTED] wrote: > Can't you just make a subclass of Boolean and add methods to the true/ > false, or am i running up a tree with a cat? I'm not sure what point you were trying to make, but no you can't subclass bool in Python as it is now; certainly it wouldn't be possi

Re: OT: Star Wars and parsecs [was Re: Why not a Python compiler?]

2008-02-08 Thread Grant Edwards
On 2008-02-08, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > A Parsec is a fixed value (which, admittedly, presumes the culture > developed a 360degree circle broken into degrees => minutes => > seconds... or, at least, some units compatible with the concept of an > "arc second", like 400 g

Re: Microsoft's challenger to Python

2008-02-08 Thread Dotan Cohen
On 08/02/2008, Steve Holden <[EMAIL PROTECTED]> wrote: > Daniel Fetchinson wrote: > >>> > I am not, however, an in depth language nutter, so would > >>> > appreciate any of our more learned readers comments. > > > > Maybe I'm missing the obvious here, but what does Cobra have to do > > with

Critique of first python code

2008-02-08 Thread Zack
Hi all. I'm just starting to pick up python. I wanted to play with nested lists so first I wrote a little bit of code to create arbitrarily nested lists (grow). Then I wrote a breadth first search. I'm putting this small snippet up asking for criticism. Was there a more elegant way to do what I'm

Re: OT: Star Wars and parsecs [was Re: Why not a Python compiler?]

2008-02-08 Thread Lou Pecora
In article <[EMAIL PROTECTED]>, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2008-02-08, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > > > A Parsec is a fixed value (which, admittedly, presumes the culture > > developed a 360degree circle broken into degrees => minutes => > > seconds... or

Re: shelve.open call gives error

2008-02-08 Thread jim-on-linux
On Friday 08 February 2008 03:36, waltbrad wrote: > Working through the Mark Lutz book > Programming Python 3rd Edition. > > A couple of modules in the "Preview" > chapter give me errors. Both on a > shelve.open call: > > Pretty simple code, (2nd example): > =code begin= > import shelve >

MyHDL project!

2008-02-08 Thread Blubaugh, David A.
From: Dan Fabrizio [mailto:[EMAIL PROTECTED] Sent: Friday, February 08, 2008 2:56 PM To: Blubaugh, David A. Subject: Re: MyHDL project ! David, No problem with the mailing list, others might have some experience that could be useful. Let me know how yo

Re: What do Python IDEs use for the member drop-down?

2008-02-08 Thread Larry Bates
[EMAIL PROTECTED] wrote: > I realize in the new style, getattr and setattr are supposed to > reference something in a base class, but here is what I'm trying to > do: > > class tryit: > def __init__(self, a, b): > self.__dict__["a"] = a > self.__dict__["b"] = b > def __dir_

Re: Critique of first python code

2008-02-08 Thread Arnaud Delobelle
On Feb 8, 7:20 pm, "Zack" <[EMAIL PROTECTED]> wrote: > Hi all. I'm just starting to pick up python. I wanted to play with nested > lists so first I wrote a little bit of code to create arbitrarily nested > lists (grow). Then I wrote a breadth first search.  I'm putting this small > snippet up askin

Re: brain stuck. whats occurring here?

2008-02-08 Thread Gabriel Genellina
En Fri, 08 Feb 2008 13:58:53 -0200, Steve Holden <[EMAIL PROTECTED]> escribió: >> "Mariano Suárez-Alvarez" <[EMAIL PROTECTED]> writes: >>> On Feb 7, 3:38 pm, [EMAIL PROTECTED] wrote: [disclaimer dozens of lines long] >>> Is this absurd signature really necessary? > That particular trailing

Re: are elements of a list in sequence in list b

2008-02-08 Thread Arnaud Delobelle
On Feb 8, 5:06 pm, Paul Hankin <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I need to search list a for the sequence of list b > > def list_contains(a, b): >     return any(a[i:i+len(b)] == b for i in range(len(a) - len(b) + 1)) > > list_contains(range(1, 7), [2, 3, 4]) > > -- > Paul H

Re: Critique of first python code

2008-02-08 Thread George Sakkis
On Feb 8, 3:40 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > On Feb 8, 7:20 pm, "Zack" <[EMAIL PROTECTED]> wrote: > > > > > Hi all. I'm just starting to pick up python. I wanted to play with nested > > lists so first I wrote a little bit of code to create arbitrarily nested > > lists (grow). T

Re: keyword 'in' not returning a bool?

2008-02-08 Thread Arnaud Delobelle
On Feb 8, 5:09 pm, c james <[EMAIL PROTECTED]> wrote: > Try this > > >>> sample = {'t':True, 'f':False} > >>> 't' in sample > True > >>> type('t' in sample) > > >>> 't' in sample == True > > False > > Why is this?  Now try>>> bool('t' in sample) == True > > True > > Can someone explain what is goi

RE: Why not a Python compiler?

2008-02-08 Thread Reedick, Andrew
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of Grant Edwards > Sent: Friday, February 08, 2008 12:46 PM > To: python-list@python.org > Subject: Re: Why not a Python compiler? > > On 2008-02-08, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: >

Re: Why does list have no 'get' method?

2008-02-08 Thread Gabriel Genellina
En Fri, 08 Feb 2008 13:24:19 -0200, <[EMAIL PROTECTED]> escribió: > > Matt. > (would it help if I put lots of blank lines after this, so the disclaimer > is out-of-sight/out-of-mind?) > -- > ie, from here on? No, what would help is a line containing *exactly* (dash)(dash)(space)(newline) That

Re: are elements of a list in sequence in list b

2008-02-08 Thread Tomek Paczkowski
[EMAIL PROTECTED] wrote: > Hallo, > > > I need to search list a for the sequence of list b > I guess most pythonic would be sth like this: [code] def naive_seq_match(sequence, pattern): """Serches for pattern in sequence. If pattern is found returns match start index, else returns No

Re: socket script from perl -> python

2008-02-08 Thread Sion Arrowsmith
Hrvoje Niksic <[EMAIL PROTECTED]> wrote: >kettle <[EMAIL PROTECTED]> writes: >> # pack $length as a 32-bit network-independent long >> my $len = pack('N', $length); >[...] >> the sticking point seems to be the $len variable. >Use len = struct.pack('!L', length) in Python. See >http://docs.python.

Re: How to autorun a python script when a specific user logs on?

2008-02-08 Thread cokofreedom
On Feb 8, 1:30 am, "jack trades" <[EMAIL PROTECTED]> wrote: > "Mike Hjorleifsson" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > on windows you can put this in HKEY_Local_Machine\Software\Microsoft > > \Windows\Current Version\Run and it will run at logon (or fast user > > sw

OT: New Hope [was Re: Why not a Python compiler?]

2008-02-08 Thread Steven D'Aprano
On Fri, 08 Feb 2008 08:25:56 +0100, Torsten Bronger wrote: > Hallöchen! > > Reedick, Andrew writes: > >>> -Original Message- >>> From: [EMAIL PROTECTED] [mailto:python- >>> [EMAIL PROTECTED] On Behalf Of Torsten Bronger >>> Sent: Thursday, February 07, 2008 3:32 PM To: python-list@python

how to run python script on remote machine

2008-02-08 Thread Praveena Boppudi (c)
Hi, Can anyone help me in executing python scripts on remote computer? Both are windows machines. Thanks, Praveena. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why not a Python compiler?

2008-02-08 Thread Paul Boddie
On 8 Feb, 08:16, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > > [snip more interesting considerations about compiling python] > > Please get back on topic. This discussion is about parsecs and > wookies now. Yes, it's like the lower-value parts of Wikipedia have spilled out onto Usenet. ;-) But

using scons as a library

2008-02-08 Thread Tim Arnold
Hi, I've been reading up on the SCons build tool. It's intended to work by the end-user calling 'scons' on a buildscript. However, I'd like to use it from my own python project as an imported module, and have my already-written classes use the Scons objects to take actions without an external scrip

Re: How to identify which numbers in a list are within each others' range

2008-02-08 Thread Boris Borcic
Arnaud Delobelle wrote: (...) > > from itertools import chain > > def overlaps(lst): > bounds = chain(*(((x[1],i), (x[2], i)) for i,x in enumerate(lst))) imho, this is a uselessly painful equivalent of bounds = ((x[k],i) for i,x in enumerate(lst) for k in (1,2)) Cheers, BB -- http:

Re: How to identify which numbers in a list are within each others' range

2008-02-08 Thread Arnaud Delobelle
On Feb 8, 1:48 pm, Boris Borcic <[EMAIL PROTECTED]> wrote: > Arnaud Delobelle wrote: > > (...) > > > > > from itertools import chain > > > def overlaps(lst): > >     bounds = chain(*(((x[1],i), (x[2], i)) for i,x in enumerate(lst))) > > imho, this is a uselessly painful equivalent of > >        bou

Re: matplotlib install error

2008-02-08 Thread John
> Is thate really all of the error? It hints on a missing include, which > will be mentioned earlier. > > Diez platform: linux2 REQUIRED DEPENDENCIES numpy: 1.0.3.1 freetype2: found, but unknown version (no pkg-config) OPTIONAL BACKEND DEPENDENCIES

Re: keyword 'in' not returning a bool?

2008-02-08 Thread Arnaud Delobelle
On Feb 8, 5:20 pm, "Reedick, Andrew" <[EMAIL PROTECTED]> wrote: > > -Original Message- > > From: [EMAIL PROTECTED] [mailto:python- > > [EMAIL PROTECTED] On Behalf Of c james > > Sent: Friday, February 08, 2008 12:10 PM > > To: [EMAIL PROTECTED] > > Subject: keyword 'in' not returning a bool

Re: Why not a Python compiler?

2008-02-08 Thread Jeff Schwab
Grant Edwards wrote: > On 2008-02-08, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > >>> the compiler could do little else except translate it to something >>> like: >>> >>> (python:add a b) >> [snip more interesting considerations about compiling python] >> >> Please get back on topic. This discu

Re: multi-Singleton-like using __new__

2008-02-08 Thread Guilherme Polo
2008/2/8, Freek Dijkstra <[EMAIL PROTECTED]>: > Is there a best practice on how to override __new__? > > I have a base class, RDFObject, which is instantiated using a unique > identifier (a URI in this case). If an object with a given identifier > already exists, I want to return the existing ob

Re: How to identify which numbers in a list are within each others' range

2008-02-08 Thread Boris Borcic
Boris Borcic wrote: > Arnaud Delobelle wrote: > (...) >> >> from itertools import chain >> >> def overlaps(lst): >> bounds = chain(*(((x[1],i), (x[2], i)) for i,x in enumerate(lst))) > > imho, this is a uselessly painful equivalent of > > bounds = ((x[k],i) for i,x in enumerate(lst) for

Re: Why not a Python compiler?

2008-02-08 Thread Grant Edwards
On 2008-02-08, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: >> the compiler could do little else except translate it to something >> like: >> >> (python:add a b) > [snip more interesting considerations about compiling python] > > Please get back on topic. This discussion is about parsecs and > woo

Re: multi-Singleton-like using __new__

2008-02-08 Thread Arnaud Delobelle
On Feb 8, 4:44 pm, Freek Dijkstra <[EMAIL PROTECTED]> wrote: > Is there a best practice on how to override __new__? > > I have a base class, RDFObject, which is instantiated using a unique > identifier (a URI in this case). If an object with a given identifier > already exists, I want to return the

NYC Python Users Meetup February Meeting Announcement....

2008-02-08 Thread John Clark
Please pardon the PSA: The New York City Python Users Meetup Group is planning on having our February meeting on February 12th, from 6:30pm - 8:00pm. For more information, please see: http://python.meetup.com/172/calendar/7082384/ Anyone in the NYC area interested in using Python, learning m

Re: shelve.open call gives error

2008-02-08 Thread Gabriel Genellina
En Fri, 08 Feb 2008 06:36:53 -0200, waltbrad <[EMAIL PROTECTED]> escribió: > Working through the Mark Lutz book Programming Python 3rd Edition. > > A couple of modules in the "Preview" chapter give me errors. Both on a > shelve.open call: > > Pretty simple code, (2nd example): > =code begin=

Re: keyword 'in' not returning a bool?

2008-02-08 Thread Sion Arrowsmith
In article <[EMAIL PROTECTED]>, c james <[EMAIL PROTECTED]> wrote: sample = {'t':True, 'f':False} 't' in sample == True >False > >Why is this? http://docs.python.org/lib/comparisons.html "Comparisons can be chained arbitrarily; for example, x < y <= z is equivalent to x < y and y <= z,

Re: Dear David

2008-02-08 Thread Grant Edwards
On 2008-02-08, Blubaugh, David A. <[EMAIL PROTECTED]> wrote: > I have discontinued the use of ?? a long time ago. Why > is this still a problem? You're still top posting and not trimming quotes. That annoys a lot of people. -- Grant Edwards grante Yow! MERYL

Re: Dear David (was: MyHDL project)

2008-02-08 Thread Grant Edwards
On 2008-02-08, Dan Upton <[EMAIL PROTECTED]> wrote: > I don't know, I'm inclined to agree with him. Repeatedly > replying to bash his use of grammar or punctuation is > unnecessary. Replying to the list to mock repeatedly is > doubly unnecessary. While c.l.p is exceptionally polite and tolerant

Re: are elements of a list in sequence in list b

2008-02-08 Thread Steven D'Aprano
On Fri, 08 Feb 2008 16:39:55 +, Matthew_WARREN wrote: > Hallo, > > > I need to search list a for the sequence of list b > > First I went a=[1,2,34,4,5,6] b=[2,3,4] a in b > False You have the order of a and b mixed up there. As you have it, you are searching b for a. >

Re: Critique of first python code

2008-02-08 Thread Tomek Paczkowski
Zack wrote: > Hi all. I'm just starting to pick up python. I wanted to play with nested > lists so first I wrote a little bit of code to create arbitrarily nested > lists (grow). Then I wrote a breadth first search. I'm putting this small > snippet up asking for criticism. Was there a more elegan

Re: Using a signal to terminate a programm running with an asyncore loop

2008-02-08 Thread Larry Bates
[EMAIL PROTECTED] wrote: > On Feb 8, 7:04 am, Larry Bates <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>> I'm developing a program that runs using an asyncore loop. Right now >>> I can adequately terminate it using Control-C, but as things get >>> refined I need a better way to stop it.

Re: Using a signal to terminate a programm running with an asyncore loop

2008-02-08 Thread [EMAIL PROTECTED]
On Feb 8, 4:03 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > When signal is caught handle_shutdown_signal is called.  At that point > SHUTDOWN_PERFORMED will ALWAYS be False.  Normally all you do in this function > is to set SHUTDOWN_PERFORMED to True and have a test somewhere in your main > program

Re: Why not a Python compiler?

2008-02-08 Thread Steve Holden
Grant Edwards wrote: > On 2008-02-08, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > >>> the compiler could do little else except translate it to something >>> like: >>> >>> (python:add a b) >> [snip more interesting considerations about compiling python] >> >> Please get back on topic. This discu

Re: Dear David

2008-02-08 Thread Steve Holden
Grant Edwards wrote: > On 2008-02-08, Blubaugh, David A. <[EMAIL PROTECTED]> wrote: > >> I have discontinued the use of ?? a long time ago. Why >> is this still a problem? > > You're still top posting and not trimming quotes. That annoys > a lot of people. > It isn't a problem, I was mere

Re: Why does list have no 'get' method?

2008-02-08 Thread bearophileHUGS
Carl Banks: > I think booleans should be completely disjoint from all other types, > as they are in Java. "and", "or", and "not" should accept only boolean > operands and return only boolean results. I'd like "or" and "and" (and "not") to return booleans only, to avoid bugs and make their meanin

Re: multi-Singleton-like using __new__

2008-02-08 Thread Matt Nordhoff
J Peyret wrote: > - Same with using try/except KeyError instead of in cls.cache. > Has_key might be better if you insist on look-before-you-leap, because > 'in cls.cache' probably expends to uri in cls.cache.keys(), which can > be rather bad for perfs if the cache is very big. i.e. dict lookups >

Re: multi-Singleton-like using __new__

2008-02-08 Thread J Peyret
I think the metaclass stuff is a bit too black magic for a pretty simple requirement. Txs in any case for showing me the __init__ issue, I wasn't aware of it. Here's a workaround - not exactly elegant in terms of OO, with the isInitialized flag, but it works. >>> class RDFObject(object): ...

which one is more efficient

2008-02-08 Thread ki lo
I have type variable which may have been set to 'D' or 'E' Now, which one of following statements are more efficient if type =='D' or type == 'E': or if re.search("D|E", type): Please let me know because the function is going to called 10s of millions of times. Thanks Kilo -- http://mail.pyt

Re: multi-Singleton-like using __new__

2008-02-08 Thread Steven D'Aprano
On Sat, 09 Feb 2008 00:04:26 +, Matt Nordhoff wrote: > At worst, in and has_key are "about the same". Except that using has_key() means making an attribute lookup, which takes time. I'm kinda curious why you say they're "about the same" when your own timing results contradict that. Here th

Re: multi-Singleton-like using __new__

2008-02-08 Thread Gabriel Genellina
En Fri, 08 Feb 2008 22:04:26 -0200, Matt Nordhoff <[EMAIL PROTECTED]> escribió: > J Peyret wrote: >> - Same with using try/except KeyError instead of in cls.cache. >> Has_key might be better if you insist on look-before-you-leap, because >> 'in cls.cache' probably expends to uri in cls.cache.key

sort functions in python

2008-02-08 Thread t3chn0n3rd
Do you think it is relatively easy to write sort algorithms such as the common Bubble sort in Python as compared to other high level programming langauges -- http://mail.python.org/mailman/listinfo/python-list

Re: __builtins__

2008-02-08 Thread Ben Finney
LHB <[EMAIL PROTECTED]> writes: > Marc 'BlackJack' Rintsch a écrit : > > `__builtins__` is an implementation detail, and `__builtin__` is a name > > of a module you can import. You should not use `__builtins__` but import > > `__builtin__` and inspect that instead of `__builtins__`. > Ok. Should

Re: which one is more efficient

2008-02-08 Thread Michael Spencer
ki lo wrote: > I have type variable which may have been set to 'D' or 'E' > > Now, which one of following statements are more efficient > > if type =='D' or type == 'E': > > or > > if re.search("D|E", type): > > Please let me know because the function is going to called 10s of > millions of t

Re: Why not a Python compiler?

2008-02-08 Thread Marc 'BlackJack' Rintsch
On Fri, 08 Feb 2008 17:45:36 +, Grant Edwards wrote: > On 2008-02-08, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > >> Please get back on topic. This discussion is about parsecs and >> wookies now. > > What's a "wookie" a unit of? The degree of confusion among the jury when using the Chewb

Re: multi-Singleton-like using __new__

2008-02-08 Thread Matt Nordhoff
Steven D'Aprano wrote: > Except that using has_key() means making an attribute lookup, which takes > time. I was going to say that, but doesn't 'in' require an attribute lookup of some sort too, of __contains__ or whatever? has_key is probably now just a wrapper around that, so it would be one mo

Re: which one is more efficient

2008-02-08 Thread Gabriel Genellina
En Fri, 08 Feb 2008 22:45:06 -0200, ki lo <[EMAIL PROTECTED]> escribió: > I have type variable which may have been set to 'D' or 'E' > > Now, which one of following statements are more efficient > > if type =='D' or type == 'E': > > or > > if re.search("D|E", type): > > Please let me know because

  1   2   >