Re: evaluating code lines above breakpoints ?

2008-08-21 Thread Tim Roberts
Stef Mientki <[EMAIL PROTECTED]> wrote: >Diez B. Roggisch wrote: >> >> Why do you want this anyway? Why don't you simply show all the variables in >> the local frame? I'd say thats enough. > >because it's too much data, and too much data decreases information content. Most Python functions

Re: Sorted Returns List and Reversed Returns Iterator

2008-08-21 Thread Peter Otten
++imanshu wrote: > On Aug 22, 8:40 am, John Machin <[EMAIL PROTECTED]> wrote: >> On Aug 22, 1:35 pm, John Machin <[EMAIL PROTECTED]> wrote: >> >> >> >> > On Aug 22, 12:12 pm, "++imanshu" <[EMAIL PROTECTED]> wrote: >> >> > > Hi, >> >> > > Is there a reason why two similarly named functions Sorted a

Re: Graphics Contexts and DCs explanations?

2008-08-21 Thread Tim Roberts
RgeeK <[EMAIL PROTECTED]> wrote: >... >I use the wxPython demo app heavily to figure this stuff out, and my >experiments seem to work, but I'm flying blind somewhat. > >Can someone englighten me about the wx.GraphicsContext versus wx.PaintDC > (BTW what does PaintDC stand for? Drawing Context p

Re: Do we have python equivalent of 'perl -e'??

2008-08-21 Thread Peter Otten
srinivasan srinivas wrote: > Like we run perl small code snippet using perl -e, do we have anything > like that in python?? Thanks, $ python -c 'print "yes"' yes Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Do we have python equivalent of 'perl -e'??

2008-08-21 Thread Ben Finney
srinivasan srinivas <[EMAIL PROTECTED]> writes: > Like we run perl small code snippet using perl -e, do we have > anything like that in python?? It's customary to check the usage summary of the program itself. = $ python --help usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ..

Do we have python equivalent of 'perl -e'??

2008-08-21 Thread srinivasan srinivas
HI, Like we run perl small code snippet using perl -e, do we have anything like that in python?? Thanks, Srini Unlimited freedom, unlimited storage. Get it now, on http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/ -- http://mail.python.org/mailman/listinfo/python-list

Re: running exe file

