Re: Doc suggestions (was: Why "class exceptions" are not deprecated?)

2006-03-31 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > > (and probably for no thanks), > > Do you think you know me well enough from a > handful of usenet postings to conclude that? yes. anyone who's been involved with open source project long enough has seen enough people like you to know you. you're not unique, in any w

Re: DO NOT USE JAVA BECAUSE IT IS NOT OPEN SOURCE

2006-03-31 Thread Furious George
Luc The Perverse wrote: > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Programing Languiges Are Ment to be free. That is why i am starting The > > Coo De Tar thats french for Blow of state it is a flash/java > > alternative and if you are going to use a server side languige us

Re: a question on re

2006-03-31 Thread Marco Wahl
Hi, > i tried to search 2 patterns > > pat1 = re.compile("blah") > pat2 = re.compile("blah2") > > > if i do > if re.findall(pat1,something) and re.findall(pat2,something): >do something > > if does not work > > but when i do a nest if, > > if re.findall(pat1,something) : >

Python 2.5 licensing: stop this change

2006-03-31 Thread Steve Holden
As the only director of the Python Software Foundation to vote against a recent Board motion to implement the change in licensing terms described in http://pyfound.blogspot.com/2006/04/python-25-licensing-change.html I would like to place on record my protest against this change. I think it

Python, VB math simple problem

2006-03-31 Thread Mr X
Hi looking for help with what should be a fairly simple Python problem, relating to VB inter-operability. Got a great response from a fellow named Matt at [EMAIL PROTECTED], pointed me in some good directions - some areas, concerns still foggy on, the below thread is included any feedbac

Python, VB math simple problem

2006-03-31 Thread Mr X
Hi looking for help with what should be a fairly simple Python problem, relating to VB inter-operability. Got a great response from a fellow named Matt at [EMAIL PROTECTED], pointed me in some good directions - some areas, concerns still foggy on, the below thread is included any feedbac

Re: Pickle or Mysql

2006-03-31 Thread Rene Pijlman
[EMAIL PROTECTED]: >Can I use Pickle to store about 500,000 key value pairs.. Performance would be horrible. Use a BTree in ZODB instead: http://www.zope.org/Wikis/ZODB/guide/node6.html#SECTION00063 >or should I use mySql. You should use a relational database, such as PostgreSQL

a question on re

