RE: Thread termination

2006-10-17 Thread Stefan Schukat
Hello   you are using the module variable ie inside the Generic Function, but you have to use  "d" since this is the Python object which is allowed to access the COM object in the separate thread.       Stefan From: Tejovathi P [mailto:[EMAIL PROTECTED] Sent: Monday, October 16,

Re: Max-plus library

2006-10-17 Thread Sébastien Boisgérault
Robert Kern wrote: > Martin Manns wrote: > > Hello, > > > > Is there any library that allows employing max-plus dioids in > > python (e.g. based on numpy/scipy)? > > Google says "no" and I haven't heard of any, so I imagine that there aren't. > There might be something buried in some of the control

How to paras such echo string effection?

2006-10-17 Thread Kevien Lee
Hi everyone,   When i decide to paras a string,which return from running a CVS command,it's amaze that i want to get some file of the echo string ,how to make paras process more effect?   the problem detail as follow that:   run command:"cvs  status -r" it will return all the file list in as follow

Re: COM Error -- Urgent help

2006-10-17 Thread Teja
Méta-MCI wrote: > Hi! > > > .func( is not defined... > > > @-salutations > -- > Michel Claveau I am sorry. By func(dest) I meant MyNavigate(dest). Can u please help me out... Thnks, Teja.P -- http://mail.python.org/mailman/listinfo/python-list

Re: Scope of decorator argument

2006-10-17 Thread Gregor Horvath
Gregor Horvath schrieb: > > Is there any other solution, probably with metaclasses ? > I've found this one: class mymeta(type): def __new__(meta, class_name, bases, new_attrs): new_attrs["edit"] = adecorator(new_attrs['xy'])(bases[0].edit)) return type.__new__(meta, class_na

Re: How to paras such echo string effection?

2006-10-17 Thread limodou
On 10/17/06, Kevien Lee <[EMAIL PROTECTED]> wrote: > Hi everyone, > > When i decide to paras a string,which return from running a CVS command,it's > amaze that i want to get some file of the echo string ,how to make paras > process more effect? > > the problem detail as follow that: > > run command

Re: How to paras such echo string effection?

2006-10-17 Thread Theerasak Photha
On 10/17/06, Kevien Lee <[EMAIL PROTECTED]> wrote: > PS:is there any python lib for CVS ? Doubt it, but there is a Python library for Subversion (SVN > CVS anyway). -- Theerasak -- http://mail.python.org/mailman/listinfo/python-list

Re: COM Error -- Urgent help

2006-10-17 Thread Fredrik Lundh
Teja wrote: > I am sorry. By func(dest) I meant MyNavigate(dest). Can u please help > me out... nobody here can read your mind. please post the code you're actually using, *and* the error you're getting. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to paras such echo string effection?

2006-10-17 Thread Fredrik Lundh
Kevien Lee wrote: > PS:is there any python lib for CVS ? there's some stuff in Demo/pdist in the Python source distribution, including a module called "cvslib". -- http://mail.python.org/mailman/listinfo/python-list

Re: How to paras such echo string effection?

2006-10-17 Thread Theerasak Photha
On 10/17/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Kevien Lee wrote: > > > PS:is there any python lib for CVS ? > > there's some stuff in Demo/pdist in the Python source distribution, > including a module called "cvslib". then I stand corrected... -- Theerasak -- http://mail.python.org/mail

Re: A friendlier, sugarier lambda -- a proposal for Ruby-like blocksin python

2006-10-17 Thread Theerasak Photha
On 10/17/06, Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: > "Bruno Desthuilliers" <[EMAIL PROTECTED]> wrote: > > Kay Schluehr wrote: > > > Bruno Desthuilliers wrote: > > > > > >> Just for the record : Ruby's code-blocks (closures, really) come from > > >> Smalltalk, which is still the OneTrueObje

Re: COM Error -- Urgent help

2006-10-17 Thread Teja
Fredrik Lundh wrote: > Teja wrote: > > > I am sorry. By func(dest) I meant MyNavigate(dest). Can u please help > > me out... > > nobody here can read your mind. please post the code you're actually > using, *and* the error you're getting. > > Thnks for your immediate reply. Here is the code:

Re: A friendlier, sugarier lambda -- a proposal for Ruby-like blocks in python

2006-10-17 Thread Theerasak Photha
On 14 Oct 2006 09:25:00 -0700, Paul Boddie <[EMAIL PROTECTED]> wrote: > Unlike Java, Python's first class functions and > methods are already highly useful for callback-based systems Curious: how well does the use of returning inner functions work as a strategy for providing effectively 'anonymou

Any idea how to do this in Python?

2006-10-17 Thread Lad
In a web application users can post some information. I would like to link each posting with a "weight of importance" for a user, depending on a keywords in the posting. For example, I know that a user A is interested in Nokia mobiles while user B in Siemens mobiles. So, if a user A is signed, he w

Re: a question about s[i:j] when i is negative

2006-10-17 Thread dracula571
Fredrik Lundh 写道: > dracula571 wrote: > > > but k[-6:2] = [1,2] > > why k[-6:2] is [1,2]not [].i do follow (3),to make i positive by > > plusing len(k) twice. > > twice? > > that is -6 + len(k) + len(k) =4 -- http://mail.python.org/mailman/listinfo/python-list

Numpy-f2py troubles

2006-10-17 Thread Andrea Gavana
Hello NG, I am using the latest Numpy release 1.0rc2 which includes F2PY. I have switched to Python 2.5 so this is the only alternative I have (IIUC). With Python 2.4, I was able to build a very simple fortran extension without problems. My extension contains 4 subroutines that scan a file an

Re: a question about s[i:j] when i is negative

2006-10-17 Thread dracula571
[EMAIL PROTECTED] 写道: > dracula571 wrote: > > s[i:j] slice of s from i to j (3), (4) > > > > (3) > > If i or j is negative, the index is relative to the end of the string: > > len(s) + i or len(s) + j is substituted. But note that -0 is still 0. > > > > > > (4) > > The slice of s from i t

Re: A Universe Set

2006-10-17 Thread Jorgen Grahn
On Mon, 16 Oct 2006 09:21:11 -0500, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > [me] > >> - the wildcard object, which compares equal to everything else > [Paul] > Paul> class MatchAny(object): > Paul> def __cmp__(self,other): > Paul> return 0 > > Pau

Re: a question about s[i:j] when i is negative

2006-10-17 Thread Fredrik Lundh
"dracula571" wrote: >> dracula571 wrote: >> >> > but k[-6:2] = [1,2] >> > why k[-6:2] is [1,2]not [].i do follow (3),to make i positive by >> > plusing len(k) twice. >> >> twice? > > that is -6 + len(k) + len(k) =4 sure, but what makes you think you should add the length twice? -- http://m

Re: COM Error -- Urgent help

2006-10-17 Thread Teja
Dennis Lee Bieber wrote: > On 17 Oct 2006 00:58:59 -0700, "Teja" <[EMAIL PROTECTED]> declaimed > the following in comp.lang.python: > > >thread.start_new_thread(self.nav, (s,'www.google.com') > > > > I am getting an attribute error > > That can not be the REAL code... I'd expect a sy

Re: COM Error -- Urgent help

2006-10-17 Thread Fredrik Lundh
Teja wrote: > s=pythoncom.CoMarshalInterThreadInterfaceInStream(pythoncom.IID_IDispatch,i­­e) > >thread.start_new_thread(self.nav, (s,'www.google.com') > > I am getting an attribute error the traceback tells you what attribute Python was looking for, and may also provide additional clues

Re: COM Error -- Urgent help

2006-10-17 Thread Diez B. Roggisch
Teja wrote: > > Dennis Lee Bieber wrote: >> On 17 Oct 2006 00:58:59 -0700, "Teja" <[EMAIL PROTECTED]> declaimed >> the following in comp.lang.python: >> >> >thread.start_new_thread(self.nav, (s,'www.google.com') >> > >> > I am getting an attribute error >> >> That can not be the REAL code

Re: COM Error -- Urgent help

2006-10-17 Thread Teja
Diez B. Roggisch wrote: > Teja wrote: > > > > > Dennis Lee Bieber wrote: > >> On 17 Oct 2006 00:58:59 -0700, "Teja" <[EMAIL PROTECTED]> declaimed > >> the following in comp.lang.python: > >> > >> >thread.start_new_thread(self.nav, (s,'www.google.com') > >> > > >> > I am getting an attribut

Re: python's OOP question

2006-10-17 Thread Bruno Desthuilliers
neoedmund wrote: (snip) > So I can reuse a method freely only if it's worth reusing. > For the word "inheritance", in some aspect, meanings reuse the super > class, with the condition: must reuse everything from super class. Not really. In fact, inheritance *is* a special case of composition/deleg

Re: A Universe Set

2006-10-17 Thread Duncan Booth
Jorgen Grahn <[EMAIL PROTECTED]> wrote: >> >> - the wildcard object, which compares equal to everything else >> > [Paul] >> Paul> class MatchAny(object): >> Paul> def __cmp__(self,other): >> Paul> return 0 >> >> Paul> wild = MatchAny() > > FWIW, I define __eq

Re: Cannot import a module from a variable

2006-10-17 Thread Tim Williams
On 16/10/06, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Jia Lu wrote: > > Hi all: > > > > I try to do things below: > import sys > for i in sys.modules.keys(): > > import i > > Traceback (most recent call last): > > File "", line 2, in > > import i > > ImportError: No m

Re: Any idea how to do this in Python?

2006-10-17 Thread Lad
Dennis, Thank you for your reply You say: >Pretend you are the computer/application/etc. How would YOU > perform such a ranking? That is what I do not know , how to perform such ranking. Do you have any idea? Regards, Lad. -- http://mail.python.org/mailman/listinfo/python-list

Re: Book about database application development?

2006-10-17 Thread Bruno Desthuilliers
Wolfgang Keller wrote: >> Developping quality SQLDBMS-based applications requires more than "a >> bit" of SQL knowledge. > > No doubt. :-) But my "bit" is enough to get me going and to know where to > look for further information if I hit a wall. Especially the people on the > Postgres mailingli

Re: Python 2.4 online certification - new items available for Beta testing

2006-10-17 Thread NickC
[EMAIL PROTECTED] wrote: > Randy> There is a free Beta test of a Python 2.4 Certification test > Randy> available at Brainbench.com. They are a provider of skills-based > Randy> certification exams. Go to the link below to find the test. It > Randy> is free to take the test. > > Ra

Re: Any idea how to do this in Python?

2006-10-17 Thread jmdeschamps
Lad wrote: > Dennis, > Thank you for your reply > You say: > >Pretend you are the computer/application/etc. How would YOU > > perform such a ranking? > That is what I do not know , how to perform such ranking. > Do you have any idea? > > Regards, > Lad. take a piece of paper to *play* the use-cas

Re: Any idea how to do this in Python?

2006-10-17 Thread Theerasak Photha
On 17 Oct 2006 02:56:45 -0700, Lad <[EMAIL PROTECTED]> wrote: > > Dennis, > Thank you for your reply > You say: > >Pretend you are the computer/application/etc. How would YOU > > perform such a ranking? > That is what I do not know , how to perform such ranking. > Do you have any idea? The detail

Re: Cannot import a module from a variable

2006-10-17 Thread Fredrik Lundh
Tim Williams wrote: > eval( 'reload(%s)' % modname) reload takes a module object, not a module name. since you need to have the object, you might as well pass it to the reload() function. -- http://mail.python.org/mailman/listinfo/python-list

Re: Output from subprocess.Popen()

2006-10-17 Thread Clodoaldo Pinto Neto
Fredrik Lundh wrote: > Clodoaldo Pinto Neto wrote: > > > But I still don't understand what is happening. The manual says that > > when shell=True the executable argument specifies which shell to use: > > no, it says that when shell=True, it runs the command "through" the > default shell. that is,

Re: Cannot import a module from a variable

2006-10-17 Thread Duncan Booth
"Tim Williams" <[EMAIL PROTECTED]> wrote: >> The import statement expects a name (a symbol), not a string. >> > > eval( 'import %s' % modname) > > and > > eval( 'reload(%s)' % modname) > > Usual warnings about eval apply, but in this case it is usable. Did you actually try your suggestion be

Re: A friendlier, sugarier lambda -- a proposal for Ruby-like blocks in python

2006-10-17 Thread Paul Boddie
Theerasak Photha skrev: > On 14 Oct 2006 09:25:00 -0700, Paul Boddie <[EMAIL PROTECTED]> wrote: > > > Unlike Java, Python's first class functions and > > methods are already highly useful for callback-based systems > > Curious: how well does the use of returning inner functions work as a > strategy

We're recruiting Python programmers

2006-10-17 Thread Dale Strickland-Clark
I'll keep this brief. Please see the web site for details Thanks. -- Dale Strickland-Clark We are recruiting Python programmers. Please see the web site. Riverhall Systems www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: Alphabetical sorts

2006-10-17 Thread Neil Cerutti
On 2006-10-17, Ron Adam <[EMAIL PROTECTED]> wrote: > Neil Cerutti wrote: >> On 2006-10-16, Ron Adam <[EMAIL PROTECTED]> wrote: >>> I have several applications where I want to sort lists in >>> alphabetical order. Most examples of sorting usually sort on >>> the ord() order of the character set as a

Re: OT: What's up with the starship?

2006-10-17 Thread A.M. Kuchling
On Mon, 16 Oct 2006 14:50:03 -0500, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > suggests that it was sufficiently obscure that either a) nobody who knew > about it found a way to take advantage of it, or b) it was only recently It might well be difficult to exploit to run arbitrary cod

Re: Alphabetical sorts

2006-10-17 Thread Jorgen Grahn
On Mon, 16 Oct 2006 22:22:47 -0500, Ron Adam <[EMAIL PROTECTED]> wrote: ... > I see this is actually a very complex subject. ... > It looks to me this would be a good candidate for a configurable class. > Something preferably in the string module where it could be found easier. /And/ choosing a l

Newbie: datetime conversion question

2006-10-17 Thread kevin evans
Hi, I'm trying to convert some code from Ruby to Python, specifically.. timestamp = "%08x" % Time.now.to_i Make a hex version of the current timestamp. Any ideas how best to do this in python gratefully received.. -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie: datetime conversion question

2006-10-17 Thread Fredrik Lundh
"kevin evans" wrote: > I'm trying to convert some code from Ruby to Python, specifically.. > > timestamp = "%08x" % Time.now.to_i > > Make a hex version of the current timestamp. Any ideas how best to do > this in python gratefully received.. that's perfectly valid Python code, provided Time is a

Re: Newbie: datetime conversion question

2006-10-17 Thread Carsten Haese
On Tue, 2006-10-17 at 08:43, kevin evans wrote: > Hi, > I'm trying to convert some code from Ruby to Python, specifically.. > > timestamp = "%08x" % Time.now.to_i > > Make a hex version of the current timestamp. Any ideas how best to do > this in python gratefully received.. import time timestam

Re: Newbie: datetime conversion question

2006-10-17 Thread hg
kevin evans wrote: > Hi, > I'm trying to convert some code from Ruby to Python, specifically.. > > timestamp = "%08x" % Time.now.to_i > > Make a hex version of the current timestamp. Any ideas how best to do > this in python gratefully received.. > how about import time "%08X"% (int)(time.mkt

Re: Newbie: datetime conversion question

2006-10-17 Thread skip
kevin> I'm trying to convert some code from Ruby to Python, kevin> specifically.. kevin> timestamp = "%08x" % Time.now.to_i kevin> Make a hex version of the current timestamp. Any ideas how best kevin> to do this in python gratefully received.. Try import time times

Re: Newbie: datetime conversion question

2006-10-17 Thread Carsten Haese
On Tue, 2006-10-17 at 08:49, hg wrote: > import time > "%08X"% (int)(time.mktime(time.localtime())) Have you not had your coffee yet or are you trying to win an obfuscated python programming competition? ;) -Carsten -- http://mail.python.org/mailman/listinfo/python-list

Re: COM Error -- Urgent help

2006-10-17 Thread Neil Hodgson
Teja: > ie=win32com.client.Dispatch('internetexplorer.application') > ie.Visible=1 > > class GenericFunctions: > def __init__(self): > print "In Constructor of Generic Functions" > def MyNavigate(self,dest): > ie.Navigate(dest) You are using an interface created on th

RE: Any idea how to do this in Python?

2006-10-17 Thread Matthew Warren
> On 17 Oct 2006 02:56:45 -0700, Lad <[EMAIL PROTECTED]> wrote: > > > > Dennis, > > Thank you for your reply > > You say: > > >Pretend you are the computer/application/etc. How would YOU > > > perform such a ranking? > > That is what I do not know , how to perform such ranking. > > Do you have any

Re: Newbie: datetime conversion question

2006-10-17 Thread hg
Carsten Haese wrote: > On Tue, 2006-10-17 at 08:49, hg wrote: >> import time >> "%08X"% (int)(time.mktime(time.localtime())) > > Have you not had your coffee yet or are you trying to win an obfuscated > python programming competition? ;) > > -Carsten > > Just one cup hg -- http://mail.python.

Tertiary Operation

2006-10-17 Thread abcd
x = None result = (x is None and "" or str(x)) print result, type(result) --- OUTPUT --- None y = 5 result = (y is 5 and "it's five" or "it's not five") print result - OUTPUT - it's five ...what's wrong with the first operation I did with x?

Re: COM Error -- Urgent help

2006-10-17 Thread Teja
This is the trae back ,can you help me please. Traceback (most recent call last): File "C:\Documents and Settings\dzxbrn\Desktop\Stop Test\13 Oct\MainThread.py", line 13, in threadFunction obj.MyNavigate(dest) # this is gving an error. File "C:\Documents and Settings\dzxbrn\De

Re: Book about database application development?

2006-10-17 Thread Kent Johnson
Wolfgang Keller wrote: > I know about the existence of MVC. But what I'm actually missing is a nice > textbook that teaches how to actually implement it (and other design patterns > which are useful for database applications) in a real-world application in a > way that leads to non-ridiculous be

pylab package dependencies (was: Plotting histograms)

2006-10-17 Thread Lou Pecora
In article <[EMAIL PROTECTED]>, Robert Kern <[EMAIL PROTECTED]> wrote: > I presume what you did was something like this: > >from matplotlib import pylab >[N,x] = hist(eig, 10) > > What you actually want is this: > >from matplotlib import pylab >[N,x] = pylab.hist(eig, 10) > >

Re: Tertiary Operation

2006-10-17 Thread Richard Brodie
"abcd" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >x = None > result = (x is None and "" or str(x)) > > ...what's wrong with the first operation I did with x? I was expecting > "result" to be an empty string, not the str value of None. Your evil tertiary hack has failed you be

Re: Tertiary Operation

2006-10-17 Thread Tim Chase
> x = None > result = (x is None and "" or str(x)) > > print result, type(result) > > --- > OUTPUT > --- > None > > > y = 5 > result = (y is 5 and "it's five" or "it's not five") > > print result > > - > OUTPUT > - > it's five > > ...what's wr

Re: Tertiary Operation

2006-10-17 Thread Carsten Haese
On Tue, 2006-10-17 at 09:30, abcd wrote: > x = None > result = (x is None and "" or str(x)) > > print result, type(result) > > --- > OUTPUT > --- > None The "condition and result1 or result2" trick only works if result1 is an expression with a True boolean value. The emp

Re: Max-plus library

2006-10-17 Thread Martin Manns
Sébastien Boisgérault wrote: > Robert Kern wrote: >> Martin Manns wrote: >>> Hello, >>> >>> Is there any library that allows employing max-plus dioids in >>> python (e.g. based on numpy/scipy)? >> Google says "no" and I haven't heard of any, so I imagine that there aren't. >> There might be somethi

Re: Newbie: datetime conversion question

2006-10-17 Thread kevin evans
Great stuff - many thanks hg wrote: > Carsten Haese wrote: > > On Tue, 2006-10-17 at 08:49, hg wrote: > >> import time > >> "%08X"% (int)(time.mktime(time.localtime())) > > > > Have you not had your coffee yet or are you trying to win an obfuscated > > python programming competition? ;) > > > >

