Re: Making a small change to a large XML document

2007-09-25 Thread Paddy
On Sep 24, 11:38 pm, Dan Stromberg <[EMAIL PROTECTED]> wrote: > Say I want to take an existing XML document, and change the value="9997" > and value="9998" to two different numbers, without changing any of the > rest of the document - not even changing comments or indentation, if > avoidable. > > W

Re: Google and Python

2007-09-25 Thread Hendrik van Rooyen
"Nick Craig-Wood" wrote: > Passing file descriptors between processes is one of those things I've > always meant to have a go with, but the amount of code (in Advanced > Programming in the Unix Environment) needed to implement it is rather > disconcerting! A python module to do it would be great

Re: An Editor that Skips to the End of a Def

2007-09-25 Thread A.T.Hofkamp
On 2007-09-25, Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > In message <[EMAIL PROTECTED]>, Neil Cerutti wrote: > That's like saying, about a program that, when given "2 + 2", outputs "5", > that _of course_ it knows the correct answer is "4", it just chooses > to "modify" the answer before ou

Re: Python script to optimize XML text

2007-09-25 Thread Stefan Behnel
Gabriel Genellina wrote: > En Mon, 24 Sep 2007 17:36:05 -0300, Robert Dailey <[EMAIL PROTECTED]> > escribi�: > >> I'm currently seeking a python script that provides a way of >> optimizing out >> useless characters in an XML document to provide the optimal size for the >> file. For example, assume

Re: Google and Python

2007-09-25 Thread Paul Rubin
"Hendrik van Rooyen" <[EMAIL PROTECTED]> writes: > What is the advantage of passing the open file rather than just the > fully qualified file name and having the other process open the > file itself? The idea is that the application is a web server. The socket listener accepts connections and han

Re: strange behavious of the logging module?

2007-09-25 Thread Peter Otten
Vinay Sajip wrote: > This is a known bug, and not specifically related to logging, though > it sometimes manifests itself via logging: > > http://bugs.python.org/issue1180193 Yup, thanks for looking into it. Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Google and Python

2007-09-25 Thread Stefan Behnel
Hendrik van Rooyen wrote: > "Nick Craig-Wood" wrote: > >> Passing file descriptors between processes is one of those things I've >> always meant to have a go with, but the amount of code (in Advanced >> Programming in the Unix Environment) needed to implement it is rather >> disconcerting! A pyt

obtaining multiple values from a function.

2007-09-25 Thread Shriphani
hello all, If I have a function that loops over a few elements and is expected to throw out a few tuples as the output, then what should I be using in place of return ? Shriphani Palakodety. -- http://mail.python.org/mailman/listinfo/python-list

Re: strange behavious of the logging module?

2007-09-25 Thread Christian Meesters
Peter Otten wrote: > Vinay Sajip wrote: > >> This is a known bug, and not specifically related to logging, though >> it sometimes manifests itself via logging: >> >> http://bugs.python.org/issue1180193 > > Yup, thanks for looking into it. > > Peter Thanks Vinay, but I am curious how issue 1180

Re: obtaining multiple values from a function.

2007-09-25 Thread Peter Otten
Shriphani wrote: > If I have a function that loops over a few elements and is expected to > throw out a few tuples as the output, then what should I be using in > place of return ? Use a generator and have it /yield/ rather than /return/ results: >>> def f(items): ... for item in items: ...

Re: obtaining multiple values from a function.

2007-09-25 Thread Ben Finney
Shriphani <[EMAIL PROTECTED]> writes: > If I have a function that loops over a few elements and is expected to > throw out a few tuples as the output, then what should I be using in > place of return ? If it makes sense for the set of results to be returned all at once, then return the object tha

Re: strange behavious of the logging module?

2007-09-25 Thread Peter Otten
Christian Meesters wrote: > Peter Otten wrote: > >> Vinay Sajip wrote: >> >>> This is a known bug, and not specifically related to logging, though >>> it sometimes manifests itself via logging: >>> >>> http://bugs.python.org/issue1180193 >> >> Yup, thanks for looking into it. >> >> Peter > Th

sorteddict PEP proposal [started off as orderedict]

2007-09-25 Thread Mark Summerfield
Hi, Below is a PEP proposal for a sorteddict. It arises out of a discussion on this list that began a few weeks ago with the subject of "An ordered dictionary for the Python library?", and a similar one on the P3K mailing list with the subject "ordered dict for p3k collections?". If there is posi

Re: Google and Python

