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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.com/
"JOBS IN FINLAND" "JOBS FINLAND" "FINLAND JOBS" "ACCOUNTS JOBS IN
FINLAND" "FINANCE JOBS IN FINL
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
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
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...
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
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
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
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
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
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
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
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')
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
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
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
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
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
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:
>> ###
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
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
* 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():
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.
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:
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
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):
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
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
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:
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
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 =
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
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
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
48 matches
Mail list logo