Looking for assignement operator

2006-10-17 Thread Alexander Eisenhuth
Hello, is there a assignement operator, that i can overwrite? class MyInt: def __init__(self, val): assert(isinstance(val, int)) self._val = val a = MyInt(10) # Here i need to overwrite the assignement operator a = 12 Thanks Alexander -- http://mail.py

How to invoke ipython in Mac OS X?

2006-10-17 Thread Lou Pecora
I installed the SciPy superpackage and have pylab, matplotlib, scipy, and numpy apparently running well. But I want to use matplotlib/pylab interactively. The instructions suggest doing this in IPython. But using ipython on the command line gives me an error. The system doesn't know the com

Re: Tertiary Operation

2006-10-17 Thread abcd
Carsten Haese wrote: > Use Python 2.5 where there is a true conditional > expression or find another way to solve your problem. python 2.5 once we upgrade (hopefully soon), anyways...an earlier post suggested the inverse... x = None result = (x is not None and str(x) or "") which works just fine

Re: Looking for assignement operator

2006-10-17 Thread Simon Brunning
On 10/17/06, Alexander Eisenhuth <[EMAIL PROTECTED]> wrote: > Hello, > > is there a assignement operator, that i can overwrite? Soirry, no, assignment is a statement, not an operator, and can't be overridden. -- Cheers, Simon B [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ -- http

