Re: Python or PHP?

2005-04-24 Thread Ville Vainio
> "John" == John Bokma <[EMAIL PROTECTED]> writes: John> Who told you Perl can't do exceptions? Back when I learned (heh, I never 'really' learned, but knew enough to write programs in it) perl, almost every function call was followed by or die("blah"); i.e. the user had to check the er

Re: What's do list comprehensions do that generator expressions don't?

2005-04-24 Thread Robert Kern
Steven Bethard wrote: Robert Kern wrote: Mike Meyer wrote: Ok, we've added list comprehensions to the language, and seen that they were good. We've added generator expressions to the language, and seen that they were good as well. I'm left a bit confused, though - when would I use a list comp inste

Re: What's do list comprehensions do that generator expressions don't?

2005-04-24 Thread Steven Bethard
Robert Kern wrote: Mike Meyer wrote: Ok, we've added list comprehensions to the language, and seen that they were good. We've added generator expressions to the language, and seen that they were good as well. I'm left a bit confused, though - when would I use a list comp instead of a generator expr

Re: Decorator pattern for new-style classes ?

2005-04-24 Thread Michele Simionato
I have no time for a long discussion, but the code should speak for itself: class Container(object): def __init__(self, content): self.content = content def __str__(self): return "" % self.content class Wrapped(object): def __init__(self, obj): self._obj = obj

Re: What's do list comprehensions do that generator expressions don't?

2005-04-24 Thread Robert Kern
Mike Meyer wrote: Ok, we've added list comprehensions to the language, and seen that they were good. We've added generator expressions to the language, and seen that they were good as well. I'm left a bit confused, though - when would I use a list comp instead of a generator expression if I'm going

What's do list comprehensions do that generator expressions don't?

2005-04-24 Thread Mike Meyer
Ok, we've added list comprehensions to the language, and seen that they were good. We've added generator expressions to the language, and seen that they were good as well. I'm left a bit confused, though - when would I use a list comp instead of a generator expression if I'm going to require 2.4 a

Re: cross platform printing

2005-04-24 Thread Mike Meyer
"David Isaac" <[EMAIL PROTECTED]> writes: >> Alan Isaac wrote: > I meant something that application users on different platforms can print > with, not something > that they could coerce a platform into supporting given enough energy (e.g., > via Cygwin). > The closest to an option so far seems to

Re: Python or PHP?

2005-04-24 Thread Mike Meyer
John Bokma <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> John Bokma <[EMAIL PROTECTED]> writes: >>> Mike Meyer wrote: John Bokma <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> Depends on the problem. If it's one of the things for which Python >> has an obvious solution (so

Re: Variables

2005-04-24 Thread Richard Blackwood
I thought I'd share a piece of the discussion a friend of mine is having with a mathematician/programmer on this issue of variables: int foo = 5; Is foo not a variable? Within the scope of that statement, foo can be no other value but 5. Is foo not a constant? Are constants and variables not mu

ANN: Wing IDE 2.0.3 released

2005-04-24 Thread Wingware Announce
Hi, I'm happy to announce the release of Wing IDE version 2.0.3, an advanced development environment for the Python programming language. This is a free upgrade for Wing IDE 2.0 users. The release can be downloaded from: http://wingware.com/downloads Wing IDE provides powerful debugging, editi

Re: Utah Python Users Group

2005-04-24 Thread Jim Hargrave
I'm a Computational Linguist just starting with Python. I personally would be very interested in a UT Python group. Jim lugal wrote: Is anyone aware if there's a Utah-based Python User Group? If not, does any else from Utah have any interest in forming a Utah-based Python User Group? -- http://ma

Re: Decent Win32All Documentation

2005-04-24 Thread Roger Binns
"Harlin Seritt" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Does anyone know of any decent documenation on Mark Hammond's win32all > modules? I have tried looking at the documentation .chm file that comes > with it, Python Programming On Win32 (OReilly book) and ActiveState's > d

Re: Is this a bug?