2008-08-21 Thread M�ta-MCI (MVP)
Hi! See: system( startfile( subprocess( spawn( etc. @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: Sorted Returns List and Reversed Returns Iterator

2008-08-21 Thread ++imanshu
On Aug 22, 8:40 am, John Machin <[EMAIL PROTECTED]> wrote: > On Aug 22, 1:35 pm, John Machin <[EMAIL PROTECTED]> wrote: > > > > > On Aug 22, 12:12 pm, "++imanshu" <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > >      Is there a reason why two similarly named functions Sorted and > > > Reversed return

Re: exception handling in complex Python programs

2008-08-21 Thread eliben
On Aug 19, 7:34 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On Tue, Aug 19, 2008 at 12:19 PM, eliben <[EMAIL PROTECTED]> wrote: > > Python provides a quite good and feature-complete exception handling > > mechanism for its programmers. This is good. But exceptions, like any > > complex construc

running exe file

2008-08-21 Thread Saurabh Sharma
How can I run .exe file from my python script? -- http://mail.python.org/mailman/listinfo/python-list

Re: exception handling in complex Python programs

2008-08-21 Thread eliben
> Here is an example from a Django web app: when there is a bug, a > generic Exception is thrown and Django catches it and reports a > beautifully formatted stack trace. When something must be reported to > the user, a MyAppException is thrown (not the real name). The HTTP > request handler for the

Re: Address-Of operator equivalent, PAVL search tree

2008-08-21 Thread castironpi
On Aug 21, 11:03 pm, castironpi <[EMAIL PROTECTED]> wrote: > Hi, > > I am translating the GNU library's PAVL search tree implementation > into Python.  I can't use it directly because a delete function I need > uses a different method of finding the node to delete. > > It contains this line: > >  

Address-Of operator equivalent, PAVL search tree

2008-08-21 Thread castironpi
Hi, I am translating the GNU library's PAVL search tree implementation into Python. I can't use it directly because a delete function I need uses a different method of finding the node to delete. It contains this line: q = (struct pavl_node *) &tree->pavl_root; line 276 in http://www.sf

Re: Decorators using instance variables

2008-08-21 Thread castironpi
On Aug 21, 9:22 pm, robert2821 <[EMAIL PROTECTED]> wrote: > Hi, > > I'm new; greetings all! > > I'm wondering if the following program should work.  I think it should > print 'Hello, World', but instead it produces a TypeError.  Is this a > bug in decorators, a feature of them, or a mistake or misu

Re: Sorted Returns List and Reversed Returns Iterator

2008-08-21 Thread John Machin
On Aug 22, 1:35 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Aug 22, 12:12 pm, "++imanshu" <[EMAIL PROTECTED]> wrote: > > > Hi, > > >      Is there a reason why two similarly named functions Sorted and > > Reversed return different types of data or is it an accident. > > You seem to have an inte

Re: Sorted Returns List and Reversed Returns Iterator

2008-08-21 Thread John Machin
On Aug 22, 12:12 pm, "++imanshu" <[EMAIL PROTECTED]> wrote: > Hi, > >      Is there a reason why two similarly named functions Sorted and > Reversed return different types of data or is it an accident. You seem to have an interesting notion of "similarly named". name0[-2:] == name1[-2:], perhaps?

Iowa Python User's Group

2008-08-21 Thread Mike Driscoll
Hi, I am organizing a Python User's Group for Iowa and am hoping there are some Iowans that frequent this list. if you are one and are interested in getting together with other Python-people, reply to this message off-list either to this email or the following: mike (at) pythonlibrary (dot) org.

Decorators using instance variables

2008-08-21 Thread robert2821
Hi, I'm new; greetings all! I'm wondering if the following program should work. I think it should print 'Hello, World', but instead it produces a TypeError. Is this a bug in decorators, a feature of them, or a mistake or misunderstanding on my part? TIA, Bob defgetdec (f):

Sorted Returns List and Reversed Returns Iterator

2008-08-21 Thread ++imanshu
Hi, Is there a reason why two similarly named functions Sorted and Reversed return different types of data or is it an accident. Thanks, ++imanshu -- http://mail.python.org/mailman/listinfo/python-list

Re: Experiences with libical Python bindings?

2008-08-21 Thread Grant Edwards
On 2008-08-21, Grant Edwards <[EMAIL PROTECTED]> wrote: > I searched the c.l.p archive and didn't find any postings > mentioning libical newer than 2002. > > Does that mean it's well documented and "just works", or that > nobody is using it? It looks like the pure-python iCalendar package is a bet

Re: exception handling in complex Python programs

2008-08-21 Thread [EMAIL PROTECTED]
On Aug 20, 10:13 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > It might not be enjoyable to have a sarcastic remark directed your way, > but it isn't a personal attack. Just because a comment is about something > you do doesn't make it a personal attack. Personal attacks are a

Unexpected regex result

2008-08-21 Thread MRAB
I'm working on the sources for the regex module (_sre.c) but I've come across some behaviour that I wasn't aware of before: >>> re.match('((a)|b)*', 'abc').groups() ('b', 'a') The regex module was modified to return this instead of the previous ('b', '') in issue #725106 because both Perl and sed

Re: Question about wx BoxSizer background

2008-08-21 Thread Miki
Hello, > I'm creating a table with gridSizer,  and I'm trying to set cell > background like I use to do with HTML > > so I tried this: > BoxName =wx.BoxSizer(wx.HORIZONTAL) > BoxName.SetBackgroundColour('#cce8fa') > > and it told me their is no sauce function A sizer is just for layout management,

Re: File operations

2008-08-21 Thread John Machin
On Aug 22, 9:33 am, Gary Herron <[EMAIL PROTECTED]> wrote: > aditya shukla wrote: > > Hello guys > > > I am trying to search a file say xyz.txt > > > after searching i get the location of the file in > > > search_file (containing abspath) ,eg search_file="c:\\abc\\xyz.txt" > > > now how should i op

Question about wx BoxSizer background

2008-08-21 Thread Gandalf
I'm creating a table with gridSizer, and I'm trying to set cell background like I use to do with HTML so I tried this: BoxName =wx.BoxSizer(wx.HORIZONTAL) BoxName.SetBackgroundColour('#cce8fa') and it told me their is no sauce function so what is the right way to do it? thanks! -- http://mail

Re: 'While' question

2008-08-21 Thread John Machin
On Aug 22, 9:01 am, Ben Keshet <[EMAIL PROTECTED]> wrote: > Thanks for the reference. I tried it with a general example and got it > to work - I used an index that counts up to a threshold that is set to > break. It does not work though with my real code. I suspect this is > because I cannot real

Re: 'While' question

2008-08-21 Thread Larry Bates
Ben Keshet wrote: Thanks for the reference. I tried it with a general example and got it to work - I used an index that counts up to a threshold that is set to break. It does not work though with my real code. I suspect this is because I cannot really read any lines from an empty file, so the

Re: File operations

2008-08-21 Thread Gary Herron
aditya shukla wrote: Hello guys I am trying to search a file say xyz.txt after searching i get the location of the file in search_file (containing abspath) ,eg search_file="c:\\abc\\xyz.txt" now how should i open this file i can use file=open("c:\\abc\\xyz.txt","rb") but i have to use search

Re: The Importance of Terminology's Quality

2008-08-21 Thread Arne Vajhøj
Piet van Oostrum wrote: Arne Vajhøj <[EMAIL PROTECTED]> (AV) wrote: AV> Robert Maas, http://tinyurl.com/uh3t wrote: John W Kennedy <[EMAIL PROTECTED]> wrote: JWK> Into the 60s, indeed, there were still machines being made JWK> that had no instruction comparable to the mainframe BASx/BALx JWK>

File operations

2008-08-21 Thread aditya shukla
Hello guys I am trying to search a file say xyz.txt after searching i get the location of the file in search_file (containing abspath) ,eg search_file="c:\\abc\\xyz.txt" now how should i open this file i can use file=open("c:\\abc\\xyz.txt","rb") but i have to use search_ file How can this be

Re: 'While' question

2008-08-21 Thread Ben Keshet
Thanks for the reference. I tried it with a general example and got it to work - I used an index that counts up to a threshold that is set to break. It does not work though with my real code. I suspect this is because I cannot really read any lines from an empty file, so the code gets stuck e

Re: Having trouble with tail -f standard input

2008-08-21 Thread Derek Martin
On Thu, Aug 21, 2008 at 02:58:24PM -0700, sab wrote: > I have been working on a python script to parse a continuously growing > log file on a UNIX server. If you weren't aware, there are already a plethora of tools which do this... You might save yourself the trouble by just using one of those.

Re: Having trouble with tail -f standard input

2008-08-21 Thread Diez B. Roggisch
sab schrieb: Hello, I have been working on a python script to parse a continuously growing log file on a UNIX server. The input is the standard in, piped in from the log file. The application works well for the most part, but the problem is when attempting to continuously pipe information into

Re: Could anyone point me to a good site for pearl compiler download

2008-08-21 Thread John Machin
On Aug 22, 5:01 am, [EMAIL PROTECTED] wrote: > I think he wants to know where he can find good abalone. Which he may have confused with baloney. -- http://mail.python.org/mailman/listinfo/python-list

Re: Could anyone point me to a good site for pearl compiler download

2008-08-21 Thread Timothy Grant
On Thu, Aug 21, 2008 at 12:19 PM, Mike Driscoll <[EMAIL PROTECTED]> wrote: > On Aug 21, 1:51 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: >> En Thu, 21 Aug 2008 15:01:16 -0300, rich murphy >> <[EMAIL PROTECTED]> escribió: >> >> > Could anyone point me to a good site for pearl compiler downl

Experiences with libical Python bindings?

2008-08-21 Thread Grant Edwards
I searched the c.l.p archive and didn't find any postings mentioning libical newer than 2002. Does that mean it's well documented and "just works", or that nobody is using it? -- Grant Edwards grante Yow! Wow! Look!! A stray at

Re: 'While' question

2008-08-21 Thread Wojtek Walczak
On Thu, 21 Aug 2008 18:01:25 -0400, Ben Keshet wrote: > somehow. I use 'while 'word' not in line' to recognize words in the > texts. Sometimes, the files are empty, so while doesn't find 'word' and > runs forever. I have two questions: > 1) how do I overcome this, and make the script skip the emp

'While' question

2008-08-21 Thread Ben Keshet
Hi - I am writing now my second script ever in python and need some help with 'while'. I am reading text from a set of files and manipulating the data somehow. I use 'while 'word' not in line' to recognize words in the texts. Sometimes, the files are empty, so while doesn't find 'word' and ru

Having trouble with tail -f standard input

2008-08-21 Thread sab
Hello, I have been working on a python script to parse a continuously growing log file on a UNIX server. The input is the standard in, piped in from the log file. The application works well for the most part, but the problem is when attempting to continuously pipe information into the applicatio

Re: The Jihad Candidate

2008-08-21 Thread Artfishlintlgenz
On Aug 21, 2:10 pm, "hanson" <[EMAIL PROTECTED]> wrote: > AHAHAHAHAHA... ahahahaha... AHAHAHA... --- > > Parki-pooh aka "Lloyd" <[EMAIL PROTECTED]> wrote in messagenews:[EMAIL > PROTECTED] > > thermate at india.com , a genuine ass-venter, cranked > himself and with extreme prejudice h

Re: The Importance of Terminology's Quality

2008-08-21 Thread Martin Gregorie
On Thu, 21 Aug 2008 09:11:48 -0500, Rob Warnock wrote: > You're assuming that all machines *have* some sort of "boot ROM". Before > the microprocessor days, that was certainly not always the case. The > "boot ROM", or other methods of booting a machine without manually > entering at least a small

Re: semantics of the |= operator

2008-08-21 Thread Terry Reedy
akva wrote: Hi All, what's the exact semantics of the |= operator in python? It seems that a |= d is not always equivalent to a = a | d The manual explicitly specifies that mutable objects may implement the operation part of operation-assignments by updating in place -- so that the object

Re: How to simulate packages?

2008-08-21 Thread Daniel
On Aug 21, 2:22 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Daniel a écrit : > > > Hello, > > > I have a project that I've decided to split into packages in order to > > organize my code better.  So what I have looks something like this > > > src > >   -module1 > >     -mod1_file.py > >  

Re: How to simulate packages?

2008-08-21 Thread Daniel
On Aug 21, 12:26 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 21 Aug 2008 13:04:51 -0300, Daniel <[EMAIL PROTECTED]>   > escribi : > > > I have a project that I've decided to split into packages in order to > > organize my code better.  So what I have looks something like this > > >

Re: exception handling in complex Python programs

2008-08-21 Thread Bruno Desthuilliers
magloca a écrit : Bruno Desthuilliers @ Thursday 21 August 2008 17:31: If you mean "the exceptions *explicitely raised* by your code", then I agree. But with any generic enough code, documenting any possible exception that could be raised by lower layers, objects passed in as arguments etc is j

Re: functools's partial and update_wrapper does not work together

2008-08-21 Thread piotr . findeisen
> If not already done by someone else, it might be worth filling a ticket > - generic decorators should work with any callable, not only with > functions (well, IMHO at least). you're right. it's already there http://bugs.python.org/issue3445 regards! -- http://mail.python.org/mailman/listinfo/p

programming toolbox

2008-08-21 Thread William Purcell
Hi all, I started programming with python about a year ago. I am now somewhat experienced with python but have virtually no experience with any other language. I use python to write little command line tools, GUI's to do anything from my time sheet at work to balancing my checkbook, and for school

Re: Is my thinking Pythonic?

2008-08-21 Thread Bruno Desthuilliers
Craig Allen a écrit : generally, I name the members in the Class definition and set them to None there... class Car: Unless you have a really good reason to use an antiquated and deprecated object model, use "new-style" classes (for a value of "new" being "now many years old"): class Car(o

Re: evaluating code lines above breakpoints ?

2008-08-21 Thread Stef Mientki
Diez B. Roggisch wrote: Stef Mientki wrote: hello, I'm trying to create a high level debugger, based on rpd2. So when the debugger enters a breakpoint, I want to display the values of all variables in the, let's say, 5 lines above the breakpoint (if possible). Any hints on how I get a list

Re: How to simulate packages?

2008-08-21 Thread Bruno Desthuilliers
Daniel a écrit : Hello, I have a project that I've decided to split into packages in order to organize my code better. So what I have looks something like this src -module1 -mod1_file.py -module2 -mod2_file.py Everytime I run mod2_file.py I need to import mod1_file.py. Right now

Re: Graphics Contexts and DCs explanations?

2008-08-21 Thread RgeeK
Chris Mellon wrote: This is probably better suited to the wxPython ML instead of c.l.p, because it's so specific. In short: wxDC (and friends) are traditional raster based drawing contexts. wxGraphicsContext is a vector/path based API. If you're doing drawing that's suited for a vector format (l

Re: Could anyone point me to a good site for pearl compiler download

2008-08-21 Thread Mike Driscoll
On Aug 21, 1:51 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 21 Aug 2008 15:01:16 -0300, rich murphy   > <[EMAIL PROTECTED]> escribió: > > > Could anyone point me to a good site for pearl compiler download. > > Would be better to ask for it in a Perl group, don't you think? > > -- >

Re: Prevalent Python/Django academic software

2008-08-21 Thread Daniel Bickett
On Aug 21, 7:39 am, [EMAIL PROTECTED] (Cameron Laird) wrote: > I don't understand the question. YES, there are MANY > Python-based applications doing service in a variety > of academic contexts. No, there is no central index > of all such programs. Sorry if I was unclear. If there are many such

Re: Could anyone point me to a good site for pearl compiler download

2008-08-21 Thread thejmags
I think he wants to know where he can find good abalone. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Behind a Squid Corporate Proxy on Windows

2008-08-21 Thread Danilo
Hi, do you manage to go through the proxy? I'm having the same problem with error 407. I've tried many solutions from the web but it always show the same error. So, if you solved your problem, please, post it here. Thanks Danilo On 18 jul, 15:43, Larry Hale <[EMAIL PROTECTED]> wrote: > Thank you

Re: urllib2 HTTPBasicAuthHandler and resumingbroken downloads

2008-08-21 Thread Gabriel Genellina
En Thu, 21 Aug 2008 15:37:41 -0300, Brendan <[EMAIL PROTECTED]> escribi�: Is there any way to resume an https file download using urllib2 and an HTTPBasicAuthHandler? You should provide the Range header (and probably If-Range too) in the request. http://www.w3.org/Protocols/rfc2616/rfc261

Re: Could anyone point me to a good site for pearl compiler download

2008-08-21 Thread Gabriel Genellina
En Thu, 21 Aug 2008 15:01:16 -0300, rich murphy <[EMAIL PROTECTED]> escribió: Could anyone point me to a good site for pearl compiler download. Would be better to ask for it in a Perl group, don't you think? -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: How to simulate packages?

2008-08-21 Thread Jason Scheirer
On Aug 21, 11:26 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 21 Aug 2008 13:04:51 -0300, Daniel <[EMAIL PROTECTED]>   > escribi : > > > I have a project that I've decided to split into packages in order to > > organize my code better.  So what I have looks something like this > > >

urllib2 HTTPBasicAuthHandler and resumingbroken downloads

2008-08-21 Thread Brendan
Is there any way to resume an https file download using urllib2 and an HTTPBasicAuthHandler? -- http://mail.python.org/mailman/listinfo/python-list

Re: Is my thinking Pythonic?

2008-08-21 Thread Gabriel Genellina
En Thu, 21 Aug 2008 14:31:02 -0300, Craig Allen <[EMAIL PROTECTED]> escribi�: generally, I name the members in the Class definition and set them to None there... class Car: speed = None brand = None def __init__(): self.speed = defaultspeed #alternately, and more commonly, get

Re: How to simulate packages?

2008-08-21 Thread Gabriel Genellina
En Thu, 21 Aug 2008 13:04:51 -0300, Daniel <[EMAIL PROTECTED]> escribi�: I have a project that I've decided to split into packages in order to organize my code better. So what I have looks something like this src -module1 -mod1_file.py -module2 -mod2_file.py Everytime I run mod2

Could anyone point me to a good site for pearl compiler download

2008-08-21 Thread rich murphy
Could anyone point me to a good site for pearl compiler download. -- http://mail.python.org/mailman/listinfo/python-list

Re: mmap and ctypes

2008-08-21 Thread castironpi
On Aug 18, 1:09 am, "Méta-MCI \(MVP\)" <[EMAIL PROTECTED]> wrote: > Hi! > > See here: >  http://www.ponx.org/download/CD/COMdll/autoitmmap.dll > > @-salutations > -- > Michel Claveau I don't see how it fits in. -- http://mail.python.org/mailman/listinfo/python-list

Re: getattr() on nested functions?

2008-08-21 Thread castironpi
On Aug 21, 10:14 am, Bruno Desthuilliers wrote: > Gabriel Rossetti a écrit : > > > > > Bruno Desthuilliers wrote: > >> Gabriel Rossetti a écrit : > >>> Terry Reedy wrote: > >> (snip) > Unlike the class approach, this requires recreating the constant > functions and dict with each call to

Re: exception handling in complex Python programs

2008-08-21 Thread magloca
Bruno Desthuilliers @ Thursday 21 August 2008 17:31: >>> If you mean "the exceptions *explicitely raised* by your code", then >>> I agree. But with any generic enough code, documenting any possible >>> exception that could be raised by lower layers, objects passed in as >>> arguments etc is just p

Re: Is my thinking Pythonic?

2008-08-21 Thread bearophileHUGS
Craig Allen: > class Car: >speed = None >brand = None > >def __init__(): > self.speed = defaultspeed #alternately, and more commonly, get > this speed as a initializer argument > self.brand = defaultbrand > > That solves the issue of being able to "see" all the members of a

Re: Is my thinking Pythonic?

2008-08-21 Thread Diez B. Roggisch
Craig Allen wrote: > generally, I name the members in the Class definition and set them to > None there... > > class Car: >speed = None >brand = None > >def __init__(): > self.speed = defaultspeed #alternately, and more commonly, get > this speed as a initializer argument >

Re: Is my thinking Pythonic?

2008-08-21 Thread Craig Allen
generally, I name the members in the Class definition and set them to None there... class Car: speed = None brand = None def __init__(): self.speed = defaultspeed #alternately, and more commonly, get this speed as a initializer argument self.brand = defaultbrand That solves

Re: Read PDF content

2008-08-21 Thread James Matthews
You can also use pdflib http://www.pdflib.com/download/pdflib-family/pdflib-7/ On Thu, Aug 21, 2008 at 6:47 AM, William Purcell <[EMAIL PROTECTED]>wrote: > Sorry, this last email was meant to be to the list. > > On Thu, Aug 21, 2008 at 8:41 AM, William Purcell < > [EMAIL PROTECTED]> wrote: > >> I

Re: The Jihad Candidate

2008-08-21 Thread Lloyd
On Aug 19, 10:59 pm, [EMAIL PROTECTED] wrote: > DUDE, have you gone mad ? The ZIONIST MEDIA never barked that it was a > jew or a yank bastard when those fake anthrax letters were mailed. 911 > was an > inside job. Thermate cutter charges were used by yank bastards > themselves. > The media never d

How to simulate packages?

2008-08-21 Thread Daniel
Hello, I have a project that I've decided to split into packages in order to organize my code better. So what I have looks something like this src -module1 -mod1_file.py -module2 -mod2_file.py Everytime I run mod2_file.py I need to import mod1_file.py. Right now I'm using an ugly l

Re: Is my thinking Pythonic?

2008-08-21 Thread Bruno Desthuilliers
Hussein B a écrit : Hey, Well, as you all know by now, I'm learning Python :) One thing that is annoying my is the OOP in Python. If so, the answer to your question is "obviously, no" !-) Ok, let's see... Consider this code in Java: -- public class Car { private int speed; private String

Re: functools's partial and update_wrapper does not work together

2008-08-21 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : Hello! I wanted to use a decorator to wrap partially applied function like this: from functools import * def never_throw(f): @wraps(f) def wrapper(*args, **kwargs): try: return f(*args, **kwargs) except: pass Not an answer to your question,

Re: semantics of the |= operator

2008-08-21 Thread Diez B. Roggisch
akva wrote: > Hi All, > > what's the exact semantics of the |= operator in python? > It seems that a |= d is not always equivalent to a = a | d > > For example let's consider the following code: > > def foo(s): >s = s | set([10]) > > def bar(s): >s |= set([10]) > > s = set([1,2]) > >

semantics of the |= operator

2008-08-21 Thread akva
Hi All, what's the exact semantics of the |= operator in python? It seems that a |= d is not always equivalent to a = a | d For example let's consider the following code: def foo(s): s = s | set([10]) def bar(s): s |= set([10]) s = set([1,2]) foo(s) print s # prints set([1, 2]) bar(s)

Re: exception handling in complex Python programs

2008-08-21 Thread Bruno Desthuilliers
eliben a écrit : On Aug 21, 12:40 pm, Bruno Desthuilliers wrote: eliben a écrit :> On Aug 19, 7:19 pm, eliben <[EMAIL PROTECTED]> wrote: (snip) """ Document the exceptions thrown by your code """ If you mean "the exceptions *explicitely raised* by your code", then I agree. But with any gene

Re: getattr() on nested functions?

2008-08-21 Thread Bruno Desthuilliers
Gabriel Rossetti a écrit : Bruno Desthuilliers wrote: Gabriel Rossetti a écrit : Terry Reedy wrote: (snip) Unlike the class approach, this requires recreating the constant functions and dict with each call to _test. Quick to write but a bit 'dirty', in my opinion. Another standard idiom is

Re: Prevalent Python/Django academic software

2008-08-21 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Daniel Bickett <[EMAIL PROTECTED]> wrote: >Is anyone working on any software at present, using django or python >in general, which serves various academic/course functions, or else >that of student-instructor arbitration? A popular example which my >university uses

Re: Question re ConfigParser

2008-08-21 Thread loial
On 20 Aug, 13:49, alex23 <[EMAIL PROTECTED]> wrote: > On Aug 20, 5:34 pm, loial <[EMAIL PROTECTED]> wrote: > > > Given a section like > > > [Data] > > value1 > > value2 > > value3 > > > Can ConfigParser be easily used to put the values in a dictionary? If > > so, how? > > Dictionaries are key/value

Re: Tkinter/WindowsXP - how to use checkbutton to toggle a label in GUI?

2008-08-21 Thread Gabriel Genellina
En Thu, 21 Aug 2008 05:07:45 -0300, <[EMAIL PROTECTED]> escribi�: I've a checkbutton in my GUI application which I want to work as: 1. it should be un-ticked by default, 2. should display a label in Gui, by default, 3. when user ticks the check button this should the above label goes off the sc

Re: Newbie needs help with... his blood pressure ;-)

2008-08-21 Thread Paul Boddie
On 21 Aug, 14:57, Luis Speciale <[EMAIL PROTECTED]> wrote: > > /usr/sbin/apxs -I/Users/speciale/Desktop/dossier sans titre 3/src/include [...] I imagine that if this is really the command run by the Makefile, apxs might get upset by the unquoted path which contains spaces. Either the Makefile nee

Re: The Importance of Terminology's Quality

2008-08-21 Thread Rob Warnock
[EMAIL PROTECTED]> wrote: +--- | [EMAIL PROTECTED] (Rob Warnock) wrote: | >In the LGP-30, they used hex addresses, sort of[1], but the opcodes | >(all 16 of them) had single-letter mnemonics chosen so that the | >low 4 bits of the character codes *were* the correct nibble for | >the opc

Re: Prevalent Python/Django academic software

2008-08-21 Thread tobias.oleary
Blackboard and Moodle are the dominant players in the area you're talking about. If you are trying to help people out then I suggest writing more Moodle modules. If you are trying to make money good luck. -- http://mail.python.org/mailman/listinfo/python-list

Re: getattr() on nested functions?

2008-08-21 Thread Gabriel Rossetti
Bruno Desthuilliers wrote: Gabriel Rossetti a écrit : Terry Reedy wrote: (snip) Unlike the class approach, this requires recreating the constant functions and dict with each call to _test. Quick to write but a bit 'dirty', in my opinion. Another standard idiom is to set up the constants ou

Re: wx scroll bar

2008-08-21 Thread William Purcell
I have been wanting to figure this out. I used a couple of your code snippets below and I can get a scroll bar. When I scroll down, it doesn't scroll the panel down. The only thing that happens is that the scroll bar moves up and down. Any thoughts? On Thu, Aug 21, 2008 at 8:36 AM, Gandalf <[EMAIL

Re: Read PDF content

2008-08-21 Thread William Purcell
Sorry, this last email was meant to be to the list. On Thu, Aug 21, 2008 at 8:41 AM, William Purcell <[EMAIL PROTECTED]>wrote: > I have been trying to do the same thing. Here is something I came up with, > although it's not completely dependent on Python. It requires pdftotext to > be installed.

Re: wx scroll bar

2008-08-21 Thread Gandalf
On Aug 21, 2:42 pm, Gandalf <[EMAIL PROTECTED]> wrote: > Hi every one. I'm not sure whether my framework is relevant so i will > mention it any way. > windows XP > python 2.5.2 > wx 2.8 something... > > I'm trying to scroll a panel element  and it doesn't work. (maybe this > function doesn't suppos

Re: Newbie needs help with... his blood pressure ;-)

2008-08-21 Thread Luis Speciale
Oups. Bad beginning. Sorry for the double post. Thunderbird has mental problems Luis -- http://mail.python.org/mailman/listinfo/python-list

Re: python custom command interpreter?

2008-08-21 Thread Derek Martin
On Thu, Aug 21, 2008 at 05:17:41AM +, Marc 'BlackJack' Rintsch wrote: > On Wed, 20 Aug 2008 18:46:42 -0400, Derek Martin wrote: > > > How so? What could be easier than "rm -rf directory"? > > C:\>rm -rf directory Yeah, except the application specified by the OP is to remove directories duri

Newbie needs help with... his blood pressure ;-)

2008-08-21 Thread Luis Speciale
Hi I'm trying to build mod_pyton on Leopard 10.5.4 on a Mac G5 with this cvs version http://svn.apache.org/repos/asf/quetzalcoatl/mod_python/trunk with this Python python Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53) [GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin So i did ./confi

Re: Is my thinking Pythonic?

2008-08-21 Thread Paul Boddie
On 21 Aug, 14:21, Hussein B <[EMAIL PROTECTED]> wrote: > If you have a huge class, you can't figure the instance variables of > each object. > So, I created this constructor: > -- > def __init__(self): >   self.speed = None >   self.brand = None > -- > This way, I can figure the instance variables

wx scroll bar

2008-08-21 Thread Gandalf
Hi every one. I'm not sure whether my framework is relevant so i will mention it any way. windows XP python 2.5.2 wx 2.8 something... I'm trying to scroll a panel element and it doesn't work. (maybe this function doesn't supposed to scroll element like this) this is the relevant code: wx.Frame._

Re: exception handling in complex Python programs

2008-08-21 Thread eliben
On Aug 21, 12:40 pm, Bruno Desthuilliers wrote: > eliben a écrit :> On Aug 19, 7:19 pm, eliben <[EMAIL PROTECTED]> wrote: > >> Python provides a quite good and feature-complete exception handling > > > > > Thanks for the interesting discussion. Armed by the new information > > and few online sour

Re: Is my thinking Pythonic?

2008-08-21 Thread Diez B. Roggisch
Hussein B wrote: > Hey, > Well, as you all know by now, I'm learning Python :) > One thing that is annoying my is the OOP in Python. > Consider this code in Java: > -- > public class Car { > private int speed; > private String brand; > // setters & getters > } > -- > With one look at the top

Re: Is my thinking Pythonic?

2008-08-21 Thread bearophileHUGS
Hussein B: > class Car: > def setspeed(self, speed): > self.speed = speed > def setbrand(self, brand): > self.brand = brand You can also learn the _attribute and __attribute conventions. In Python getter/setters are used less often, you can remove those two setters and just access th

Newbie needs help with his blood pressure...

2008-08-21 Thread Luis Speciale
Hi u all : I'm trying to build mod_python in Leopard 10.5.4 with a cvs version from http://svn.apache.org/repos/asf/quetzalcoatl/mod_python/trunk I have $ python Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53) [GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin Then when I try ./configu

Re: exception handling in complex Python programs

2008-08-21 Thread eliben
> >http://eli.thegreenplace.net/2008/08/21/robust-exception-handling/ > > Just a few random points. You say: > > "Exceptions are better than returning error status codes. Some languages > (like Python) leave you with no choice as the whole language core and > standard libraries throw exceptions." >

Is my thinking Pythonic?

2008-08-21 Thread Hussein B
Hey, Well, as you all know by now, I'm learning Python :) One thing that is annoying my is the OOP in Python. Consider this code in Java: -- public class Car { private int speed; private String brand; // setters & getters } -- With one look at the top of the class, you can know that each ins

ISLAM and the AIM of LIFE

2008-08-21 Thread aassime abdellatif
ISLAM and the AIM of LIFE What is your purpose in life? What is the rationale behind our life? Why do we live in this life? These questions frequently intrigue people who try to find accurate answers. People provide different answers to these questions. Some people believe the purpose of life is

ISLAM and the AIM of LIFE

2008-08-21 Thread aassime abdellatif
ISLAM and the AIM of LIFE What is your purpose in life? What is the rationale behind our life? Why do we live in this life? These questions frequently intrigue people who try to find accurate answers. People provide different answers to these questions. Some people believe the purpose of life is

  1   2   >