Re: Tertiary Operation

2006-10-17 Thread Fredrik Lundh
Tim Chase wrote: > {True: "", False: str(x)}[x is None] first the localtime/mktime roundtrip with a simulated cast, and now this? in less than one hour? solar flares? -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for assignement operator

2006-10-17 Thread Fredrik Lundh
Alexander Eisenhuth wrote: > is there a assignement operator, that i can overwrite? no. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem creating animated gif

2006-10-17 Thread Fredrik Lundh
"abcd" <[EMAIL PROTECTED]> wrote: > Any ideas? Basically I want to make an animated GIF out of a bunch of > images taken using the ImageGrab module. the screen is an RGB device, but the gifmaker wants palette images (mode P). to fix this, insert im = im.convert("P") after the grab (or befo

Problem creating animated gif

2006-10-17 Thread abcd
I am using gifmaker.py from PIL v1.1.5 on python 2.4.1. CODE import ImageGrab, gifmaker seq = [] while keepOnGoing: im = ImageGrab.grab() seq.append(im) fp = open("out.gif", "wb") gifmaker.makedelta(fp, seq) fp.close() --

Return returns nothing in recursive function

2006-10-17 Thread Matthew Warren
Hallo people, I have the following code that implements a simple recursive tree like structure. The trouble is with the GetTreeBranch function, the print statement prints a valid value but the return immediatley afterward doesn't return anything. Can anyone help me with why? Thanks, Matt. Co

Re: Tertiary Operation

2006-10-17 Thread Carsten Haese
On Tue, 2006-10-17 at 09:48, Tim Chase wrote: > [...] > Either of the following should suffice: > > # return a non-empty string > x is None and "None" or str(x) This one can be "optimized" to just str(x) since str(None)=="None". >[...] > There are more baroque ways of writing the ter

Re: Tertiary Operation

2006-10-17 Thread Steven D'Aprano
On Tue, 17 Oct 2006 06:30:32 -0700, abcd wrote: > x = None > result = (x is None and "" or str(x)) Boolean operators "and" and "or" stop as soon as a result is known. So: X and Y evaluates as X if X is false; otherwise it evaluates as Y. X or Y evaluates as X if X is true; otherwise it evaluates

Re: Looking for assignement operator

2006-10-17 Thread Rob Wolfe
Alexander Eisenhuth wrote: > Hello, > > is there a assignement operator, that i can overwrite? You can't overwrite assignment operator, but you can overwrite methods of numeric objects: http://docs.python.org/ref/numeric-types.html HTH, Rob -- http://mail.python.org/mailman/listinfo/python-li

Re: Tertiary Operation

2006-10-17 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "abcd" <[EMAIL PROTECTED]> wrote: > Carsten Haese wrote: > > Use Python 2.5 where there is a true conditional > > expression or find another way to solve your problem. > > python 2.5 once we upgrade (hopefully soon), anyways...an earlier post > suggested the inver

Re: Looking for assignement operator

2006-10-17 Thread Laurent Pointal
Alexander Eisenhuth a écrit : > Hello, > > is there a assignement operator, that i can overwrite? Adding to Simon Brunning reply (assignment is a statement). > class MyInt: > def __init__(self, val): > assert(isinstance(val, int)) > self._val = val > > a = MyInt(10) > > # H

Re: Format a number as currency! I can't find any help on this simple problem.

2006-10-17 Thread jr
Hi, Bernard. Just tried the first 2 commands on win XP, Python 2.5 under Idle. An Error is raised: "unsupported locale setting" (lib/locale.py in setlocale, line 476). Actually I get the error also under Python 2.4.3 Any idea what I'm missing? Thanks in advance. Jürgen Bernard wrote: > >>> import l

Re: Looking for assignement operator

2006-10-17 Thread Steven D'Aprano
On Tue, 17 Oct 2006 15:50:47 +0200, Alexander Eisenhuth wrote: > Hello, > > is there a assignement operator, that i can overwrite? No. We were just discussing the reasons why Python will not and can not have an assignment operator just a few days ago. Check the archives for more details. > cl

Re: Looking for assignement operator

2006-10-17 Thread Jerry
On Oct 17, 8:50 am, Alexander Eisenhuth <[EMAIL PROTECTED]> wrote: > Hello, > > is there a assignement operator, that i can overwrite? > > class MyInt: > def __init__(self, val): > assert(isinstance(val, int)) > self._val = val > > a = MyInt(10) > > # Here

Re: Format a number as currency! I can't find any help on this simple problem.

2006-10-17 Thread Jerry
Replace the conv function call with locale.localeconv. -- Jerry -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for assignement operator

2006-10-17 Thread Bruno Desthuilliers
Steven D'Aprano wrote: > On Tue, 17 Oct 2006 15:50:47 +0200, Alexander Eisenhuth wrote: > >> Hello, >> >> is there a assignement operator, that i can overwrite? > > No. > > We were just discussing the reasons why Python will not and can not have > an assignment operator just a few days ago. Chec

stdout not flushed before os.execvp()

2006-10-17 Thread Thomas Guettler
Hi, I noticed, that sys.stout does not get flushed before the process is replaced. The last print statements (before execvp()) disappear. It only happens, if the output is redirected to a file (if sys.stdout is not line buffered). """#testexec.py import os print "Messsage" os.execvp("/bin/true",

Re: How to invoke ipython in Mac OS X?

2006-10-17 Thread Jerry
Did you install it with the --install-scripts command line option? If you did, then there will be a ipython script located in the $INSTALL_SCRIPTS/bin directory. If you didn't, then I think the default location is /usr/lib/python or something like that. -- http://mail.python.org/mailman/listinf

Re: Problem: Python search path - module order

2006-10-17 Thread Thomas Guettler
aznach wrote: > Hello! > > I have a shared hosting account at GrokThis.net and have a problem with > the module order of the Python search path. > > I'd like to use django's svn trunk instead of the > "Django-0.95-py2.4.egg" provided in site-packages. > I use ~/.bash_profile to set: > ---

Re: How to invoke ipython in Mac OS X?

2006-10-17 Thread Diez B. Roggisch
Lou Pecora wrote: > I installed the SciPy superpackage and have pylab, matplotlib, scipy, > and numpy apparently running well. But I want to use matplotlib/pylab > interactively. The instructions suggest doing this in IPython. But > using ipython on the command line gives me an error. The syst

Re: Looking for assignement operator

2006-10-17 Thread Bruno Desthuilliers
Jerry wrote: (snip) > I believe the property function is what you are looking for. It is not. > e.g. > > class MyClass: Descriptors don't work fine with old-style classes. Should be: class MyClass(object): > def __init__(self, val): > self.setval(val) > > def getval(self): >

Re: urllib.urlopen: Errno socket error

2006-10-17 Thread kgrafals
Dennis, I tried a ProxyHandler with the following code ... proxy_support = urllib2.ProxyHandler({}) opener = urllib2.build_opener(proxy_support) urllib2.install_opener(opener) ... but it's giving me the same result. Then I tried to tunnel using code from ... http://aspn.activestate.com/ASPN/Co

Re: Tertiary Operation

2006-10-17 Thread Christophe
abcd a écrit : > x = None > result = (x is None and "" or str(x)) > > print result, type(result) > > --- > OUTPUT > --- > None > > > y = 5 > result = (y is 5 and "it's five" or "it's not five") > > print result > > - > OUTPUT > - > it's five >

Re: Looking for assignement operator

2006-10-17 Thread Alexander Eisenhuth
Wow, thanks a lot for your quick answers. That assignement is no operator, but a statemant is a pity, but indeed I came foward with overwritten methods for numeric types Regards Alexander -- http://mail.python.org/mailman/listinfo/python-list

Re: Format a number as currency! I can't find any help on this simple problem.

2006-10-17 Thread Peter Otten
jr wrote: >> >>> import locale >> >>> locale.setlocale(locale.LC_ALL, 'English_United States.1252') >> 'English_United States.1252' > Just tried the first 2 commands on win XP, Python 2.5 under Idle. > An Error is raised: "unsupported locale setting" (lib/locale.py in > setlocale, line 476). > Ac

Re: Tertiary Operation

2006-10-17 Thread Bruno Desthuilliers
abcd wrote: > x = None > result = (x is None and "" or str(x)) You don't need the parenthesis. > print result, type(result) > > --- > OUTPUT > --- > None > > > y = 5 > result = (y is 5 and "it's five" or "it's not five") By all means *don't* use identity tests in such

Re: How to invoke ipython in Mac OS X?

2006-10-17 Thread Lou Pecora
In article <[EMAIL PROTECTED]>, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Lou Pecora wrote: > > > I installed the SciPy superpackage and have pylab, matplotlib, scipy, > > and numpy apparently running well. But I want to use matplotlib/pylab > > interactively. The instructions suggest do

Re: OT: What's up with the starship?

2006-10-17 Thread rurpy
[EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote: > > [EMAIL PROTECTED] wrote: > > > > > I don't think that would help in the case of Pywin32 since the > > > Sourceforge dates for build 210 are 9/22. > > > I emailed Mark Hammond but have not heard anything back yet. > > > > In the case of pywin3

Re: Tertiary Operation

2006-10-17 Thread Steven Bethard
abcd wrote: > x = None > result = (x is None and "" or str(x)) > print result, type(result) > > --- > OUTPUT > --- > None > > [snip] > ...what's wrong with the first operation I did with x? You weren't using Python 2.5: Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MS

Re: How to invoke ipython in Mac OS X?

2006-10-17 Thread Lou Pecora
In article <[EMAIL PROTECTED]>, "Jerry" <[EMAIL PROTECTED]> wrote: > Did you install it with the --install-scripts command line option? If > you did, then there will be a ipython script located in the > $INSTALL_SCRIPTS/bin directory. If you didn't, then I think the > default location is /usr/l

Re: OT: What's up with the starship?

2006-10-17 Thread rurpy
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > I admit I am totally flmmexed by your answer. > > What does when the bug was introduced have to do with > > anything? > > oh, I thought your main concern was whether the packages available had > been compromised, Yes. > and that you asked if

Re: How to invoke ipython in Mac OS X?

2006-10-17 Thread Diez B. Roggisch
Lou Pecora wrote: > In article <[EMAIL PROTECTED]>, > "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > >> Lou Pecora wrote: >> >> > I installed the SciPy superpackage and have pylab, matplotlib, scipy, >> > and numpy apparently running well. But I want to use matplotlib/pylab >> > interactively

Save/Store whole class (or another object) in a file

2006-10-17 Thread alexLIGO
Hi, is it possible in python (with/without matplotlib, numpy etc) to store a whole class with its data into a file, instead it to reconstruct every time again? So is there an analogous to the matlab functions load/save available? Thanks Alex -- http://mail.python.org/mailman/listinfo/python-l

Re: People's names (was Re: sqlite3 error)

2006-10-17 Thread Florian Diesch
"Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > "Lawrence D'Oliveiro" <[EMAIL PROTECTED]> wrote: > > >> In message <[EMAIL PROTECTED]>, Hendrik van >> Rooyen wrote: >> >> > "Lawrence D'Oliveiro" <[EMAIL PROTECTED]> wrote: >> > >> > 8< >> >

Re: Save/Store whole class (or another object) in a file

2006-10-17 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: > is it possible in python (with/without matplotlib, numpy etc) to > store a whole class with its data into a file Check out the pickle module. Sybren -- Sybren Stüvel Stüvel IT - http://www.stuvel.eu/ -- http://mail.python.org/mailman/listinfo/python-li

Re: Return returns nothing in recursive function

2006-10-17 Thread Fredrik Lundh
Matthew Warren wrote: > I have the following code that implements a simple recursive tree like > structure. > > The trouble is with the GetTreeBranch function, the print statement > prints a valid value but the return immediatley afterward doesn't return > anything. hint: how many "return" state

RE: Return returns nothing in recursive function

2006-10-17 Thread Matthew Warren
> break > else: > _DoThingsToTree(path[1:],value,item[path[0]],delete) > The '_' in front of DoThingsToTree shouldn't be there. That's what I get for trimming off the '_' elsewhere after I pasted the code in. Matt. This email is confidential and

Re: Looking for assignement operator

2006-10-17 Thread Jerry
> class MyClass:Descriptors don't work fine with old-style classes. Interesting, I have used this construct before in Python 2.4.3 and not run into the recursion problem you talk about. Also, it has worked fine for me. Perhaps you can post a link to your source so that I could study it and unders

Re: Python component model

2006-10-17 Thread Peter Wang
Ilias Lazaridis wrote: > Peter Wang wrote: > > Ilias Lazaridis wrote: > > > what about persistency? > > > > Um... what about it? > > " > As far as I can see, there's no persistency binding available. > > Is one planned? > " > http://groups.google.com/group/comp.lang.python/msg/dbdaedc68eee653a Th

Re: Return returns nothing in recursive function

2006-10-17 Thread Larry Bates
Matt, You should consider not using the long footer on posts to comp.lang.python. It doesn't make a lot of sense there. -Larry > This email is confidential and may be privileged. If you are not the intended > recipient please notify the sender immediately and delete the email from your > comp

  1   2   3   >