2005-04-24 Thread Grant Edwards
On 2005-04-25, Robert Kern <[EMAIL PROTECTED]> wrote: >> I certainly don't see how. Strings are immutable. The old >> object can't be modified in-place, so the "in-place" behavior >> is moot. > > It's the left-hand-side, in this case a list, that gets modified > in-place. Whether the right-hand

Re: Is this a bug?

2005-04-24 Thread Robert Kern
Grant Edwards wrote: On 2005-04-25, Terry Reedy <[EMAIL PROTECTED]> wrote: According to the language reference, An augmented assignment expression like x += 1 can be rewritten as x = x + 1 to achieve a similar, but not exactly equal effect. In the augmented version, x is only eval

Re: Multiple tuples for one for statement

2005-04-24 Thread Daniel Cer
Harlin Seritt wrote: I have three tuples of the same size: tup1, tup2, tup3 I'd like to do something like this: for a,b,c in tup1, tup2, tup3: print a print b print c Of course, you get an error when you try to run the pseudocode above. What is the correct way to get this done? For somethi

Re: Multiple tuples for one for statement

2005-04-24 Thread Harlin Seritt
Thank you Mr. Stroud. -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple tuples for one for statement

2005-04-24 Thread Kent Johnson
Harlin Seritt wrote: I have three tuples of the same size: tup1, tup2, tup3 I'd like to do something like this: for a,b,c in tup1, tup2, tup3: print a print b print c Presuming that you want a,b,c to be corresponding entries from the three tuples, then zip() is your friend: for a,b,c in z

Re: Multiple tuples for one for statement

2005-04-24 Thread Steven Bethard
Harlin Seritt wrote: I have three tuples of the same size: tup1, tup2, tup3 I'd like to do something like this: for a,b,c in tup1, tup2, tup3: print a print b print c Of course, you get an error when you try to run the pseudocode above. What is the correct way to get this done? for a, b, c

Re: Multiple tuples for one for statement

2005-04-24 Thread James Stroud
for a,b,c in zip(tup1, tup2, tup3): print a print b print c -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 http://www.jamesstroud.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: opening new window in one window using Tkinter -- Help please

2005-04-24 Thread Clara
I've found the solution I must destroy the first window using self.master.destroy(), but thanks anyway ^_^ -- http://mail.python.org/mailman/listinfo/python-list

Multiple tuples for one for statement

2005-04-24 Thread Harlin Seritt
I have three tuples of the same size: tup1, tup2, tup3 I'd like to do something like this: for a,b,c in tup1, tup2, tup3: print a print b print c Of course, you get an error when you try to run the pseudocode above. What is the correct way to get this done? Thanks, Harlin -- http://

Re: Variables

2005-04-24 Thread Richard Blackwood
James Stroud wrote: On Saturday 23 April 2005 10:25 pm, so sayeth Richard Blackwood: Unfortunately that's not much of an option for me. We are working on a project together so I am forced to either prove his notion incorrect or I give in to his conception. *throws hands in air* This is a co

Re: cross platform printing