2007-09-25 Thread Bryan Olson
Alex Martelli wrote: > Bryan Olson <[EMAIL PROTECTED]> wrote: >... >>> YouTube (one of Google's most valuable properties) is essentially >>> all-Python (except for open-source infrastructure components such as >>> lighttpd). Also, at Google I'm specifically "Uber Tech Lead, Production >>> Syst

Re: Google and Python

2007-09-25 Thread Bryan Olson
Paul Rubin wrote: > You can also pass the open sockets around between processes instead of > reverse proxying, using the SCM_RIGHTS message on Unix domain sockets > under Linux, or some similar mechanism under other Unixes (no idea > about Windows). Python does not currently support this but one o

hacking,anti-hacking,registry tweaks,compter tricks

2007-09-25 Thread e.expelliarmus
check this out buddies. kool website for: * hacking and anti hacking tricks * anti hackng tricks. * registry tweaks * orkut tricks * small virus * computer tricks and loads of different tricks... www.realm-of-tricks.blogspot.com www.registrydecoded.blogspot.com -- http://mail.python.org/mailman/

Inserting an element into existing xml file

2007-09-25 Thread Anand
Hi, I'm new to Python. we are using python2.4. I wanted to insert an element into an existing xml file. Can anyone help me with this? I've seen lxml and elementTree in python2.5 has some API's to insert into existing xml file. We cant use python 2.5 due to some limitations. So how can we do it in

Re: An Editor that Skips to the End of a Def

2007-09-25 Thread Bjoern Schliessmann
Lawrence D'Oliveiro wrote: > That's like saying, about a program that, when given "2 + 2", > outputs "5", that _of course_ it knows the correct answer is "4", > it just chooses to "modify" the answer before outputting it. No. Which laws say how transitions between modes have to be? Thus, I know la

Re: obtaining multiple values from a function.

2007-09-25 Thread Paul Rudin
Ben Finney <[EMAIL PROTECTED]> writes: > > If, instead, it makes sense for the results to be iterated over, you > can write a function that yields results one at a time, without > necessarily knowing in advance what the entire set will be:: > > >>> def fib(max_result): Going off on a tangent

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-25 Thread A.T.Hofkamp
On 2007-09-25, Mark Summerfield <[EMAIL PROTECTED]> wrote: > If there is positive feedback I will submit the PEP to the reviewers, > so if you think it is a good idea please say so. (I'm sure that if you > _don't_ like it you'll tell me anyway:-) I like the idea, ie +1. > This PEP proposes th

Re: obtaining multiple values from a function.

2007-09-25 Thread Carsten Haese
On Tue, 2007-09-25 at 10:41 +0100, Paul Rudin wrote: > Going off on a tangent a bit, but I was idly considering the absence > of itertools.ireduce the other day. A problem is that reduce gives a > single result, so it's not clear what ireduce would do (perhaps why > it's not there). One obvious can

ANN: 555-BOOM! version 0.6

2007-09-25 Thread Greg Ewing
I have released a post-competition version of my PyWeek 5 game competition entry, 555-BOOM!. http://www.cosc.canterbury.ac.nz/greg.ewing/python/PyWeek5/index.html This version has been tidied up in various ways, and a few more levels added. I have made a number of improvements to the level edit

ANN: Albow 1.1 and Humerus 1.0

2007-09-25 Thread Greg Ewing
I have released an updated version of my Albow gui library for PyGame, incorporating improvements made to it for my PyWeek 5 entry, and also Humerus, a skeleton game framework built on Albow. http://www.cosc.canterbury.ac.nz/greg.ewing/python/Albow/ What is it? Albow is a rather basic, no-fri

Re: Newbie completely confused

2007-09-25 Thread Roel Schroeven
Jeroen Hegeman schreef: > Thanks for the comments, > >> (First, I had to add timing code to ReadClasses: the code you posted >> doesn't include them, and only shows timings for ReadLines.) >> >> Your program uses quite a bit of memory. I guess it gets harder and >> harder to allocate the required

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-25 Thread Andrew Durdin
On 9/25/07, Mark Summerfield <[EMAIL PROTECTED]> wrote: > > Since the sorteddict's data is always kept in key order, indexes > (integer offsets) into the sorteddict make sense. Five additional > methods are proposed to take advantage of this: > > key(index : int) -> value > > i

Re: obtaining multiple values from a function.

2007-09-25 Thread Paul Rudin
Carsten Haese <[EMAIL PROTECTED]> writes: > ... > That's not the Fibonacci sequence. Bah, you're right of course, I should be more more careful before posting these things. -- http://mail.python.org/mailman/listinfo/python-list

ANN: PyPE 2.8.7

2007-09-25 Thread Josiah Carlson
=== What is PyPE? === PyPE (Python Programmers' Editor) was written in order to offer a lightweight but powerful editor for those who think emacs is too much and idle is too little. Syntax highlighting is included out of the box, as is multiple open documents via tabs. Beyond the basic functional

buttons keep jumping, frame loads on top of itself

2007-09-25 Thread Mridula Ramesh
hi. my actual code is a bit too long to post here, but this is how the code works : the application loads, the first screen appears. it is to view the records in a database, so you can scroll and view records by clicking on the standard navigation buttons ( |<, <<, >>, >| ). the problem is that s

Re: Inserting an element into existing xml file

2007-09-25 Thread Stefan Behnel
Anand wrote: > I'm new to Python. we are using python2.4. > > I wanted to insert an element into an existing xml file. Can anyone > help me with this? > I've seen lxml and elementTree in python2.5 has some API's to insert > into existing xml file. > We cant use python 2.5 due to some limitations.

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-25 Thread Mark Summerfield
On 25 Sep, 10:53, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > On 2007-09-25, Mark Summerfield <[EMAIL PROTECTED]> wrote: > > > If there is positive feedback I will submit the PEP to the reviewers, > > so if you think it is a good idea please say so. (I'm sure that if you > > _don't_ like it you'll t

Re: Inserting an element into existing xml file

2007-09-25 Thread Anand
On Sep 25, 3:20 pm, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Anand wrote: > > I'm new to Python. we are using python2.4. > > > I wanted to insert an element into an existing xml file. Can anyone > > help me with this? > > I've seen lxml and elementTree in python2.5 has some API's to insert > > in

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-25 Thread Mark Summerfield
On 2007-09-25, Andrew Durdin wrote: > On 9/25/07, Mark Summerfield <[EMAIL PROTECTED]> wrote: > > Since the sorteddict's data is always kept in key order, indexes > > (integer offsets) into the sorteddict make sense. Five additional > > methods are proposed to take advantage of this: >

Re: ANN: PyPE 2.8.7

2007-09-25 Thread stef
Josiah Carlson wrote: > === What is PyPE? === > PyPE (Python Programmers' Editor) was written in order to offer a > lightweight but powerful editor for those who think emacs is too much > and idle is too little. Syntax highlighting is included out of the box, > as is multiple open documents via tab

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-25 Thread Mark Summerfield
On 2007-09-25, Andrew Durdin wrote: > On 9/25/07, Mark Summerfield <[EMAIL PROTECTED]> wrote: > > Since the sorteddict's data is always kept in key order, indexes > > (integer offsets) into the sorteddict make sense. Five additional > > methods are proposed to take advantage of this: >

Re: ANN: PyPE 2.8.7

2007-09-25 Thread stef
Another problem, I tried to run PyPE in my "old IDE", and get the following error: Traceback (most recent call last): File "D:\temp\PyPE-2.8.7-src\PyPE-2.8.7\pype.py", line 20, in ? wxversion.ensureMinimal(v) File "P:\Python\lib\site-packages\wxversion.py", line 178, in ensureMinimal

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-25 Thread Duncan Booth
Mark Summerfield <[EMAIL PROTECTED]> wrote: > When handling collections of key-value data, it is often > convenient to access the data in key order. One way to do this is > to use an unsorted data structure (e.g., a Python dict), and then > sort the keys as needed. Another way is

What is a good way of having several versions of a python module installed in parallell?

2007-09-25 Thread Joel Hedlund
Hi! I write, use and reuse a lot of small python programs for variuos purposes in my work. These use a growing number of utility modules that I'm continuously developing and adding to as new functionality is needed. Sometimes I discover earlier design mistakes in these modules, and rather than

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-25 Thread Jeremy Sanders
Mark Summerfield wrote: > If there is positive feedback I will submit the PEP to the reviewers, > so if you think it is a good idea please say so. (I'm sure that if you > _don't_ like it you'll tell me anyway:-) It would be nice to have the ability to use numerical indexes and the key, but I don'

Re: What is a good way of having several versions of a python module installed in parallell?

2007-09-25 Thread Diez B. Roggisch
Joel Hedlund wrote: > Hi! > > I write, use and reuse a lot of small python programs for variuos purposes > in my work. These use a growing number of utility modules that I'm > continuously developing and adding to as new functionality is needed. > Sometimes I discover earlier design mistakes in t

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-25 Thread Paul Hankin
Recall sorted... sorted(iterable, cmp=None, key=None, reverse=False) --> new sorted list So why not construct sorteddicts using the same idea of sortedness? sorteddict((mapping | sequence | nothing), cmp=None, key=None, reverse=None) Then we can specify the exact behaviour of sorteddicts: it

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-25 Thread Mark Summerfield
On 25 Sep, 12:11, Jeremy Sanders wrote: > Mark Summerfield wrote: > > If there is positive feedback I will submit the PEP to the reviewers, > > so if you think it is a good idea please say so. (I'm sure that if you > > _don't_ like it you'll tell me anyway:-) > > It would be nice to have the abili

Re: Inserting an element into existing xml file

2007-09-25 Thread Marc 'BlackJack' Rintsch
On Tue, 25 Sep 2007 03:30:05 -0700, Anand wrote: > I'm Afraid to say, I can't use lxml or elementTree as it requires many > legal approvals and there is high chances of not getting it through. In what environment is it hard to get something BSD licensed through!? Ciao, Marc 'BlackJack' R

Re: ANN: 555-BOOM! version 0.6

2007-09-25 Thread Markus Gritsch
Hi Greg, thank you for this great game! I like it very much. Just one thing: Your telephone uses numbers ordered like in this picture http://www.michaelsiebert.com/img_kontakt/telephone.jpg, so dialing e.g. 7 triggers 3 impulses. However, where I live (Austria, Europe) the telephones had the nu

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-25 Thread Mark Summerfield
On 25 Sep, 12:19, Paul Hankin <[EMAIL PROTECTED]> wrote: > Recall sorted... > sorted(iterable, cmp=None, key=None, reverse=False) --> new sorted > list > > So why not construct sorteddicts using the same idea of sortedness? > > sorteddict((mapping | sequence | nothing), cmp=None, key=None, > re

Re: database persistence with mysql, sqlite

2007-09-25 Thread M.-A. Lemburg
On 2007-09-23 01:11, coldpizza wrote: > Hi, > > I want to run a database query and then display the first 10 records > on a web page. Then I want to be able to click the 'Next' link on the > page to show the next 10 records, and so on. > > My question is how to implement paging, i.e. the 'Next/Pr

Raw string printing

2007-09-25 Thread Alexandre Badez
Hy ! I would like to do something like: s = r"a\tb\n" print s # result with a\tb\n print unraw(s) # <= this is the "magic" function I'm searching for # result with ab n Does any of you know how to do it properly ? -- http://mail.python.org/mailman/listinfo/python-list

Re: An Editor that Skips to the End of a Def

2007-09-25 Thread Steve Holden
Bjoern Schliessmann wrote: > Lawrence D'Oliveiro wrote: >> That's like saying, about a program that, when given "2 + 2", >> outputs "5", that _of course_ it knows the correct answer is "4", >> it just chooses to "modify" the answer before outputting it. > > No. Which laws say how transitions betwe

Re: Raw string printing

2007-09-25 Thread Peter Otten
Alexandre Badez wrote: > I would like to do something like: > > s = r"a\tb\n" > print unraw(s) # <= this is the "magic" function I'm searching for > # result with > ab > n > > Does any of you know how to do it properly ? >>> print r"a\tb\nx".decode("string-escape") a b x Peter -- h

Re: Raw string printing

2007-09-25 Thread Alexandre Badez
On Sep 25, 2:24 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > Alexandre Badez wrote: > > I would like to do something like: > > > s = r"a\tb\n" > > print unraw(s) # <= this is the "magic" function I'm searching for > > # result with > > ab > > n > > > Does any of you know how to do it properly ?

Re: Newbie completely confused

2007-09-25 Thread Roel Schroeven
Roel Schroeven schreef: > import time > > input_files = ["./test_file0.txt", "./test_file1.txt"] > > total_start = time.time() > data = {} > for input_fn in input_files: > file_start = time.time() > f = file(input_fn, 'r') > data[input_fn] = f.read() > f.close() > file_do

Re: strange behavious of the logging module?

2007-09-25 Thread Vinay Sajip
On 25 Sep, 09:40, Peter Otten <[EMAIL PROTECTED]> wrote: > You could try setting > > logging._srcfile =logging.info.func_code.co_filename > > manually, but that might break other things. Or you recreate the pyc-files > of your distribution. Again, I don't know what might break... > Recreating .pyc

Re: sorting a list numbers stored as strings

2007-09-25 Thread Steven D'Aprano
On Tue, 25 Sep 2007 12:46:54 +0800, Delaney, Timothy (Tim) wrote: > Carsten Haese wrote: > >> On Mon, 2007-09-24 at 19:58 +0800, Delaney, Timothy (Tim) wrote: >>> I'm sure that in some version of Python it would have given a >>> ValueError (due to the default radix being 0) but it appears to have

ANNOUNCE: Exscript 0.9.9

2007-09-25 Thread Samuel
Introduction - Exscript is a scripting language for automating Telnet or SSH sessions. It supports a wide range of features, such as parallelization, AAA authentication methods, TACACS, and a very simple template language. This release comes with many new features, and the documentatio

PyQt disconnect signal / slot

2007-09-25 Thread Alexander Eisenhuth
Hello PyQt experts, do i have to disconnect all signal/slots, after the emitting object is deleted, or does it the QObject destructor? Thanks Alexander -- http://mail.python.org/mailman/listinfo/python-list

Re: PyQt disconnect signal / slot

2007-09-25 Thread Phil Thompson
On Tuesday 25 September 2007, Alexander Eisenhuth wrote: > Hello PyQt experts, > > do i have to disconnect all signal/slots, after the emitting object is > deleted, or does it the QObject destructor? It's done for you - same as Qt. Phil -- http://mail.python.org/mailman/listinfo/python-list

Re: PyQt disconnect signal / slot

2007-09-25 Thread Alexander Eisenhuth
Phil, thanks for that quick reply Phil Thompson schrieb: > On Tuesday 25 September 2007, Alexander Eisenhuth wrote: >> Hello PyQt experts, >> >> do i have to disconnect all signal/slots, after the emitting object is >> deleted, or does it the QObject destructor? > > It's done for you - same as Qt

Re: sorting a list numbers stored as strings

2007-09-25 Thread Hrvoje Niksic
"Delaney, Timothy (Tim)" <[EMAIL PROTECTED]> writes: > Yep - appears I must have been misremembering from another language > (dunno which) Tcl -- http://mail.python.org/mailman/listinfo/python-list

HTTPS request

2007-09-25 Thread Johny
If I need to log in to a site using https protocol must I use certification file and key file? The class HTTPSConnection syntax is class HTTPSConnection( host[, port, key_file, cert_file]) and I do not know if it is nescessary or not. Thanks for help. L. -- http://mail.python.org/mailman/listinf

Re: Python script to optimize XML text

2007-09-25 Thread Robert Dailey
Hey guys, Thanks for everyone's input. I wanted to learn regular expressions, however I'm finding them to be quite evil. I think I've learned that it's always a good idea to make regex a very LAST resort. This is my opinion I'm developing on. In any case, I like the ideas mentioned here concerning

Re: directpython question

2007-09-25 Thread Heikki Salo
veki wrote: > Hello, > I've got IBM Thinkpad 30 laptop with configuration: > > IBM Thinkpad R30 > P3 Mobile Celeron 900mhz > 128mb sdram pc133 > 15gb hdd > cd-rom Teac cd-224e > 56K V.90/92 > 10/100 Ethernet > lpt port > ps2 port > 2 x usb port > vga-out > pcmcia > > ,then I have been install dir

Re: Confused about 'positive lookbehind assertion'

2007-09-25 Thread Robert Dailey
I think I get it... it's really just a way (so it seems) to make characters get added to the found groups as they're matched. Thanks for your help. On 9/25/07, Andrew Durdin <[EMAIL PROTECTED]> wrote: > > On 9/25/07, Robert Dailey <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I've been reading the py

PyS60

2007-09-25 Thread croozeus
Does anybody in the group develop applications for symbian OS using Python for Series 60? I am interested in developing such applications.. Also i have the following site for the newbies to PyS60. Regards, Pankaj Nathani Pys60 1.4.0 on Nokia 6680 4.04 2nd Edition FP2,Pys60 1.4.0 on Nokia 7610 2nd

Re: Regular Expressions: Can't quite figure this problem out

2007-09-25 Thread Robert Dailey
Awesome description. This was more than helpful. I'm really grateful that you took the time to outline that for me. I really understand it now. However, as I mentioned in the lxml mailing list, I'm starting to learn more towards regular expressions being a very LAST resort to solving problems like

Re: Confused about 'positive lookbehind assertion'

2007-09-25 Thread Erik Jones
On Sep 24, 2007, at 9:38 PM, Robert Dailey wrote: > Hi, > > I've been reading the python documentation on 'positive lookbehind > assertion' and I don't understand at all how it works. The python > docs give the following example: > > " (?<=abc)def will find a match in "abcdef", since the look

Clustering text-documents in bundles

2007-09-25 Thread exhuma.twn
Hi, This *is* off-topic but with python being a language with a somewhat scientific audience, I might get lucky ;) I have a set of documents (helpdesk tickets in fact) and I would like to automatically collect them in bundles so I can visualise some statistics depending on content. A while ago I

Re: Regular Expressions: Can't quite figure this problem out

2007-09-25 Thread Paul McGuire
On Sep 24, 11:23 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 24 Sep 2007 23:51:57 -0300, Robert Dailey <[EMAIL PROTECTED]> > escribi?: > > > What I meant was that it's not an option because I'm trying to learn > > regular > > expressions. RE is just as built in as anything else

Re: Clustering text-documents in bundles

2007-09-25 Thread Paul Hankin
On Sep 25, 4:11 pm, "exhuma.twn" <[EMAIL PROTECTED]> wrote: > Is it possible to calculate a distance between two chunks of text? I > suppose one could simply do a simple word-count on the chunks > (removing common noise words of course). And then go from there. Maybe > even assigning different weig

comparing elements of a list with a string

2007-09-25 Thread Shriphani
Hello all, I have a problem here. I have a list named list_of_files which contains filenames with their timestamps attached to the name. If I have a string "fstab", and I want to list out the files in whose names the word fstab appears should I go about like this : def listAllbackups(file): li

Re: Regular Expressions: Can't quite figure this problem out

2007-09-25 Thread Robert Dailey
Fortunately I don't have any XML that complex, however you make a good point. On 9/25/07, Paul McGuire <[EMAIL PROTECTED]> wrote: > > On Sep 24, 11:23 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: > > En Mon, 24 Sep 2007 23:51:57 -0300, Robert Dailey <[EMAIL PROTECTED]> > > escribi?: > > >

Re: Regular Expressions: Can't quite figure this problem out

2007-09-25 Thread Miles
On 9/25/07, Paul McGuire wrote: > On Sep 24, 11:23 pm, Gabriel Genellina wrote: > > py> print re.sub(r"<(\w+)([^>]*)>", r"<\1\2 />", source) > > And let's hope the OP doesn't have to parse anything truly nasty like: > > esolang:language> Or something mildly nasty, like -Miles -- http://mail.py

Re: comparing elements of a list with a string

2007-09-25 Thread Evan Klitzke
On Tue, 2007-09-25 at 08:39 -0700, Shriphani wrote: > Hello all, > I have a problem here. I have a list named list_of_files which > contains filenames with their timestamps attached to the name. If I > have a string "fstab", and I want to list out the files in whose names > the word fstab appears s

Re: What is a good way of having several versions of a python module installed in parallell?

2007-09-25 Thread Steve Holden
Diez B. Roggisch wrote: > Joel Hedlund wrote: > >> Hi! >> >> I write, use and reuse a lot of small python programs for variuos purposes >> in my work. These use a growing number of utility modules that I'm >> continuously developing and adding to as new functionality is needed. >> Sometimes I disc

Re: An Editor that Skips to the End of a Def

2007-09-25 Thread Peter Decker
On 9/25/07, Steve Holden <[EMAIL PROTECTED]> wrote: > >> Why does it "choose" to modify your position when you exit insert > >> mode? Does the phrase "broken as designed" mean anything to you? > > > > Does the phrase "everything I don't like is stupid" mean anything to > > you? Honestly, if you do

Re: HTTPS request

2007-09-25 Thread Larry Bates
Johny wrote: > If I need to log in to a site using https protocol must I use > certification file and key file? > The class HTTPSConnection syntax is > class HTTPSConnection( host[, port, key_file, cert_file]) > > and I do not know if it is nescessary or not. > Thanks for help. > L. > Depends on

Re: comparing elements of a list with a string

2007-09-25 Thread Matimus
Shriphani wrote: > Hello all, > I have a problem here. I have a list named list_of_files which > contains filenames with their timestamps attached to the name. If I > have a string "fstab", and I want to list out the files in whose names > the word fstab appears should I go about like this : > > d

Re: comparing elements of a list with a string

2007-09-25 Thread Larry Bates
Shriphani wrote: > Hello all, > I have a problem here. I have a list named list_of_files which > contains filenames with their timestamps attached to the name. If I > have a string "fstab", and I want to list out the files in whose names > the word fstab appears should I go about like this : > > d

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-25 Thread Steven Bethard
Mark Summerfield wrote: > PEP: XXX > Title: Sorted Dictionary [snip] > In addition, the keys() method has two optional arguments: > > keys(firstindex : int = None, secondindex : int = None) -> list of keys > > The parameter names aren't nice, but using say "start" and "end" would >

Re: sorting a list numbers stored as strings

2007-09-25 Thread thebjorn
On Sep 25, 2:45 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Tue, 25 Sep 2007 12:46:54 +0800, Delaney, Timothy (Tim) wrote: > > Carsten Haese wrote: > > >> On Mon, 2007-09-24 at 19:58 +0800, Delaney, Timothy (Tim) wrote: > >>> I'm sure that in some version of Python it wou

Re: Nested For and While Statements

2007-09-25 Thread Zentrader
Scope had to do with "visibility" and not with how memory was allocated. Scope means, can this line of code access that block of memory. Note that in list comprehension, [x for x in (1, 2, 3)], the for loop allocates memory the same way, but the scope changes so that "x" is visible outside the fo

Invoking python through C++: How to?

2007-09-25 Thread Robert Dailey
Hi, I have a python script that I would like to invoke through my C++ application. Does anyone know of a trivial way of doing this? Right now the only idea I can come up with is using system("python myscript.py") in C++. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: M2Crypto 0.18 - new version, same old build bugs - more details

2007-09-25 Thread John Nagle
Heikki Toivonen wrote: > John Nagle wrote: > >>But notice that the -D entry didn't appear on the SWIG command line. >>Neither did the "-includeall". The "swig_opts" values around line >>129 aren't actually being used. I think that's left over from the code >>intended >>to allow builds with Pytho

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-25 Thread thebjorn
On Sep 25, 10:53 am, Mark Summerfield <[EMAIL PROTECTED]> wrote: > Hi, > > Below is a PEP proposal for a sorteddict. It arises out of a > discussion on this list that began a few weeks ago with the subject of > "An ordered dictionary for the Python library?", and a similar one on > the P3K mailing

Script to extract text from PDF files

2007-09-25 Thread brad
I have a very crude Python script that extracts text from some (and I emphasize some) PDF documents. On many PDF docs, I cannot extract text, but this is because I'm doing something wrong. The PDF spec is large and complex and there are various ways in which to store and encode text. I wanted t

Re: comparing elements of a list with a string

2007-09-25 Thread Steve Holden
Larry Bates wrote: > Shriphani wrote: >> Hello all, >> I have a problem here. I have a list named list_of_files which >> contains filenames with their timestamps attached to the name. If I >> have a string "fstab", and I want to list out the files in whose names >> the word fstab appears should I g

Re: Nested For and While Statements

2007-09-25 Thread metawilm
On Sep 25, 7:07 pm, Zentrader <[EMAIL PROTECTED]> wrote: > Note that in list comprehension, [x for x in (1, 2, 3)], the > for loop allocates memory the same way, but the scope changes so that > "x" is visible outside the for loop, How is this different? The variable spilling of list comprehension

Re: Clustering text-documents in bundles

2007-09-25 Thread Paul Rubin
"exhuma.twn" <[EMAIL PROTECTED]> writes: > Is it possible to calculate a distance between two chunks of text? I > suppose one could simply do a simple word-count on the chunks > (removing common noise words of course). And then go from there. Maybe > even assigning different weighting to words. But

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-25 Thread Paul Hankin
On Sep 25, 12:51 pm, Mark Summerfield <[EMAIL PROTECTED]> wrote: > On 25 Sep, 12:19, Paul Hankin <[EMAIL PROTECTED]> wrote: > > > > > Recall sorted... > > sorted(iterable, cmp=None, key=None, reverse=False) --> new sorted > > list > > > So why not construct sorteddicts using the same idea of so

Survey about Visual Annotations for Software Models

2007-09-25 Thread Joerg Rech
Dear software practitioner, During software development, we often experience problems regarding the compilability, quality (e.g., maintainability), or conformance of our software. With a model-driven approach such as MDSD (Model-Driven Software Development), we might work on a higher abstraction

Re: sorting a list numbers stored as strings

2007-09-25 Thread ZeD
thebjorn wrote: >> >>> int("020") >> 20 >> >>> 020 >> 16 > > You can get the latter behavior using eval: why using eval when int has the "base" optional parameter? >>> int("020") 20 >>> int("020", 8) 16 >>> int("09", 8) Traceback (most recent call last): File "", line 1, in ValueError: inval

RE: sorteddict PEP proposal [started off as orderedict]

2007-09-25 Thread Hamilton, William
> From: Paul Hankin > > > Here's a first go. Sorting occurs when the keys are iterated over, > making it fast (almost as a dict) for construction, insertion, and > deletion, but slow if you're iterating a lot. You should look at some > use cases to decide if this approach is best, or if a sorted

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-25 Thread Steven Bethard
Paul Hankin wrote: > On Sep 25, 12:51 pm, Mark Summerfield <[EMAIL PROTECTED]> > wrote: >> On 25 Sep, 12:19, Paul Hankin <[EMAIL PROTECTED]> wrote: >> >> >> >>> Recall sorted... >>> sorted(iterable, cmp=None, key=None, reverse=False) --> new sorted >>> list >>> So why not construct sorteddicts

Re: Script to extract text from PDF files

2007-09-25 Thread Paul Hankin
On Sep 25, 6:41 pm, brad <[EMAIL PROTECTED]> wrote: > I have a very crude Python script that extracts text from some (and I > emphasize some) PDF documents. On many PDF docs, I cannot extract text, > but this is because I'm doing something wrong. The PDF spec is large and > complex and there are va

Re: [Tutor] Take if offline

2007-09-25 Thread Shawn Milochik
Since everyone else is replying to the list, I'll (top) post this: No, not really. He had to give everyone the rule once. Otherwise, he'd have to do it a hundred times a day, and monitor every single post to find out who he had to inform. He'd end up doing not much else with his life, and would fl

Re: Script to extract text from PDF files

2007-09-25 Thread byte8bits
On Sep 25, 3:02 pm, Paul Hankin <[EMAIL PROTECTED]> wrote: > Googling for 'pdf to text python' and following the first link > giveshttp://pybrary.net/pyPdf/ Doesn't work that well, I've tried it, you should too... the author even admits this: extractText() [#] Locate all text drawing comman

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-25 Thread Hrvoje Niksic
Steven Bethard <[EMAIL PROTECTED]> writes: > With this is the implementation, I'm definitely -1. Not because it's a > bad implementation, but because if the iteration is always doing a > sort, then there's no reason for a separate data structure. Agreed. A true sorted dict would keep its keys so

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-25 Thread Paul Hankin
On Sep 25, 7:58 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > > Paul Hankin wrote: > > ... > > class sorteddict(dict): > > "A sorted dictionary" > > def __init__(self, arg=None, cmp=None, key=None, reverse=False): > > if arg: > > ... > > With this is the implementation, I'm de

Re: [ANN] Release 0.65.1 of Task Coach

2007-09-25 Thread Dmitry Balabanov
2007/9/24, Frank Niessink <[EMAIL PROTECTED]>: > Hi, > > I'm happy to announce release 0.65.1 of Task Coach. This release fixes > one critical bug and two minor bugs. Since the critical bug may lead > to data loss, I recommend users of release 0.65.0 to upgrade. > > Bugs fixed: > > * Saving a task

Re: Who can develop the following Python script into working application ?

2007-09-25 Thread Tobiah
Diez B. Roggisch wrote: > Andrey Khavryuchenko schrieb: >> DBR> And as you said yourself: >> >> DBR> """ >> DBR> Frankly speaking I would prefer to pay for your kind assistance >> DBR> as it may take me to much time to learn some Python and >> understand the >> DBR> following script. >> DBR>

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-25 Thread chris . monsanto
On Sep 25, 1:35 pm, thebjorn <[EMAIL PROTECTED]> wrote: > On Sep 25, 10:53 am, Mark Summerfield <[EMAIL PROTECTED]> > wrote: > > > Hi, > > > Below is a PEP proposal for a sorteddict. It arises out of a > > discussion on this list that began a few weeks ago with the subject of > > "An ordered dictio

Overriding Logging Config FileHandler Filename

2007-09-25 Thread Kenneth Love
I have a Python logging config file that contains a RotatingFileHandler handler. In the args key, I have hard-coded the log filename. Everything works great. However, I find that I now need to override this filename at application runtime. Is there a good way to do this? Here is a bit of sampl

  1   2   >