2006-03-31 Thread eight02645999
hi i tried to search 2 patterns pat1 = re.compile("blah") pat2 = re.compile("blah2") if i do if re.findall(pat1,something) and re.findall(pat2,something): do something if does not work but when i do a nest if, if re.findall(pat1,something) : if re.findall(pat2,s

Should any() and all() take a key= argument?

2006-03-31 Thread Steve R. Hastings
The list.sort() method accepts a "key=" parameter to let you specify a function that will change the way it sorts. In Python 2.5, min() and max() now accept a "key=" parameter that changes how the functions decide min or max. Should any() and all() take a key= argument? Example: >>> lst = [2, 4

Re: any() and all() on empty list?

2006-03-31 Thread Steve R. Hastings
On Fri, 31 Mar 2006 16:29:00 -0800, Paul Rubin wrote: > I think "S and all(S)" is the right way to express that, if that's > what's intended. I still would like a standard function, because "S and all(S)" does not work with iterators. I proposed one possible function, truecount(S), that returns a

Re: Exception handling....dumb question?

2006-03-31 Thread Ben Finney
"kbperry" <[EMAIL PROTECTED]> writes: > In Python, > When using the default except (like following) > > try: > some code that might blow up > > except: > print "some error message" This will catch *every* exception, and throw it away before it gets to your "print" statement. This is almo

Re: running IDLE from another program?

2006-03-31 Thread John Salerno
Kent Johnson wrote: > John Salerno wrote: >> Kent Johnson wrote: >>> You probably don't need to do that. Just run the file in python >>> directly. I don't know UE, but when you configure an external tool, tell >>> it to run python.exe and pass the current file as a command line parameter. >>> >>

Re: recursion and linked lists

2006-03-31 Thread John Salerno
I V wrote: > Note that print gets called after _each_ time that printBackward > returns. So, as the different calls to printBackward return, they print > whatever 'head' was set to in that invocation. Now, logically enough, > the last call to printBackward is the first to return, so the last > va

Re: How to search HUGE XML with DOM?

2006-03-31 Thread Sullivan WxPyQtKinter
Perhaps what you have said is correct. But XML is more direct for programmers and readers in my view point. bayerj 写道: > Mind, that XML documents are not more flexible than RDBMS. > > You can represent any XML document in a RDBMS. You cannot represent any > RDBMS in an XML document. RDBMS are (st

Re: DO NOT USE JAVA BECAUSE IT IS NOT OPEN SOURCE

2006-03-31 Thread Roedy Green
On 31 Mar 2006 20:59:16 -0800, [EMAIL PROTECTED] wrote, quoted or indirectly quoted someone who said : >Programing Languiges Are Ment to be free. That is why i am starting The >Coo De Tar thats french for Blow of state it is a flash/java >alternative and if you are going to use a server side langu

Re: running IDLE from another program?

2006-03-31 Thread Kent Johnson
John Salerno wrote: > Kent Johnson wrote: >>You probably don't need to do that. Just run the file in python >>directly. I don't know UE, but when you configure an external tool, tell >>it to run python.exe and pass the current file as a command line parameter. >> > I've tried a lot of combinatio

Re: Exception handling....dumb question?

2006-03-31 Thread kbperry
Thanks guys! I appreciate the help. I have a Python book, but it didn't mention this at all. I also tried looking through the online docs to no avail. -- http://mail.python.org/mailman/listinfo/python-list

Re: logging producing redundant entries

2006-03-31 Thread Kent Johnson
Jed Parsons wrote: > > Thanks, Kent and Peter, > > Definitely making progress here. I've got propagate = 0, and am testing > for handlers before doing any addHandler business. (The handlers test > seems to make the most difference.) > > I'm down to two entries per time now! And prodding Zop

Re: running IDLE from another program?

2006-03-31 Thread BartlebyScrivener
John, If your file has the .py or .pyc extension on it, it should just run at the command line from its own directory, assuming your environment and path variables are set correctly. I use NoteTab which has a different way of doing it, but basically you should be able to run: c:\mydir>script.py

Re: DO NOT USE JAVA BECAUSE IT IS NOT OPEN SOURCE

2006-03-31 Thread Luc The Perverse
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Programing Languiges Are Ment to be free. That is why i am starting The > Coo De Tar thats french for Blow of state it is a flash/java > alternative and if you are going to use a server side languige use > Perl,Python or better yet Ruby

Re: DO NOT USE JAVA BECAUSE IT IS NOT OPEN SOURCE

2006-03-31 Thread atbusbook
A Propriatary Languige Is An Oxymorron A propriatary OS is An Oxymoron Take Pro-DOS for example A Knock-off of MS-DOG, the worst operating system it did not use ONE IOTA OF MS CODE BUT IT was a sucsefull knockoff. same thing will happen to JAVA

DO NOT USE JAVA BECAUSE IT IS NOT OPEN SOURCE

2006-03-31 Thread atbusbook
Programing Languiges Are Ment to be free. That is why i am starting The Coo De Tar thats french for Blow of state it is a flash/java alternative and if you are going to use a server side languige use Perl,Python or better yet Ruby. What is the point of a languige without a standerd and without a op

Re: Looking for a language/framework

2006-03-31 Thread Gregor Horvath
> > But what you overlook is SQL's strength: > > SQL can be translated into _very_ efficient query plans w/o changing > the SQL. SQL's query optimizers (more properly, de-pessimizers) give Premature optimization is the root of all evil. On the top level of an appliciation the goal is to o

Re: Pickle or Mysql

2006-03-31 Thread Paul Rubin
[EMAIL PROTECTED] writes: > So, Is Shelve a perfect solution (besides Mysql), to store large > key/value pairs, and which are updated frequently by multiple clients. No, shelve is for use within a single process. With multiple clients and frequent updates, you need a real database and some knowle

Re: best way to index numerical data ?

2006-03-31 Thread Liu Jin
> "Jack" == Jack <[EMAIL PROTECTED]> writes: > Hi I have a lot of data that is in a TEXT file which are numbers > does anyone have a good suggestion for indexing TEXT numbers > (zip codes, other codes, dollar amounts, quantities, etc). since > Lucene and other indexers are real

Re: Pickle or Mysql

2006-03-31 Thread amaltasb
So, Is Shelve a perfect solution (besides Mysql), to store large key/value pairs, and which are updated frequently by multiple clients. Thanks Paul Rubin wrote: > [EMAIL PROTECTED] writes: > > Can I use Pickle to store about 500,000 key value pairs.. or should I > > use mySql. Which one is best f

Re: recursion and linked lists

2006-03-31 Thread I V
John Salerno wrote: > The printable value of node1 is 1, node2 is 2 and node 3 is 3. > > node1.next is node2, node2.next is node3 and node3.next is None. > > This might be painfully obvious, but I don't understand when the print > statement is getting called. If you call printBackward with node1, t

Re: Pickle or Mysql

2006-03-31 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Can I use Pickle to store about 500,000 key value pairs.. or should I > use mySql. Which one is best for performance, as the key value pair > increases. That's an awfully large pickle. Maybe you want shelve. If there are frequent updates, multiple clients, etc., then

recursion and linked lists

2006-03-31 Thread John Salerno
Can someone explain to me how this works: def printBackward(list): if list == None: return head = list tail = list.next printBackward(tail) print head, >>> printBackward(node1) 3 2 1 The printable value of node1 is 1, node2 is 2 and node 3 is 3. node1.next is node2, node2.next

Pickle or Mysql

2006-03-31 Thread amaltasb
Can I use Pickle to store about 500,000 key value pairs.. or should I use mySql. Which one is best for performance, as the key value pair increases. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for a language/framework

2006-03-31 Thread Ravi Teja
Agreed. Mine was hardly a complete list. Another bit I lost is keeping data operations close to the database. I am more likely to use multiple languages/frameworks over the same database than change databases for the same application. I actually prefer functions and procedures within the DB (even

Logging and threading

2006-03-31 Thread usenet
I'm having some problems getting the logging module to work with the threading module. I've narrowed the problem down to the following code: import logging, threading update_log = logging.getLogger('update_log') update_log.addHandler(logging.FileHandler("/tmp/update_log")) class dlThread(thread

Re: a simple regex question

2006-03-31 Thread John Salerno
Justin Azoff wrote: > John Salerno wrote: >> Ok, I'm stuck on another Python challenge question. Apparently what you >> have to do is search through a huge group of characters and find a >> single lowercase character that has exactly three uppercase characters >> on either side of it. Here's what I

Re: smtplib "authentication required" error

2006-03-31 Thread Timothy Grant
On 31 Mar 2006 18:20:27 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > In using a simple smtp routine: > > # begin example > >>> import smtplib > >>> server = smtplib.SMTP('outgoing.verizon.net') > >>> server.sendmail('[EMAIL PROTECTED]', '[EMAIL PROTECTED]', > """To: [EMAIL PROTECTED] > Fro

why doesn't is work?a script to backup a directory

2006-03-31 Thread obeeker
"""there is threee directories,one of these is used for the base directory,decided by the user, default is d0""" import shutil #the three directories d0='D:/Program Files/eb/mb/S' d1='O:/eb/mb/S' d2='P:/S/eb/mb/S' #to backup def update(base): l=[d0,d1,d2] l.remove(base)

Re: a simple regex question

2006-03-31 Thread Justin Azoff
John Salerno wrote: > Ok, I'm stuck on another Python challenge question. Apparently what you > have to do is search through a huge group of characters and find a > single lowercase character that has exactly three uppercase characters > on either side of it. Here's what I have so far: > > pattern

smtplib "authentication required" error

2006-03-31 Thread [EMAIL PROTECTED]
In using a simple smtp routine: # begin example >>> import smtplib >>> server = smtplib.SMTP('outgoing.verizon.net') >>> server.sendmail('[EMAIL PROTECTED]', '[EMAIL PROTECTED]', """To: [EMAIL PROTECTED] From: [EMAIL PROTECTED] Subject: Shakespeare Quote Tis like the breath of an unfeed lawyer...

Re: Can I control Video Card by using Python under linux?

2006-03-31 Thread Ravi Teja
Here's a wrapper for V4L. http://antonym.org/libfg -- http://mail.python.org/mailman/listinfo/python-list

Re: Exception handling....dumb question?

2006-03-31 Thread Trent Mick
[kbperry wrote] > In Python, > When using the default except (like following) > > try: > some code that might blow up > > except: > print "some error message" >>> try: ... 1/0 ... except: ... import traceback ... traceback.print_exc() ... Tracebac

Re: Find similar images using python

2006-03-31 Thread Ravi Teja
Finding similar images is not at all a trivial task. Entire PhD dissertations have been committed to it. The solutions are still very unreliable as of yet. If you want to find more, you can read the research out of the ongoing Image CLEF track. I worked with them briefly a couple of years ago in co

Re: any() and all() on empty list?

2006-03-31 Thread Paul Rubin
Ron Adam <[EMAIL PROTECTED]> writes: > The 'not not S' is just a conversion to bool. Is the following less > contorted to you? > > >>> bool([]) > False Oh ok. Yes, bool(S) is much less contorted than "not not S". > 'Is all True' isn't the same as 'Has all True'. As I said, I'm not > questioni

Re: Doc suggestions (was: Why "class exceptions" are not deprecated?)

2006-03-31 Thread Paul Boddie
[EMAIL PROTECTED] wrote: > Ed Singleton wrote: > > > > Ideas can come from anyone and they do come from anyone all the time, > > and as such they are fairly worthless unless acted upon. > > That is pretty obvious. The question is about who does > the acting. Your position seems to be that > only

Re: Exception handling....dumb question?

2006-03-31 Thread Rune Strand
kbperry wrote: > In Python, > When using the default except (like following) > > try: > some code that might blow up > > except: > print "some error message" > > > Is there a way to show what error it is throwing? > > Like in Java, you can do > catch (Exception e){ > System.out.println

Re: Exception handling....dumb question?

2006-03-31 Thread Felipe Almeida Lessa
Em Sex, 2006-03-31 às 15:51 -0800, kbperry escreveu: > Is there a way to show what error it is throwing? > > Like in Java, you can do > catch (Exception e){ > System.out.println(e); > } > > Is there an equivalent way to do this in Python? >>> try: ... print 1/0 ... except Exception, e: .

Exception handling....dumb question?

2006-03-31 Thread kbperry
In Python, When using the default except (like following) try: some code that might blow up except: print "some error message" Is there a way to show what error it is throwing? Like in Java, you can do catch (Exception e){ System.out.println(e); } Or something like that. Is there

Re: a simple regex question

2006-03-31 Thread John Salerno
John Salerno wrote: > Ok, I'm stuck on another Python challenge question. Apparently what you > have to do is search through a huge group of characters and find a > single lowercase character that has exactly three uppercase characters > on either side of it. Here's what I have so far: > > patt

a simple regex question

2006-03-31 Thread John Salerno
Ok, I'm stuck on another Python challenge question. Apparently what you have to do is search through a huge group of characters and find a single lowercase character that has exactly three uppercase characters on either side of it. Here's what I have so far: pattern = '([a-z][A-Z]{3}[a-z][A-Z]{

Re: running IDLE from another program?

2006-03-31 Thread John Salerno
Kent Johnson wrote: > John Salerno wrote: >> If I want to write my code in a separate text editor (I like UltraEdit) >> but then press a single button to have that code run in the IDLE >> environment, is that possible? I know that you can configure UE to run >> external tools, but I can't figure

Re: logging producing redundant entries

2006-03-31 Thread Jed Parsons
Thanks, Kent and Peter, Definitely making progress here. I've got propagate = 0, and am testing for handlers before doing any addHandler business. (The handlers test seems to make the most difference.) I'm down to two entries per time now! And prodding Zope to reload the module doesn't ca

Re: Find similar images using python

2006-03-31 Thread Scott David Daniels
Christos Georgiou wrote: > I did make a module based on imgseek, and together with PIL, > I manage my archive of email attachments (it's incredible how many > different versions of the same picture people send you: gif, jpg > in different sizes etc) and it works fairly well. > > E-mail me if

Re: Newbie: splitting dictionary definition across two .py files

2006-03-31 Thread Ben Finney
"Karthik Gurusamy" <[EMAIL PROTECTED]> writes: > Ben Finney wrote: >> That sounds like a very confusing architecture, and smells very >> much like some kind of premature optimisation. What leads you to >> that design? It's very likely a better design can be suggested to >> meet your actual require

Re: Looking for a language/framework

2006-03-31 Thread Scott David Daniels
Ravi Teja wrote: >> ... I've never seen an "object-relational mapping" (technical term for >> cruft that tries to avoid people having to learn and use SQL) which >> doesn't drive me into a murderous, foam-at-mouth rage in a very >> short time -- I *WANT* my SQL, I *LOVE* SQL, it's *WAY* more powerf

Re: running IDLE from another program?

2006-03-31 Thread [EMAIL PROTECTED]
what i do is open idle, import the codefile i've begun to write, and then write a function: def r(): reload(codefile) then when I want to run it after changes, I just call the function manually in idle. -- http://mail.python.org/mailman/listinfo/python-list

Re: QOTW... (was: Doc suggestions (was: Why "class exceptions" are not deprecated?))

2006-03-31 Thread rurpy
[EMAIL PROTECTED] wrote: > > "Ed" == Ed Singleton <[EMAIL PROTECTED]> writes: > > Ed> Go to the wiki, make the changes you want, and feel good about > Ed> yourself for once. > > +1 QOTW. I suggest leaving off the "for once". Otherwise, it is just another gratuitous insult, of the kin

Re: Doc suggestions (was: Why "class exceptions" are not deprecated?)

2006-03-31 Thread rurpy
Ed Singleton wrote: > On 30 Mar 2006 16:30:24 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > What are you saying? Ideas must come only from those > > with the time and skill to implement them? No one else > > need apply? > > Ideas can come from anyone and they do come from anyone all

Re: best way to index numerical data ?

2006-03-31 Thread benwbrewster
here is a sample of a .txt file : I want to search for the whole number. If possible, fuzzy search would be nice too, but not mandatory.. 1975|Y|35136|72|1927|||3|005503|003|19870301|19950301|14416887|151|2301|100039292|N|84|F|50||10|A|100|Y|037|Y|89005|3042|M|S|P| Thanks! Jack -- http://mai

Re: best way to index numerical data ?

2006-03-31 Thread benwbrewster
here is a sample of a .txt file : I want to search for the whole number. If possible, fuzzy search would be nice too, but not mandatory.. 1975|Y|35136|72|1927|||3|005503|003|19870301|19950301|14416887|151|2301|100039292|N|84|F|50||10|A|100|Y|037|Y|89005|3042|M|S|P| Thanks! Jack -- http://mai

Re: Newbie: splitting dictionary definition across two .py files

2006-03-31 Thread Karthik Gurusamy
Ben Finney wrote: > [EMAIL PROTECTED] writes: > > > I'm fairly new to python. I like to define a big dictionary in two > > files and use it my main file, build.py > > > > I want the definition to go into build_cfg.py and build_cfg_static.py. > > That sounds like a very confusing architecture, and s

Re: Newbie: splitting dictionary definition across two .py files

2006-03-31 Thread Karthik Gurusamy
Ben Cartwright wrote: > [EMAIL PROTECTED] wrote: > > I like to define a big dictionary in two > > files and use it my main file, build.py > > > > I want the definition to go into build_cfg.py and build_cfg_static.py. > > > > build_cfg_static.py: > > target_db = {} > > target_db['foo'] = 'bar' > > >

Re: Looking for a language/framework

2006-03-31 Thread Ravi Teja
> For example, I've never seen an "object-relational mapping" (technical > term for cruft that tries to avoid people having to learn and use SQL) > which doesn't drive me into a murderous, foam-at-mouth rage in a very > short time -- I *WANT* my SQL, I *LOVE* SQL, it's *WAY* more powerful > and sui

Re: Credit card API Sol with python interface

2006-03-31 Thread [EMAIL PROTECTED]
I used a python api for the linkpoint.com processor a few years ago I think they still have the python api -- http://mail.python.org/mailman/listinfo/python-list

Re: how to comment lot of lines in python

2006-03-31 Thread gene tani
[EMAIL PROTECTED] wrote: > Like in C we comment like > /* > Bunch of lines of code > */ > scite has a feature where you modify your delimiter in block comments, i.e. what comes after "#" http://scintilla.sourceforge.net/SciTEDoc.html -- http://mail.python.org/mailman/listinfo/python-list

String Matching

2006-03-31 Thread david brochu jr
Hello,   I am trying to write a script that takes strings from a text file and searches to see if they are present in another text file...here is the code:   import osimport re search = open("c:\python24\scripts\pii\expected_rules_results.txt") def find(x): file = open("c:\python24\scripts\pii\dav

Re: Looking for a language/framework

2006-03-31 Thread walterbyrd
I am presently looking at a commercial product called dbqwiksite. I generates php code. I know that sounds lame, but the demos were impressive. If I could get the product to work like they show in the demos it would be great. It uses ODBC to connect to a mysql database; but I can't get it to wor

Re: Looking for a language/framework

2006-03-31 Thread walterbyrd
I am presently looking at a commercial product called dbqwiksite. I generates php code. I know that sounds lame, but the demos were impressive. If I could get the product to work like they show in the demos it would be great. It uses ODBC to connect to a mysql database; but I can't get it to wor

Re: Working with files in a SimpleXMLRPCServer

2006-03-31 Thread Jose Carlos Balderas Alberico
Oops, I'm afraid I replied to Brian only instead of to the whole distribution list. I copy the message I sent to him so that everyone can read it:I'm afraid I cannot use the zlib library provided by Python, since the ZIP files I'm supposed to send must be password-protected, and I haven't been able

Re: proposed proposal: set.values()

2006-03-31 Thread Ron Adam
Paul Rubin wrote: > "Terry Reedy" <[EMAIL PROTECTED]> writes: >> 1. It is pure duplication that *adds* keystrokes. >> > Nobody says you shouldn't use list(s) if you know you're dealing with > a set. The idea of s.values() is so you can duck-type between dicts > and sets. You could just do the fol

Re: running IDLE from another program?

2006-03-31 Thread Kent Johnson
John Salerno wrote: > If I want to write my code in a separate text editor (I like UltraEdit) > but then press a single button to have that code run in the IDLE > environment, is that possible? I know that you can configure UE to run > external tools, but I can't figure out how to run IDLE this

Re: best way to index numerical data ?

2006-03-31 Thread Paddy
What do you want to search for in the file? how big is the file? What format is the data in the file? - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: any() and all() on empty list?

2006-03-31 Thread Ant
lol! -- http://mail.python.org/mailman/listinfo/python-list

Re: any() and all() on empty list?

2006-03-31 Thread Ron Adam
Carl Banks wrote: > Ron Adam wrote: >> Carl Banks wrote: >> >>> In Python, yes and no are the only possible answers. Probably the only >>> analogous thing you could do in Python would be for all() to raise >>> ValueError when passed an empty sequence. >> There is also 'None' which serves a similar

Re: logging producing redundant entries

2006-03-31 Thread Kent Johnson
Jed Parsons wrote: > Thanks, Peter and alex23, > > The metalog test shows that the code is only being executed once at a time. > > And if I take those lines and put them in a shell script (fixing the > FileHandler - sorry about the bad copy there), they work as expected, > producing a single lo

exception handling in Tkinter

2006-03-31 Thread msoulier
In wxPython I install a top-level exception handler to intercept exceptions and display them in the GUI. With Tkinter, I'm trying to do the same. in __init__ sys.excepthook = self.ExceptionHandler def ExceptionHandler(self, type, value, tb): tblist = traceback.format_tb(tb)

Re: urllib2 through basic auth'ed proxy

2006-03-31 Thread John J. Lee
Alejandro Dubrovsky <[EMAIL PROTECTED]> writes: > John J. Lee wrote: > > > FWIW, at a glance, Python 2.3.4 has neither of the bugs I mentioned, > > but the code I posted seems to work with 2.3.4. I'm not particularly > > interested in what's wrong with 2.3.4's version or your usage of it > > (pr

Re: logging producing redundant entries

2006-03-31 Thread Peter Otten
Jed Parsons wrote: > Am I somehow accumulating a growing list of loggers by having this code > at the top of a zope Extension? I'd rather look after the number of handlers which is probably growing and causing your problem. Normally it shouldn't matter how often you repeat the logging.getLogger(n

Re: Find similar images using python

2006-03-31 Thread Christos Georgiou
On 29 Mar 2006 05:06:10 -0800, rumours say that "Thomas W" <[EMAIL PROTECTED]> might have written: >How can I use python to find images that looks quite similar? Thought >I'd scale the images down to 32x32 and convert it to use a standard >palette of 256 colors then compare the result pixel for pi

running IDLE from another program?

2006-03-31 Thread John Salerno
If I want to write my code in a separate text editor (I like UltraEdit) but then press a single button to have that code run in the IDLE environment, is that possible? I know that you can configure UE to run external tools, but I can't figure out how to run IDLE this way, because when I check o

Re: how to comment lot of lines in python

2006-03-31 Thread Dave Mandelin
I often use if 0: bunch of lines of code That way, it's very easy to reenable the code, or to add an else, etc. I can even put things like 'if 0 and USE_FOO_FEATURE' to document what is being commented out. It's much more flexible than commenting out. -- Want to play tabletop RPGs over the i

Re: re.sub problem

2006-03-31 Thread RunLevelZero
Glad I could help. -- http://mail.python.org/mailman/listinfo/python-list

Re: any() and all() on empty list?

2006-03-31 Thread Carl Banks
Ron Adam wrote: > Carl Banks wrote: > > > In Python, yes and no are the only possible answers. Probably the only > > analogous thing you could do in Python would be for all() to raise > > ValueError when passed an empty sequence. > > There is also 'None' which serves a similar purpose of indicati

Re: logging producing redundant entries

2006-03-31 Thread Jed Parsons
Thanks, Peter and alex23, The metalog test shows that the code is only being executed once at a time. And if I take those lines and put them in a shell script (fixing the FileHandler - sorry about the bad copy there), they work as expected, producing a single log entry. So I'm left with: - l

Re: member variables in python

2006-03-31 Thread Kent Johnson
PyPK wrote: > ok I reason I was going with globals is that i use this variable in > another class something like this along with above > > testflag = 0 > > class AA: >def __init__(...): > > def methos(self,...): >global testflag >testflag = xx > > class BB: > def __ini

Re: re.sub problem

2006-03-31 Thread veracon
Thanks a lot! Compiling with re.DOTALL did fix my problem for the most part; there still are a few problems with my code, but I think I can fix those myself. Again, thanks! > Okay I just woke up and haven't had enough coffee so if I'm off here > please forgive me. Are you saying that if there is

Re: How to search HUGE XML with DOM?

2006-03-31 Thread Ivan Vinogradov
On 31-Mar-06, at 11:17 AM, bayerj wrote: > Mind, that XML documents are not more flexible than RDBMS. > > You can represent any XML document in a RDBMS. You cannot represent > any > RDBMS in an XML document. RDBMS are (strictly spoken) relations and > XML > documents are trees. Relations are

Re: how to comment lot of lines in python

2006-03-31 Thread Michael Hobbs
Eric Deveaud wrote: > [EMAIL PROTECTED] wrote: > >> Eric Deveaud wrote: >> >>> [EMAIL PROTECTED] wrote: >>> Like in C we comment like /* Bunch of lines of code */ Should we use docstring """ """ >>> I would say NO. docstring are disp

base64 memory question

2006-03-31 Thread Michele Petrazzo
Hi ng, I see that after en encoding with base64, the memory used for the variable that I use for store the encoded data, after deleted, python keep a part of that memory: #ls -lh on /tmp/test_zero #-rw-r--r-- 1 michele michele 9,8M 2006-03-31 18:32 /tmp/test_zero michele:~$ python2.4 Python 2.4

Re: Spawn/Kill Process

2006-03-31 Thread Daniel Nogradi
> I need to write a script that starts an exe and then continues through > the script. I am able to start the exe file but my script doesn't > continue because the process I start runs in the background of Windows > (as it is supposed to). I have tried using both os.system and os.popen > to get aro

Re: member variables in python

2006-03-31 Thread bruno at modulix
PyPK wrote: > ok I reason I was going with globals is that i use this variable in > another class something like this along with above > > testflag = 0 > > class AA: >def __init__(...): > > def methos(self,...): >global testflag >testflag = xx > > class BB: > def __ini

best way to index numerical data ?

2006-03-31 Thread Jack
Hi I have a lot of data that is in a TEXT file which are numbers does anyone have a good suggestion for indexing TEXT numbers (zip codes, other codes, dollar amounts, quantities, etc). since Lucene and other indexers are really optimized for Alpha character indexing. What approaches are typically t

Re: member variables in python

2006-03-31 Thread PyPK
I see that.But here in my case the testflags is computed inside the member function something like class AA: def __init__(self): self.test_flag = 0 # initialize def methods(self, value): save_value = _munge(value) self.test_flag = save_value N

Re: re.sub problem

2006-03-31 Thread RunLevelZero
Okay I just woke up and haven't had enough coffee so if I'm off here please forgive me. Are you saying that if there is an emptly line then it borks? If so just use re.S ( re.DOTALL ) and that should take care of it. It will treat the ( . ) special. Otherwise it ignores new lines. -- http://m

Re: wx.checklistbox

2006-03-31 Thread luca72
sorry appenditems -- http://mail.python.org/mailman/listinfo/python-list

Re: Best IDE for Python?

2006-03-31 Thread Fabio Zadrozny
On 3/31/06, Keith B. Perry <[EMAIL PROTECTED]> wrote: You are probably right, and I will definitely take a look at the starter manual.  Hopefully it also works well on classes that I create?  You got some nice docs there. Surely does ;-) Cheers, Fabio Thanks for the tip!  On 3/31/06, Fabio Zad

Re: Find similar images using python

2006-03-31 Thread Terry Hancock
Thomas W wrote: >How can I use python to find images that looks quite similar? Thought >I'd scale the images down to 32x32 and convert it to use a standard >palette of 256 colors then compare the result pixel for pixel etc, but >it seems as if this would take a very long time to do when processing

Re: member variables in python

2006-03-31 Thread Fredrik Lundh
"PyPK" wrote: > hi how do I write this better with member variables rather than global > as you see below. > > eg: > > test-flag = 0 > > class AA: >def __init__(...): > > def methos(self,...): >global test-flag >test-flag = xx > > instead of something like above ..how do i pu

Re: How to search HUGE XML with DOM?

2006-03-31 Thread bayerj
Mind, that XML documents are not more flexible than RDBMS. You can represent any XML document in a RDBMS. You cannot represent any RDBMS in an XML document. RDBMS are (strictly spoken) relations and XML documents are trees. Relations are superior to trees, at least mathematically speaking. Once y

Re: member variables in python

2006-03-31 Thread Grant Edwards
On 2006-03-31, PyPK <[EMAIL PROTECTED]> wrote: > hi how do I write this better with member variables Sorry, I don't know what "member variables" are. > rather than global as you see below. What you did below isn't global. It's scope is limited to the module containing the class. If you got so

Re: cd burning

2006-03-31 Thread RunLevelZero
I am hopeing something has developed myself. I have been waiting awhile. I simply don't want to use cdrecord or cdrdao. If I had the know how I would be working on it but I believe this is a massive undertaking and rather hard to accomplish. I do hope this happens very soon though. Libburn mig

Re: How to debug python code?

2006-03-31 Thread pruebauno
[EMAIL PROTECTED] wrote: > hi, >I am new to Python programming.I am not getting exactly pdb.Can > anyone tell me effective way to debug python code? >Please give me any example. >Looking for responce. >Thank You. > Sushant If you are having issues you also might wa

Re: How to debug python code?

2006-03-31 Thread R. Bernstein
Dennis Lee Bieber <[EMAIL PROTECTED]> writes: > On 30 Mar 2006 21:18:50 -0800, [EMAIL PROTECTED] declaimed the > following in comp.lang.python: > > > hi, > >I am new to Python programming.I am not getting exactly pdb.Can > > anyone tell me effective way to debug python code? > > I

  1   2   >