2005-04-24 Thread David Isaac
> Alan Isaac wrote: > > What is the current best practice for cross platform printing of PostScript > > files from Python? "Warren Postma" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Well since printing postscript files on most Unix systems (probably > including Mac OSX although

Re: Is this a bug?

2005-04-24 Thread Grant Edwards
On 2005-04-25, Terry Reedy <[EMAIL PROTECTED]> wrote: >>According to the language reference, >> >> An augmented assignment expression like x += 1 can be >> rewritten as x = x + 1 to achieve a similar, but not >> exactly equal effect. In the augmented version, x is only >> ev

Re: Parsing data from URL

2005-04-24 Thread R. C. James Harlow
On Monday 25 April 2005 01:24, Harlin Seritt wrote: > dat = urllib.urlopen(url, 'r').read() Drop the 'r' - urlopen is posting the 'r' to the server, instead of doing what you mean, opening the file read-only. pgpmZ2zcMs1bO.pgp Description: PGP signature -- http://mail.python.org/mailman/listi

Re: Parsing data from URL

2005-04-24 Thread could ildg
I think it depends on the server On 24 Apr 2005 17:24:18 -0700, Harlin Seritt <[EMAIL PROTECTED]> wrote: > I am trying to do the following: > > > > import urllib > > url = 'http://www.website.com/file.shtml' > dat = urllib.urlopen(url, 'r').read() > print dat > > When I do so, I get the follo

Re: pygtk and long running process

2005-04-24 Thread Daniel Cer
Daniel Cer wrote: Robert wrote: I have a command line app that can take up to 20 minutes to complete and every minute or so updates it's status (spits it out to console). I am writing a front end for this app in python/gtk and was wondering what command I use to a) invoke the command and b) how to

Re: Is this a bug?

2005-04-24 Thread Terry Reedy
>According to the language reference, > > An augmented assignment expression like x += 1 can be > rewritten as x = x + 1 to achieve a similar, but not > exactly equal effect. In the augmented version, x is only > evaluated once. > >I don't consider the two results you po

Re: pygtk and long running process

2005-04-24 Thread Daniel Cer
Robert wrote: I have a command line app that can take up to 20 minutes to complete and every minute or so updates it's status (spits it out to console). I am writing a front end for this app in python/gtk and was wondering what command I use to a) invoke the command and b) how to capture it's out

Re: HTML cleaner?

2005-04-24 Thread George Sakkis
Probably you're looking for Beautiful Soup: http://www.crummy.com/software/BeautifulSoup/ George -- http://mail.python.org/mailman/listinfo/python-list

Parsing data from URL

2005-04-24 Thread Harlin Seritt
I am trying to do the following: import urllib url = 'http://www.website.com/file.shtml' dat = urllib.urlopen(url, 'r').read() print dat When I do so, I get the following data: 405 Method Not Allowed Method Not Allowed The requested method POST is not allowed for the URL Apache/1.3.27 Se

pygtk and long running process

2005-04-24 Thread Robert
Hi, I have a command line app that can take up to 20 minutes to complete and every minute or so updates it's status (spits it out to console). I am writing a front end for this app in python/gtk and was wondering what command I use to a) invoke the command and b) how to capture it's out put and f

Re: Decent Win32All Documentation

2005-04-24 Thread Harlin Seritt
Kartic, Thanks for the help. It's good to get a different perspective on something (i.e. MSDN, dir() etc). -- http://mail.python.org/mailman/listinfo/python-list

Re: How to "generalize" a function?

2005-04-24 Thread Scott David Daniels
Alexander Schmolck wrote: [1] Best practice would be something like this (don't worry to much about it -- it just ensures the file is properly closed, even if something goes wrong): confFile = None try: confFile = open(networkConf, 'w') confFile.wr

HTML cleaner?

2005-04-24 Thread Ivan Voras
Is there a HTML clean/tidy library or module written in pure python? I found mxTidy, but it's a interface to command-line tool. What I'm searching is something that will accept a list of allowed tags and/or attributes and strip the rest from HTML string. -- http://mail.python.org/mailman/listin

Re: How to "generalize" a function?

2005-04-24 Thread Michael Spencer
Thomas Köllmann wrote: Hi, everybody! I'm teaching myself Python, and I have no experience in programming apart from some years of shell scripting. So, please bear with me. These two funktions are part of an administrative script I've set myself as a first lesson, and, as you will see, they're prac

Re: Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you are, nor if you are a church member, but are you saved? Are you sure you will go to Heaven when you die? GOOGLE·NEWSGROUP·POST·149

2005-04-24 Thread Please
Reports to [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] And do not feed the troll! -- http://mail.python.org/mailman/listinfo/python-list

Re: How to "generalize" a function?

2005-04-24 Thread Alexander Schmolck
Thomas Köllmann <[EMAIL PROTECTED]> writes: > confFile.close You want ``confFile.close()`` -- the above won't do anything [1]. 'as Footnotes: [1] Best practice would be something like this (don't worry to much about it -- it just ensures the file is properly closed, even if somethin

Re: How to "generalize" a function?

2005-04-24 Thread Dan Sommers
On Sun, 24 Apr 2005 23:40:22 +0200, Thomas KÃllmann <[EMAIL PROTECTED]> wrote: > Hi, everybody! > I'm teaching myself Python, and I have no experience in programming > apart from some years of shell scripting. So, please bear with me. > These two funktions are part of an administrative script I'v

Re: Getting into Python, comming from Perl.

2005-04-24 Thread Steve Holden
Miguel Manso wrote: Mike Meyer wrote: Miguel Manso <[EMAIL PROTECTED]> writes: I've tryed to use python some times but I get frustrated very quick. I get myself many times needing to figure out how to loop through a list, declare an associative array, checking how to pass named parameters to fun

Re: Python or PHP?

2005-04-24 Thread Mike Meyer
John Bokma <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> John Bokma <[EMAIL PROTECTED]> writes: >>> Mike Meyer wrote: Depends on the problem. If it's one of the things for which Python has an obvious solution (sort a list; split a string on whitespace; pull select list elements

Re: Python or PHP?

2005-04-24 Thread Steve Holden
Leif Biberg Kristensen wrote: Leif K-Brooks skrev: But Python's DB-API (the standard way to connect to an SQL database from Python) makes escaping SQL strings automatic. You can do this: cursor.execute('UPDATE foo SET bar=%s WHERE id=%s', ["foo'bar", 123]) So. I've been writing SQL queries in Pyt

Re: Getting into Python, comming from Perl.

2005-04-24 Thread Ivan Voras
Mage wrote: foo = dict() or: foo = {} -- http://mail.python.org/mailman/listinfo/python-list

Re: Python or PHP?

2005-04-24 Thread Ville Vainio
> "John" == John Bokma <[EMAIL PROTECTED]> writes: >> Nah, they aren't slow. They just have to worry about more things than >> the Python developers. John> Do you have references to this? I would love to see if John> indeed 100 Python programmers do implement, say 5 CS tasks

kickoff -- wikalong documentation for Python

2005-04-24 Thread Steve
I've kicked off wikalong documentation for Python by adding an example program to the documentation for the HTMLParser module. See http://python.org/doc/current/lib/module-HTMLParser.html (Generally, I think most wikalong annotations won't take the form of complete example programs, but this was a

Re: Variables

2005-04-24 Thread Rocco Moretti
Richard Blackwood wrote: Robert Kern wrote: His problem is that he doesn't respect that technical terms can have different meanings in different fields and contexts. No authoritative reference can solve his problem for him. He's being overly pedantic about a field in which *he* is clearly not an

Re: Object oriented storage with validation (was: Re: Caching compiled regexps across sessions (was Re: Regular Expressions - Python vs Perl))

2005-04-24 Thread Ville Vainio
> "Ilpo" == Ilpo NyyssÃnen writes: Ilpo> Pickle doesn't have validation. I am not comfortable for Ilpo> using it as storage format that should be reliable over Ilpo> years when the program evolves. It also doesn't tell me if That's why you should implement xml import/export mecha

Re: Bounding box on clusters in a 2D list

2005-04-24 Thread bearophileHUGS
[EMAIL PROTECTED]: > hi Bearphile! That really gives me an idea.Thanks much for that. Yes as > you said the algorithm reaches a maximium recursion depth for larger > sets i tried. You can improve the little flood filling function, avoiding the "bad" Python recursivity. > Do you see where I am he

Re: Python or PHP?

2005-04-24 Thread Rocco Moretti
Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2005-04-23 15:53:17 +0200: Lad wrote: Is anyone capable of providing Python advantages over PHP if there are any? The irreverant would point you to http://www.python.org/doc/Humor.html#vowels *I* wouldn't consider doing anything like that, though. ch

Re: Bounding box on clusters in a 2D list

2005-04-24 Thread Bengt Richter
On 24 Apr 2005 09:44:49 -0700, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >Richter,yes what I am looking for is for cluster with rectangular >bounding boxes as you explained in the first figure. > Sorry, not your fault, but I'm still not clear on diagonal connection/separation. E.g., (removin

Re: Getting into Python, comming from Perl.

2005-04-24 Thread Miguel Manso
Mike Meyer wrote: Miguel Manso <[EMAIL PROTECTED]> writes: I've tryed to use python some times but I get frustrated very quick. I get myself many times needing to figure out how to loop through a list, declare an associative array, checking how to pass named parameters to function

Re: Using Ming on Windows

2005-04-24 Thread Do Re Mi chel La Si Do
Hi ! You can to generate SWF (flash) files, with swfobjs.dll See : http://bukoo.sourceforge.net and http://www.angelfire.com/nt/teklord/swfexport.htm I succeeded, therefore, it is easy... Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: Variables

2005-04-24 Thread Jeremy Bowers
On Sat, 23 Apr 2005 22:45:14 -0400, Richard Blackwood wrote: > Indeed, this language is math. My friend says that foo is a constant and > necessarily not a variable. If I had written foo = raw_input(), he would > say that foo is a variable. Which is perfectly fine except that he insists > that sinc

Re: Getting into Python, comming from Perl.

2005-04-24 Thread Mike Meyer
Miguel Manso <[EMAIL PROTECTED]> writes: > I've tryed to use python some times but I get frustrated very quick. I > get myself many times needing to figure out how to loop through a > list, declare an associative array, checking how to pass named > parameters to functions, and simple things like t

Re: Python or PHP?

2005-04-24 Thread Bruno Desthuilliers
Lad a trollé : Is anyone capable of providing Python advantages over PHP if there are any? Why don't you check by yourself ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python or PHP?

2005-04-24 Thread Bruno Desthuilliers
Mage a écrit : I can tell: - python is more *pythonic* than php Keyboard !-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this a bug?

2005-04-24 Thread Michael Sparks
[EMAIL PROTECTED] wrote: > when you use a = a + 'world' python sees it as an error because of > different type. > > But when you use a += 'world' > python will change the right into list (because a is a list). So when > you're code become: > a += 'world' # a += list('world') > > It really helpf

Re: opening new window in one window using Tkinter -- Help please

2005-04-24 Thread Clara
since the file where i call the first window and the second window is different,.If I put app.master.withdraw() there,...won't I get error message that says; app is not defined as global or something like that? -- http://mail.python.org/mailman/listinfo/python-list

Re: opening new window in one window using Tkinter -- Help please

2005-04-24 Thread Fredrik Lundh
"Clara" wrote: > Well, but where do I call withdraw? when you want the new window to appear, and the old one to go away, of course. something like this, perhaps? from mainmenu import FileManager app2 = FileManager(self.username.get()) app2.master.title("File Manager") app2.master.maxsiz

Re: opening new window in one window using Tkinter -- Help please

2005-04-24 Thread Clara
Forgive my ignorance, but where do I call withdraw? -- http://mail.python.org/mailman/listinfo/python-list

Re: opening new window in one window using Tkinter -- Help please

2005-04-24 Thread Clara
Well, but where do I call withdraw? -- http://mail.python.org/mailman/listinfo/python-list

Re: filename used by shelve

2005-04-24 Thread Fredrik Lundh
"Nemesis" <[EMAIL PROTECTED]> wrote: > So the real filename may be different from the argument passed to > "open". I have this problem, I want to delete (in some circustances) the > file created by shelve.open, how can I know which is the name of this > file (or files) ? if you put the shelve in

Re: when will the file be closed

2005-04-24 Thread Fredrik Lundh
"Mage" <[EMAIL PROTECTED]> wrote: > The question is above: when will these file be closed? > > for s in file('/etc/passwd'): > print s > > file('/home/mage/test.txt','w').write('foo') when the interpreter gets around to it. if you want to make sure that a file is closed at a given point in y

Re: opening new window in one window using Tkinter -- Help please

2005-04-24 Thread Fredrik Lundh
"Clara" wrote: > I meant to write an application where there is a button in a window and > when you click on the button, it will open a new window, but I want the > first window to close, replaced by the second window. > I open a login window and start the mainloop, when the user click on > the lo

Re: Getting into Python, comming from Perl.

2005-04-24 Thread Fredrik Lundh
Miguel Manso wrote: > I've tryed to use python some times but I get frustrated very quick. I > get myself many times needing to figure out how to loop through a list, http://docs.python.org/tut/node6.html#SECTION00620 > declare an associative array, http://docs.python.org/tut/n

when will the file be closed

2005-04-24 Thread Mage
Hello, The question is above: when will these file be closed? for s in file('/etc/passwd'): print s file('/home/mage/test.txt','w').write('foo') Mage -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting into Python, comming from Perl.

2005-04-24 Thread Mage
Miguel Manso wrote: > > > I've tryed to use python some times but I get frustrated very quick. I > get myself many times needing to figure out how to loop through a > list, declare an associative array, checking how to pass named > parameters to functions, and simple things like that. list = [3,5

filename used by shelve

2005-04-24 Thread Nemesis
In the python docs about shelve module I read: - open( filename[,flag='c'[,protocol=None[,writeback=False[,binary=None) Open a persistent dictionary. The filename specified is the base filename for the underl

Re: Variables

2005-04-24 Thread Kirk Job Sluder
Richard Blackwood <[EMAIL PROTECTED]> writes: > Bengt Richter wrote: > > >Tell him in Python foo is a member of one set and 5 is a member of another, > >and foo = 5 expresses the step of putting them into correspondence > >to define a mapping, not declaring them equal. > > > Could I honestly argu

opening new window in one window using Tkinter -- Help please

2005-04-24 Thread Clara
Hi,... I meant to write an application where there is a button in a window and when you click on the button, it will open a new window, but I want the first window to close, replaced by the second window. I open a login window and start the mainloop, when the user click on the login button, the __c

Re: Getting into Python, comming from Perl.

2005-04-24 Thread Michael Soulier
On 4/24/05, Miguel Manso <[EMAIL PROTECTED]> wrote: > I'm a programmer with 5 year of experience into Perl. I'm on that point > where you resolve problems without thinking on HOW you'll do it with > that language but only on the problem itself. I code in perl and C all day. Python is a very nice e

Re: Variables

2005-04-24 Thread Kirk Job Sluder
Richard Blackwood <[EMAIL PROTECTED]> writes: > Unfortunately that's not much of an option for me. We are working on a > project together so I am forced to either prove his notion incorrect > or I give in to his conception. *throws hands in air* Well, one option is to give in to his conception an

Getting into Python, comming from Perl.

2005-04-24 Thread Miguel Manso
Hi, list. I'm into a psicological doubt that I would like to share with you (you'll know why later on this mail). I'm a programmer with 5 year of experience into Perl. I'm on that point where you resolve problems without thinking on HOW you'll do it with that language but only on the problem it

Re: Rudeness on this list [Re: rudeness was: Python licence again]

2005-04-24 Thread Ivan Van Laningham
Hi All-- James Stroud wrote: > > On Sunday 24 April 2005 06:59 am, so sayeth François Pinard: > > As seen from here, the Python mailing list quality has been degrading > > significantly for the last half-year or so. > > That's funny. That's exactly as long as I've been on this list. I wonder if

Re: Variables

2005-04-24 Thread Kirk Job Sluder
Richard Blackwood <[EMAIL PROTECTED]> writes: > Fantastic, wikipedia deals precisely with the difference between > variables in mathematics versus programming. However, he would never > trust a definition from such an "unreputable" source. If you have any > other sources I might direct him to...he

Re: Variables

2005-04-24 Thread James Stroud
On Saturday 23 April 2005 10:25 pm, so sayeth Richard Blackwood: > Unfortunately that's not much of an option for me. We are working on a > project together so I am forced to either prove his notion incorrect or > I give in to his conception. *throws hands in air* This is a communcication issue. Y

Re: Variables

2005-04-24 Thread Donn Cave
Quoth Mike Meyer <[EMAIL PROTECTED]>: ... | He's right - programming is an offshoot of mathematics. It adds | *dynamics* to the structures of mathematics. In mathematics, a | construct (graph, function, mapping, set, whatever) is immutable. You | can talk about things that change with time, but you

Re: Variables

2005-04-24 Thread Kirk Job Sluder
Richard Blackwood <[EMAIL PROTECTED]> writes: > Kent Johnson wrote: > That is exactly how I feel about it. Foo is what it is. Variable, name > bound to immutable value, etc., what we call it doesn't really change > how I program, only how I communicate with other programmers (and > mathematicians)

Re: Rudeness on this list [Re: rudeness was: Python licence again]

2005-04-24 Thread James Stroud
On Sunday 24 April 2005 06:59 am, so sayeth François Pinard: > As seen from here, the Python mailing list quality has been degrading > significantly for the last half-year or so. That's funny. That's exactly as long as I've been on this list. I wonder if the correlation is causal? -- James Stro

Re: [EVALUATION] - E03 - jamLang Evaluation Case Applied to Python

2005-04-24 Thread Ilias Lazaridis
Ilias Lazaridis wrote: [EVALUATION] - E02 - Support for MinGW Open Source Compiler http://groups-beta.google.com/group/comp.lang.python/msg/f5cd74aa26617f17 - In comparison to the E02 thread, now a more practical one. - Here is a simple evaluation template (first part) which can be applied to the

Awesome Directory

2005-04-24 Thread Anusha
Hello there, Try visiting this well listed Directory on Computers and Internet! ... Here is the link http://hi-fiweb.com/comp Hoping to learn a lot from other group members. Take care, Kathy -- http://mail.python.org/mailman/listinfo/python-list

Re: func_code vs. string problem

2005-04-24 Thread Filip Dreger
Uzytkownik "Steven Bethard" <[EMAIL PROTECTED]> napisal w wiadomosci news:[EMAIL PROTECTED] > Any reason you can't define it like: > > class actor(object): > def __init__(self): > self.roles = [] > def act(self): > for role_func in self.roles: > role_func(self)

Re: Bounding box on clusters in a 2D list

2005-04-24 Thread [EMAIL PROTECTED]
hi Bearphile! That really gives me an idea.Thanks much for that. Yes as you said the algorithm reaches a maximium recursion depth for larger sets i tried.I still have a question. if m = [[0,0,0,0],[0,1,1,0,0],[0,0,1,0,0],[0,0,0,0]] all it does is count the number of 1's and return us the number in

Re: Using Ming on Windows

2005-04-24 Thread Philippe C. Martin
I never managed to link my python extensions (mingw .a) with python and broke down and bought Visual/C++ as it is the compiler used by Python. Yet some people seem to have managed: http://uucode.com/texts/python-mingw/python-mingw.html Regards, Philippe Jack Diederich wrote: > On Sat, Apr 23

Re: Why is Python not supporting full derivation of built-in file class?

2005-04-24 Thread Jeff Epler
This issue was discussed in another recent python-list thread, called "Writing to stdout and a log file". My second post includes a patch to Python's "fileobject.c" that made the code that started that thread work, but for reasons I mentioned in that post I didn't want to push for inclusion of my

Re: [OT] Graphic editor within an MFC app. I have a wxPython prototype, that...

2005-04-24 Thread Philippe C. Martin
Does that mean you are using C++/C# and not Python ? I also guess you do not wish MFC and wxWindows to coexist in the same .exe as the reasons for conflict are many (GDI port, main event loop .) Then do you simply wish to "map" your wxindows calls to equivalent MFC calls with some kind of stu

Re: optparse: store callback return value

2005-04-24 Thread [EMAIL PROTECTED]
Callbacks are functions called when an optparse.OptionParser() object has a callback option defined (don't know how to say this less obvious sounding...) (they are documented in http://docs.python.org/lib/optparse-option-callbacks.html) Example (based on an example in the documentation): this scr

Re: Bounding box on clusters in a 2D list

2005-04-24 Thread [EMAIL PROTECTED]
Richter,yes what I am looking for is for cluster with rectangular bounding boxes as you explained in the first figure. -- http://mail.python.org/mailman/listinfo/python-list

[OT] Graphic editor within an MFC app. I have a wxPython prototype, that...

2005-04-24 Thread F. GEIGER
I have built a wxPython prototype of an app, that lets me place rectangles o a wxPanel, move them and change their size. How the rects are added and placed has to follow certain rules. The final goal is to merge this "graphical editor" into a MFC app. Converting a standalone wxPython app into a wx

Re: Question on metaclasses

2005-04-24 Thread Reinhold Birkenfeld
Diez B. Roggisch wrote: > Reinhold Birkenfeld wrote: > >> Diez B. Roggisch wrote: class Foo(type): def __new__(cls, name, bases, dict): for k,v in [(k, v) for k,v in dict.items() if callable(v)]: cls.wrap(k,v,cls.get_directives(v), dict)

Re: postgresql modules and performance

2005-04-24 Thread Mage
Reinhold Birkenfeld wrote: > >Have you tried psycopg? > > Thank you. It did the fetchall() in 11 secs and 13 secs with dictionary creating. It's the fastest so far. Mage -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode problems, yet again

2005-04-24 Thread "Martin v. Löwis"
Ivan Voras wrote: > Sorry, that was just steam venting from my ears - I often get bitten by > the "ordinal not in range(128)" error. :) I think I'm glad to hear that. Errors should never pass silently, unless explicitly silenced. When you get that error, it means there is a bug in your code (just

Re: thread lock object.

2005-04-24 Thread Peter Hansen
Irmen de Jong wrote: [EMAIL PROTECTED] wrote: How can we make only one thread at a time be able to access and increment i ? Use a synchronization primitive such as a lock (threading.Lock, threading.RLock) But for simply incrementing a number (i+=1) this is not needed because that operation cannot b

Re: Handling lists

2005-04-24 Thread [EMAIL PROTECTED]
That helps.Thanks much. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this a bug?

2005-04-24 Thread Fredrik Lundh
Robert Kern wrote: > It's consistent with using a.extend("world") which is what the += is > sugar for. > > In [1]:a = ['hello'] > > In [2]:a.extend("world") > > In [3]:a > Out[3]:['hello', 'w', 'o', 'r', 'l', 'd'] > > It's a *good* thing that .extend() takes any iterable without explicit > convers

Re: Is this a bug?

2005-04-24 Thread Fredrik Lundh
"[EMAIL PROTECTED]" wrote: > when you use a = a + 'world' python sees it as an error because of > different type. > > But when you use a += 'world' > python will change the right into list (because a is a list). "changing into a list" is a bit misleadning; to bit a bit more precise, you may want

Re: Is this a bug?

2005-04-24 Thread [EMAIL PROTECTED]
check this site: http://mail.python.org/pipermail/python-bugs-list/2003-November/021201.html pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: Variables

2005-04-24 Thread T Väntänen
Richard Blackwood wrote: To All: Folks, I need your help. I have a friend who claims that if I write: foo = 5 then foo is NOT a variable, necessarily. If you guys can define for me what a variable is and what qualifications you have to back you, I can pass this along to, hopefully, convince hi

Re: Is this a bug?

2005-04-24 Thread Grant Edwards
On 2005-04-24, Michael Sparks <[EMAIL PROTECTED]> wrote: a=["hello"] a = a + "world" > Traceback (most recent call last): > File "", line 1, in ? > TypeError: can only concatenate list (not "str") to list > However if we do this just slightly differently: > a = ["hello"] a +

Re: Is this a bug?

2005-04-24 Thread [EMAIL PROTECTED]
when you use a = a + 'world' python sees it as an error because of different type. But when you use a += 'world' python will change the right into list (because a is a list). So when you're code become: a += 'world' # a += list('world') It really helpfull if you stick to use append instead of +=

  1   2   >