Re: Best Way to extract Numbers from String

2010-03-20 Thread Novocastrian_Nomad
Regular expression are very powerful, and I use them a lot in my paying job (unfortunately not with Python). You are however, basically using a second programing language, which can be difficult to master. Does this give you the desired result? import re matches = re.findall('([\d\.,]+)\s*', c

Re: How to automate accessor definition?

2010-03-20 Thread Steven D'Aprano
On Sat, 20 Mar 2010 22:15:54 +, kj wrote: > I need to create a class solely for the purpose of encapsulating a large > number of disparate data items. There's a built-in for that. It's called "dict". Syntax for item access is a tiny bit different, but still very common: data['foo'] instead

Re: How to automate accessor definition?

2010-03-20 Thread Someone Something
Just initialize everything in the constructor, unless you have *really *good reason not to do that. On Sat, Mar 20, 2010 at 6:54 PM, Chris Rebert wrote: > On Sat, Mar 20, 2010 at 3:15 PM, kj wrote: > > I need to create a class solely for the purpose of encapsulating > > a large number of dispara

Re: Best Way to extract Numbers from String

2010-03-20 Thread Someone Something
Its an extremely bad idea to use regex for HTML. You want to change one tiny little thing and you have to write the regex all over again. if its a throwaway script, then go ahead. 2010/3/20 Luis M. González > On Mar 20, 12:04 am, Jimbo wrote: > > Hello > > > > I am trying to grab some numbers fr

Re: Ubuntu install problems

2010-03-20 Thread waugust
On Mar 20, 10:40 am, waugust wrote: > On Mar 20, 10:25 am, Steven D'Aprano > cybersource.com.au> wrote: > > On Sat, 20 Mar 2010 10:00:47 -0700, waugust wrote: > > > I have 2.5 (for GAE), 2.6 (Ubuntu default), and 3.1 installed. Whenever > > > I apt-get install anything It ends with a series of py

Re: How to automate accessor definition?

2010-03-20 Thread Chris Rebert
On Sat, Mar 20, 2010 at 3:15 PM, kj wrote: > I need to create a class solely for the purpose of encapsulating > a large number of disparate data items.  At the moment I have no > plans for any methods for this class other than the bazillion > accessors required to access these various instance var

Re: Best Way to extract Numbers from String

2010-03-20 Thread Jimbo
On Mar 20, 11:51 pm, Luis M. González wrote: > On Mar 20, 12:04 am, Jimbo wrote: > > > > > > > Hello > > > I am trying to grab some numbers from a string containing HTML text. > > Can you suggest any good functions that I could use to do this? What > > would be the easiest way to extract the foll

[ANN] Pyspread 0.1 released

2010-03-20 Thread Martin Manns
Pyspread 0.1 released = After a long and eventful Alpha period, pyspread has finally reached Beta stage. I thank all contributors and testers who have helped getting pyspread to this point. About: -- Pyspread is a cross-platform Python spreadsheet application. It is bas

How to automate accessor definition?

2010-03-20 Thread kj
I need to create a class solely for the purpose of encapsulating a large number of disparate data items. At the moment I have no plans for any methods for this class other than the bazillion accessors required to access these various instance variables. (In case it matters, this class is mea

Re: How User-defined method objects are created?

2010-03-20 Thread Joaquin Abian
On Mar 20, 5:24 pm, Duncan Booth wrote: > Joaquin Abian wrote: > > "User-defined method objects may be created when getting an attribute > > of a class (perhaps via an instance of that class), if that attribute > > is a user-defined function object, an unbound user-defined method > > object, or a

Re: How User-defined method objects are created?

2010-03-20 Thread Joaquin Abian
On Mar 20, 5:39 pm, Terry Reedy wrote: > On 3/20/2010 9:54 AM, Joaquin Abian wrote: > > > > > I'm trying to understand the description of method object creation in > > the python 2.6 language reference (3.2. The standard type hierarchy) > > with little success. The points knocking me are: > > > "U

Re: "EURO GIRLS" "MISS EUROPE"

2010-03-20 Thread alex goretoy
On Sat, Mar 20, 2010 at 1:37 PM, D'Arcy J.M. Cain wrote: > aybe it's time to stop gatewaying the newsgroup to the mailing list. > As a test I have moved all Python posts from gmail.com with a > Newsgroup header into > ok thx, I'm learning as I go along -Alex Goretoy -- http://mail.python.org/ma

Re: "EURO GIRLS" "MISS EUROPE"

2010-03-20 Thread D'Arcy J.M. Cain
On Sat, 20 Mar 2010 12:55:26 -0600 alex goretoy wrote: > what do i do to remove this crap? how do i moderate it? First, please remove spam URLs when following up. You left them in the subject. Maybe it's time to stop gatewaying the newsgroup to the mailing list. As a test I have moved all Pytho

Re: "EURO GIRLS" "MISS EUROPE" "MISS FRENCH" "FRENCH" "PRETTY GIRLS" "SEXY FRENCH GIRLS" on www.sexyandpretty-girls.blogspot.com "SEXY RUSSIAN GIRLS" "SEXY GREEK GIRLS" "SEXY DUTCH GIRLS" "SEXY UK G

2010-03-20 Thread Brian J Mingus
Moderating this stuff requires moderating all messages. It would take a team of volunteers. On Sat, Mar 20, 2010 at 12:55 PM, alex goretoy wrote: > what do i do to remove this crap? how do i moderate it? > > why not gpg sign messages on python-list that way you know your authorized > to post and

Re: "EURO GIRLS" "MISS EUROPE" "MISS FRENCH" "FRENCH" "PRETTY GIRLS" "SEXY FRENCH GIRLS" on www.sexyandpretty-girls.blogspot.com "SEXY RUSSIAN GIRLS" "SEXY GREEK GIRLS" "SEXY DUTCH GIRLS" "SEXY UK G

2010-03-20 Thread alex goretoy
what do i do to remove this crap? how do i moderate it? why not gpg sign messages on python-list that way you know your authorized to post and spammers will have one more vector to deal with, there in stopping the not so leet -Alex Goretoy -- http://mail.python.org/mailman/listinfo/python-list

"JOBS IN FINLAND" "JOBS FINLAND" "FINLAND JOBS" "ACCOUNTS JOBS IN FINLAND" "FINANCE JOBS IN FINLAND" "AGRI JPBS IN FINLAND" "MEDICAL JOBS IN FINLAND" ON JOBS http://jobs-in-finland.blogspot.c

2010-03-20 Thread saima81
"JOBS IN FINLAND" "JOBS FINLAND" "FINLAND JOBS" "ACCOUNTS JOBS IN FINLAND" "FINANCE JOBS IN FINLAND" "AGRI JPBS IN FINLAND" "MEDICAL JOBS IN FINLAND" ON JOBS http://jobs-in-finland.blogspot.com/ "JOBS IN FINLAND" "JOBS FINLAND" "FINLAND JOBS" "ACCOUNTS JOBS IN FINLAND" "FINANCE JOBS IN FINL

Re: Ubuntu install problems

2010-03-20 Thread waugust
On Mar 20, 10:25 am, Steven D'Aprano wrote: > On Sat, 20 Mar 2010 10:00:47 -0700, waugust wrote: > > I have 2.5 (for GAE), 2.6 (Ubuntu default), and 3.1 installed. Whenever > > I apt-get install anything It ends with a series of python (dependency?) > > errors.  Anybody got any idea? > > It looks

Re: Ubuntu install problems

2010-03-20 Thread Steven D'Aprano
On Sat, 20 Mar 2010 10:00:47 -0700, waugust wrote: > I have 2.5 (for GAE), 2.6 (Ubuntu default), and 3.1 installed. Whenever > I apt-get install anything It ends with a series of python (dependency?) > errors. Anybody got any idea? It looks like apt-get is supposed to be using 2.6 or 2.5, but so

Re: Ubuntu install problems

2010-03-20 Thread MRAB
waugust wrote: I have 2.5 (for GAE), 2.6 (Ubuntu default), and 3.1 installed. Whenever I apt-get install anything It ends with a series of python (dependency?) errors. Anybody got any idea? aptget libgcj-common Reading package lists... Done Building dependency tree Reading state information...

Re: Reverse engineering CRC?

2010-03-20 Thread Aahz
In article <4b9e0c1f.9020...@canterbury.ac.nz>, Gregory Ewing wrote: > >It turned out to be a very standard CRC algorithm, complicated >by the presence of a few extra bytes of data being checked that >didn't appear explicitly in the file anywhere. > >In the process I developed some very general t

Re: Ubuntu install problems

2010-03-20 Thread Benjamin Kaplan
On Sat, Mar 20, 2010 at 1:00 PM, waugust wrote: > I have 2.5 (for GAE), 2.6 (Ubuntu default), and 3.1 installed. > Whenever I apt-get install anything It ends with a series of python > (dependency?) errors. Anybody got any idea? > > aptget libgcj-common > Reading package lists... > Done > Buildi

Re: why is there now execption for windows? trying to listen twice to the same port

2010-03-20 Thread News123
Terry Reedy wrote: > On 3/20/2010 10:52 AM, News123 wrote: >> Hi Irmen, >> >> >> Irmen de Jong wrote: >>> On 20-3-2010 14:38, News123 wrote: I'm having a small multiprocessing manager: # ## import socket,sys from multiprocessing.managers import BaseM

Ubuntu install problems

2010-03-20 Thread waugust
I have 2.5 (for GAE), 2.6 (Ubuntu default), and 3.1 installed. Whenever I apt-get install anything It ends with a series of python (dependency?) errors. Anybody got any idea? > aptget libgcj-common Reading package lists... Done Building dependency tree Reading state information... Done libgcj-comm

Re: How User-defined method objects are created?

2010-03-20 Thread Terry Reedy
On 3/20/2010 9:54 AM, Joaquin Abian wrote: I'm trying to understand the description of method object creation in the python 2.6 language reference (3.2. The standard type hierarchy) with little success. The points knocking me are: "User-defined method objects may be created when getting an attri

Re: why is there now execption for windows? trying to listen twice to the same port

2010-03-20 Thread Terry Reedy
On 3/20/2010 10:52 AM, News123 wrote: Hi Irmen, Irmen de Jong wrote: On 20-3-2010 14:38, News123 wrote: I'm having a small multiprocessing manager: # ## import socket,sys from multiprocessing.managers import BaseManager mngr = BaseManager(address=('127.0.0.1',8089),a

Re: How User-defined method objects are created?

2010-03-20 Thread Duncan Booth
Joaquin Abian wrote: > "User-defined method objects may be created when getting an attribute > of a class (perhaps via an instance of that class), if that attribute > is a user-defined function object, an unbound user-defined method > object, or a class method object. When the attribute is a user

Re: why is there now execption for windows? trying to listen twice to the same port

2010-03-20 Thread News123
Hi Irmen, Irmen de Jong wrote: > On 20-3-2010 14:38, News123 wrote: >> I'm having a small multiprocessing manager: >> >> # ## >> import socket,sys >> from multiprocessing.managers import BaseManager >> >> mngr = BaseManager(address=('127.0.0.1',8089),authkey='verysecret')

Re: accessing variable of the __main__ module

2010-03-20 Thread Dave Angel
News123 wrote: Steven D'Aprano wrote: Now, in your case you escape that trap, because the import is inside a function, so it doesn't occur until you call the function. But it is still considered poor practice: it is best to avoid circular imports unless you really, really need them. T

Re: why is there now execption for windows? trying to listen twice to the same port

2010-03-20 Thread Irmen de Jong
On 20-3-2010 14:38, News123 wrote: I'm having a small multiprocessing manager: # ## import socket,sys from multiprocessing.managers import BaseManager mngr = BaseManager(address=('127.0.0.1',8089),authkey='verysecret') try: srvr = mngr.get_server() except socket.err

Re: accessing variable of the __main__ module

2010-03-20 Thread Steven D'Aprano
On Sat, 20 Mar 2010 14:32:03 +0100, News123 wrote: >> You try to import from "__main__", but the other module is called >> "main". __main__ is a special name, which Python understands as meaning >> "this module that you are in now". For example: > > My choice of names was perhaps not very smart. I

How User-defined method objects are created?

2010-03-20 Thread Joaquin Abian
I'm trying to understand the description of method object creation in the python 2.6 language reference (3.2. The standard type hierarchy) with little success. The points knocking me are: "User-defined method objects may be created when getting an attribute of a class (perhaps via an instance of t

why is there now execption for windows? trying to listen twice to the same port

2010-03-20 Thread News123
I'm having a small multiprocessing manager: # ## import socket,sys from multiprocessing.managers import BaseManager mngr = BaseManager(address=('127.0.0.1',8089),authkey='verysecret') try: srvr = mngr.get_server() except socket.error as e: print "probably address a

Re: accessing variable of the __main__ module

2010-03-20 Thread News123
Hi Steven, Steven D'Aprano wrote: > On Sat, 20 Mar 2010 13:16:08 +0100, News123 wrote: > >> Hi, >> >> >> I wondered about the best way, that a module's function could determine >> the existance and value of variables in the __main__ module. >> >> >> What I came up with is: >> ###

Re: accessing variable of the __main__ module

2010-03-20 Thread Steven D'Aprano
On Sat, 20 Mar 2010 13:16:08 +0100, News123 wrote: > Hi, > > > I wondered about the best way, that a module's function could determine > the existance and value of variables in the __main__ module. > > > What I came up with is: > ### main.py ## > import mod > A = 4 > if __name

Re: Best Way to extract Numbers from String

2010-03-20 Thread Luis M . González
On Mar 20, 12:04 am, Jimbo wrote: > Hello > > I am trying to grab some numbers from a string containing HTML text. > Can you suggest any good functions that I could use to do this? What > would be the easiest way to extract the following numbers from this > string... > > My String has this layout

Re: accessing variable of the __main__ module

2010-03-20 Thread Alf P. Steinbach
* News123: I wondered about the best way, that a module's function could determine the existance and value of variables in the __main__ module. What I came up with is: ### main.py ## import mod A = 4 if __name__ == "__main__": mod.f() ### mod.py ## def f():

Re: (updated) Choosing a collection of common modules/packages for a general purpose reusable PY2EXE runtime

2010-03-20 Thread python
Aahz, >> We've decided to build a re-usable *general purpose* PY2EXE "runtime" >> that can be shared by a number of scripts vs. distributing a monolithic >> EXE for each of our scripts. > It's not clear what the purpose of this is. You can build several > scripts against the same py2exe backend.

accessing variable of the __main__ module

2010-03-20 Thread News123
Hi, I wondered about the best way, that a module's function could determine the existance and value of variables in the __main__ module. What I came up with is: ### main.py ## import mod A = 4 if __name__ == "__main__": mod.f() ### mod.py ## def f(): try:

Precedence of py, pyd, so, egg, and folder modules/packages when importing

2010-03-20 Thread Pascal Chambon
Hello, I've run into a slight issue when turning my package hierarchy into a parallel hierarchy of compiled cython extensions. Fue to the compilation process, pure python and C modules must have the basename, and they're located in the same folders. Is there any way for me to ensure that, if

Re: Writing tests for the Python bug tracker

2010-03-20 Thread Mark Dickinson
On Mar 20, 6:52 am, Steven D'Aprano wrote: > I've found this: > > http://docs.python.org/library/test.html > > and I've written a small test: > > $ cat test_unicode_interpolation.py > # For testinghttp://bugs.python.org/issue8128 > > import test.test_support > import unittest > > class K(unicode):

Re: Writing tests for the Python bug tracker

2010-03-20 Thread Mark Dickinson
On Mar 20, 6:23 am, Steven D'Aprano wrote: > I have two reported bugs in the bug tracker waiting on tests: > > http://bugs.python.org/issue8128http://bugs.python.org/issue4037 > > Are there any guidelines for writing tests for the standard library and > language? Not that I can think of, beyond t

Re: google token

2010-03-20 Thread Steven D'Aprano
On Sat, 20 Mar 2010 09:17:14 +, Thufir wrote: > I'd like to acquire a token, as below, but from Java: Perhaps you should be asking a Java discussion group? This group is for discussing Python. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing tests for the Python bug tracker

2010-03-20 Thread Steven D'Aprano
On Sat, 20 Mar 2010 07:07:58 +, exarkun wrote: >>What am I doing wrong? > > Take a careful look at the stack being reported. Then, think of a > better name than "test" for your file. Doh! *face-palm* I was shadowing the test package with a long forgotten test module. -- Steven -- http:

Re: C-API PyObject_Call

2010-03-20 Thread Stefan Behnel
moerchendiser2k3, 20.03.2010 03:01: Yes, the user is able to set a file which contains a function that does what the user wants. > But in a case, I expect a special return value of this function. Ah, ok, that was the important piece of information that you omitted from your previous posts. So

google token

2010-03-20 Thread Thufir
I'd like to acquire a token, as below, but from Java: def get_token(self,force=False) : '''Return a tokey. A token is a special string that is used like a session identification, but that expire rather quickly.''' if ( force or (self._token == None) ) : feedurl =

Re: logging: local functions ==> loss of lineno

2010-03-20 Thread Peter Otten
Jean-Michel Pichavant wrote: > You are still accessing the private attribute of the module logging. Just reading it is a significantly more conservative approach than setting it to an object with an unusual notion of equality ;) > My previous remark was misleading, in fact there's nothing you

Re: to pass self or not to pass self

2010-03-20 Thread Gregory Ewing
Patrick Maupin wrote: Actually, I think I overstated my case -- there is some special logic for len and built-in objects, I think. Yes, len() invokes the C-level sq_len slot of the type object, which for built-in types points directly to the C function implementing the len() operation for that

Re: Writing tests for the Python bug tracker

2010-03-20 Thread exarkun
On 06:52 am, st...@remove-this-cybersource.com.au wrote: but when I try running the test, I get an error: $ python test_unicode_interpolation.py Options: {'delimiter': None} str of options.delimiter = None repr of options.delimiter = None len of options.delimiter Traceback (most recent call las