Re: the address of list.append and list.append.__doc__

2007-09-25 Thread Gabriel Genellina
En Wed, 26 Sep 2007 03:29:09 -0300, HYRY <[EMAIL PROTECTED]> escribi�: > I want to add a docstring translator into the Python interpreter. If > the user input: a = [1,2,3] a.append( > this translator will show the docstring of append in my native > language. Because __doc__ is read only,

Re: Clustering text-documents in bundles

2007-09-25 Thread exhuma.twn
On Sep 25, 7:52 pm, Paul Rubin wrote: > "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 the

Hello Gabriel cant help noticing you

2007-09-25 Thread hrishy
Hi Gabriel I couldnt help but to write this mail. I am not a python programmer just a shell script coder and i am planning to learn some decent python and raise my level from a shell script junkie to a Python gentleman the way you explain things and show it in code is simply amazing. I particula

Re: the address of list.append and list.append.__doc__

2007-09-25 Thread HYRY
> "the problem"? > Perhaps if you explain what you really want to do, someone can think the > way to do that, most likely *not* using id() Thanks, now I know I cannot use id() for my problem. Here is my problem: I want to add a docstring translator into the Python interpreter. If the user input:

Re: setuptools without unexpected downloads

2007-09-25 Thread Ben Finney
Ben Finney <[EMAIL PROTECTED]> writes: > How can I, as the distributor of a package using setuptools, gain > the benefits of dependency declaration and checking, without the > drawback of unexpected and potentially unwanted download and > installation? To clarify: I want to retain the "assert the

setuptools without unexpected downloads

2007-09-25 Thread Ben Finney
Howdy all, The Python distutils has been built upon by setuptools, providing features asked for by many developers. One of these is the ability for the 'setup.py' program to declare package dependencies in a fairly standardised way, and determine if they're met before attempting to install the pa

Re: Overriding Logging Config FileHandler Filename

2007-09-25 Thread Vinay Sajip
On Sep 25, 9:15 pm, "Kenneth Love" <[EMAIL PROTECTED]> wrote: > I have a Pythonloggingconfig 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 applicat

Re: the address of list.append and list.append.__doc__

2007-09-25 Thread Gabriel Genellina
En Wed, 26 Sep 2007 01:22:37 -0300, HYRY <[EMAIL PROTECTED]> escribi�: > I installed python 2.4.4 and tried id(list.append.__doc__) again, here > is the result, only id(list.append.__doc__) changes, this is strange, > and only happened in the command line. Because I am doing something > program th

Re: Best way to do attribute docstrings?

2007-09-25 Thread Gabriel Genellina
En Tue, 25 Sep 2007 22:41:31 -0300, Ken Kuhlman <[EMAIL PROTECTED]> escribi�: > Replying to myself in case someone finds this interesting. > > Anyway, I took another shot at this with a little fresher mind, and it > was quickly obvious that I was trying to force attributes to behave > more like

Re: %s shortcut?

2007-09-25 Thread james_027
hi bjorn, > You could do [year]*12 + [order_by] like so: > > >>> [1970] * 12 + ['foo'] > > [1970, 1970, 1970, 1970, 1970, 1970, 1970, 1970, 1970, 1970, 1970, > 1970, 'foo'] > > > > I don't know which database you're using, but the above doesn't look > like SQL'92... > Thanks, it works! I am using

Re: HTTPS request

2007-09-25 Thread Johny
On Sep 25, 6:17 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > 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 k

Re: Missing documentation for ElementTree?

2007-09-25 Thread timaranz
On Sep 26, 4:00 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 25 Sep 2007 19:39:33 -0300, Robert Dailey <[EMAIL PROTECTED]> > escribi?: > > > for the _ElementInterface class, there is no documentation for most of > > the > > members of this class such as .tail and .text. There's a br

Re: ANN: PyPE 2.8.7

2007-09-25 Thread thebjorn
On Sep 25, 12:46 pm, stef <[EMAIL PROTECTED]> wrote: > Another problem, > I tried to run PyPE in my "old IDE", instead of double-clicking on the PyPE.exe file? Why? -- bjorn -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: PyPE 2.8.7

2007-09-25 Thread thebjorn
On Sep 25, 12:37 pm, stef <[EMAIL PROTECTED]> wrote: > 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 i

Re: the address of list.append and list.append.__doc__

2007-09-25 Thread HYRY
> No. a.append is a "bound method" - a method that already has an > associated instance, that will be provided as the first argument to the > method call. Bound methods are created "on the fly". > Does this means there is no method to get the original methods from the Bound methods created "on the

Re: stopping a while True: with the keyboard

2007-09-25 Thread Gabriel Genellina
En Tue, 25 Sep 2007 22:19:08 -0300, patrick <[EMAIL PROTECTED]> escribi�: > i am looking for a way to break a while True: when pressing "s" on my > keyboard. how can i do this? Windows only: Using the msvcrt module: from msvcrt import kbhit, getch a, b = 1, 1 while True: a, b = a+b

Re: %s shortcut?

2007-09-25 Thread thebjorn
On Sep 26, 4:55 am, james_027 <[EMAIL PROTECTED]> wrote: > hi i have something like this > > cursor.execute(""" > select c.name, > (select from ap_invoice i where Month(i.date) = 1 and > Year(i.date) = %s and i.customer_id = c.id and i.status != 'CAN') jan, >

Re: Missing documentation for ElementTree?

2007-09-25 Thread Gabriel Genellina
En Tue, 25 Sep 2007 19:39:33 -0300, Robert Dailey <[EMAIL PROTECTED]> escribi�: > for the _ElementInterface class, there is no documentation for most of > the > members of this class such as .tail and .text. There's a brief > description > of these things on the front page of the ElementTree

Re: Invoking python through C++: How to?

2007-09-25 Thread Robert Dailey
On 9/25/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > > If you don't want to "share" objects between Python and C++, that's the > simplest way. > Or, look at the document "Extending and Embedding the Python Interpreter" > > > -- > Gabriel Genellina Thank

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

2007-09-25 Thread Jason M Barnes
Warning: Religion follows: On 9/25/07, Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > In message <[EMAIL PROTECTED]>, A.T.Hofkamp wrote: > > > On 2007-09-25, Lawrence D'Oliveiro <[EMAIL PROTECTED]> > > wrote: > > > >> Why does it "choose" to modify your position when you exit insert mode? > > >

Re: stopping a while True: with the keyboard

2007-09-25 Thread Ben Finney
Benjamin <[EMAIL PROTECTED]> writes: > On Sep 25, 8:19 pm, patrick <[EMAIL PROTECTED]> wrote: > > hi all, > > > > i am looking for a way to break a while True: when pressing "s" on my > > keyboard. how can i do this? > > > > pat > > Ctrl-C That's not a very helpful response, since it doesn't add

Re: the address of list.append and list.append.__doc__

2007-09-25 Thread Steve Holden
HYRY wrote: > I have the following questions, I am using Python 2.4.2 > a = [1,2,3] id(a.append) > 19167152 #1 id(list.append) > 11306608 #1 > > 1. the address of a.append and list.append is different, can I get the > address of list.append from a.append? > No.

Re: Invoking python through C++: How to?

2007-09-25 Thread Gabriel Genellina
En Tue, 25 Sep 2007 14:10:49 -0300, Robert Dailey <[EMAIL PROTECTED]> escribi�: > 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

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

2007-09-25 Thread Ben Finney
Lawrence D'Oliveiro <[EMAIL PROTECTED]> writes: > That's another issue, that of ROI. Having learnt the vi/vim > keystrokes, what does that enable you to do? Use vi/vim, and that's > it. There are a great many programs whose interactive keybindings come from vi. Perhaps you've heard of 'less', 'sc

Re: stopping a while True: with the keyboard

2007-09-25 Thread Andy
Hi, I think you can use the 'curses' module to catch the keyboard event. The name of the method is 'keyname()'. But I'm afraid curses is not available on Windows Python, so you may have to be a bit more imaginative. I just tried with Python 2.4 on Windows XP. To leave the while loop, use the 'b

Re: Nested For and While Statements

2007-09-25 Thread Gabriel Genellina
En Tue, 25 Sep 2007 14:48:29 -0300, <[EMAIL PROTECTED]> escribi�: > 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 lo

Re: jack audio connection kit

2007-09-25 Thread patrick
found the perfect solution (for linux at least) : gstreamer! http://pygstdocs.berlios.de/ pat -- http://mail.python.org/mailman/listinfo/python-list

%s shortcut?

2007-09-25 Thread james_027
hi i have something like this cursor.execute(""" select c.name, (select from ap_invoice i where Month(i.date) = 1 and Year(i.date) = %s and i.customer_id = c.id and i.status != 'CAN') jan, (select from ap_invoice i where Month(i.date) = 2 and Year(i.date

Re: stopping a while True: with the keyboard

2007-09-25 Thread patrick
i don't want to quit my program only get out from a while True: also i want to use only 1 key like s. pat Benjamin wrote: > On Sep 25, 8:19 pm, patrick <[EMAIL PROTECTED]> wrote: > >> hi all, >> >> i am looking for a way to break a while True: when pressing "s" on my >> keyboard. how can i d

the address of list.append and list.append.__doc__

2007-09-25 Thread HYRY
I have the following questions, I am using Python 2.4.2 >>> a = [1,2,3] >>> id(a.append) 19167152 #1 >>> id(list.append) 11306608 #1 1. the address of a.append and list.append is different, can I get the address of list.append from a.append? >>> id(a.append.__doc__) 19162720

Re: stopping a while True: with the keyboard

2007-09-25 Thread Benjamin
On Sep 25, 8:19 pm, patrick <[EMAIL PROTECTED]> wrote: > hi all, > > i am looking for a way to break a while True: when pressing "s" on my > keyboard. how can i do this? > > pat Ctrl-C -- http://mail.python.org/mailman/listinfo/python-list

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

2007-09-25 Thread Gabriel Genellina
En Tue, 25 Sep 2007 18:21:08 -0300, Robert Dailey <[EMAIL PROTECTED]> escribi�: > One thing I noticed is that it is placing an arbitrary space between " > and > />. For example: > > > > > Notice that there's a space between "image" and /> Just remove the space in the replacement string: >>

Re: jack audio connection kit

2007-09-25 Thread Asun Friere
On Sep 26, 4:44 am, patrick <[EMAIL PROTECTED]> wrote: > hello everyone, > > is there a way to make python output audio in jack:http://jackaudio.org/ > > jack is the best audio solution for linux, mac and lately windows. i > found 1 project called pyjack, but the author remove the software from > h

Re: Script to extract text from PDF files

2007-09-25 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > 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... This is inherent in the nature of PDF: it's a

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

2007-09-25 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, A.T.Hofkamp wrote: > On 2007-09-25, Lawrence D'Oliveiro <[EMAIL PROTECTED]> > wrote: > >> Why does it "choose" to modify your position when you exit insert mode? > > Try to insert 1 character in the middle of a line. You'll end up at the > same position. Now press

Re: Best way to do attribute docstrings?

2007-09-25 Thread Ken Kuhlman
Replying to myself in case someone finds this interesting. Anyway, I took another shot at this with a little fresher mind, and it was quickly obvious that I was trying to force attributes to behave more like classes. It was a small step from there to creating a factory function to return instance

Re: Python XML API's that preserve XML comments?

2007-09-25 Thread Ben Finney
Dan Stromberg <[EMAIL PROTECTED]> writes: > Are there any python XML parsing API's that preserve comments (I think you mean "python XML parsing libraries"; it's the library, not the API, that preserves comments or not.) I don't have an answer, but this may help to get more information. The XML 1

stopping a while True: with the keyboard

2007-09-25 Thread patrick
hi all, i am looking for a way to break a while True: when pressing "s" on my keyboard. how can i do this? pat -- http://mail.python.org/mailman/listinfo/python-list

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

2007-09-25 Thread Robert Dailey
On 9/25/07, J. Cliff Dyer <[EMAIL PROTECTED]> wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Robert Dailey top posted: > > Hmm, ElementTree.tostring() also adds a space between the last > > character of the element name and the />. Not sure why it is doing > > this. > > > > Somethin

Python XML API's that preserve XML comments?

2007-09-25 Thread Dan Stromberg
Are there any python XML parsing API's that preserve comments - preferrably that come with python 2.5.1? -- http://mail.python.org/mailman/listinfo/python-list

Test-driven development and code size (was: What is a good way of having several versions of a python module installed in parallell?)

2007-09-25 Thread Ben Finney
Joel Hedlund <[EMAIL PROTECTED]> writes: > Do you also do [test-driven development] for all the little stuff, > the small hacks you just whip together to get a particular task > done? My impression is that doing proper unittests adds a lot of > time to development, and I'm thinking that this may b

Re: jack audio connection kit

2007-09-25 Thread John Churchill
On Tue, 25 Sep 2007, patrick wrote: > hello everyone, > > is there a way to make python output audio in jack: > http://jackaudio.org/ > > jack is the best audio solution for linux, mac and lately windows. i > found 1 project called pyjack, but the author remove the software from > his website. > >

Missing documentation for ElementTree?

2007-09-25 Thread Robert Dailey
Hi, for the _ElementInterface class, there is no documentation for most of the members of this class such as .tail and .text. There's a brief description of these things on the front page of the ElementTree docs but nothing helpful. I have no idea what Tail is vs Text and I wanted to figure this o

Re: jack audio connection kit

2007-09-25 Thread Diez B. Roggisch
patrick schrieb: > hello everyone, > > is there a way to make python output audio in jack: > http://jackaudio.org/ > > jack is the best audio solution for linux, mac and lately windows. i > found 1 project called pyjack, but the author remove the software from > his website. > > that would be

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

2007-09-25 Thread Robert Dailey
Hmm, ElementTree.tostring() also adds a space between the last character of the element name and the />. Not sure why it is doing this. Something like will become after the tostring(). On 9/25/07, Robert Dailey <[EMAIL PROTECTED]> wrote: > > One thing I noticed is that it is placing an arbitrar

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

2007-09-25 Thread Joel Hedlund
First of all, thanks for all the input - it's appreciated. > Otherwise, three words: > > test driven development Do you also do this for all the little stuff, the small hacks you just whip together to get a particular task done? My impression is that doing proper unittests adds a lot of time

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

2007-09-25 Thread Joel Hedlund
First of all, thanks for all the input - it's appreciated. > Otherwise, three words: > > test driven development Do you also do this for all the little stuff, the small hacks you just whip together to get a particular task done? My impression is that doing proper unittests adds a lot of time

Re: Confused about 'positive lookbehind assertion'

2007-09-25 Thread Andrew Durdin
On 9/25/07, Karthik Gurusamy <[EMAIL PROTECTED]> wrote: > > Any idea what this positive lookbehind achieves which can't be done > without it. > I remember cases where positive look-ahead is useful. > > In the above example, r.search('abcdef') does the job of ensuring > 'def' is preceded by 'abc'.

Re: comparing elements of a list with a string

2007-09-25 Thread byte8bits
On Sep 25, 11:39 am, Shriphani <[EMAIL PROTECTED]> wrote: > 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): > list_of_files = os.listdir("/home/shriphani/backupdir") > for eleme

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-25 Thread Paul Hankin
On Sep 25, 9:55 pm, Mark Summerfield <[EMAIL PROTECTED]> wrote: > ... > class sorteddict(dict): > > ... > if self.__keys is None: > self.__keys = sorted(dict.keys(self), cmp=self.__cmp, > key=self.__key, > reverse=self.__reverse) You'd be better

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

2007-09-25 Thread Robert Dailey
One thing I noticed is that it is placing an arbitrary space between " and />. For example: Notice that there's a space between "image" and /> Any way to fix this? Thanks. On 9/24/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > > En Mon, 24 Sep 2007 23:51:57 -0300, Robert Dailey <[EMAIL PR

Re: Confused about 'positive lookbehind assertion'

2007-09-25 Thread Karthik Gurusamy
On Sep 25, 8:01 am, Erik Jones <[EMAIL PROTECTED]> wrote: > 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:

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-25 Thread Mark Summerfield
On 25 Sep, 20:28, Paul Hankin <[EMAIL PROTECTED]> wrote: > 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):

Re: Zope review

2007-09-25 Thread Egon Frerich
Sean Tierney schrieb: >>From Twisted's website "Twisted is a networking engine written in > Python, supporting numerous protocols. It contains a web server, > numerous chat clients, chat servers, mail servers, and more. > > Given that Zope is also a written in python, supports numerous > protocols

Re: Python script to optimize XML text

2007-09-25 Thread Gabriel Genellina
En Tue, 25 Sep 2007 11:43:03 -0300, Robert Dailey <[EMAIL PROTECTED]> escribi�: > 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

jack audio connection kit

2007-09-25 Thread patrick
hello everyone, is there a way to make python output audio in jack: http://jackaudio.org/ jack is the best audio solution for linux, mac and lately windows. i found 1 project called pyjack, but the author remove the software from his website. that would be neat! pat -- http://mail.python.

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-25 Thread James Stroud
Mark Summerfield wrote: > Hmmm, managed to confuse myself with 'b' and 'd'! > > d = sorteddict({1:"one", 3:"three", 5:"five", 99:"ninetynine"}) > > d.items() > > [(1, 'one'), (3, 'three'), (5, 'five'), (99, 'ninetynine')] > > d[3], d.value(3) > > ('three', 'ninetynine') > > So using [] return

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-25 Thread James Stroud
Mark Summerfield wrote: > On 2007-09-25, Andrew Durdin wrote: >> e.g. sorteddict({1:'a', 3:'b': 5:'c', 99:'d'})[3] should return 'b', not >> 'd'. > > The sorteddict really does work in key order, so: > > d = sorteddict({1:'a', 3:'b', 5:'c', 99:'d'}) > d.items() > [(1, 'a'), (3, 'b'),

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

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

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: [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: 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: 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: 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: [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 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: 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: 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: 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

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: 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

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: 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: 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

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: 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

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

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: 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

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: 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: 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: 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: 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: 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: 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: 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: 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: 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?: > > >

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: 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

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

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: 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

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

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: 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

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: 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

  1   2   >