Re: Class extension confusion :(

2010-11-11 Thread Peter Otten
r0g wrote: > On 10/11/10 09:52, Peter Otten wrote: >> r0g wrote: >> >>> I have a subclass of BaseHHTPRequestHandler which uses a dictonary >>> "paths" and a function "api_call" which are defined in the main >>> namespace of the module. I'd rather I was able to pass these object to >>> the construc

Re: Is Eval *always* Evil?

2010-11-11 Thread John Nagle
On 11/10/2010 6:39 PM, Robert Kern wrote: On 2010-11-10 17:14 , Christian Heimes wrote: Am 10.11.2010 18:56, schrieb Simon Mullis: Yes, eval is evil, may lead to security issues and it's unnecessary slow, too. If you have to use "eval", use the 2 or 3 argument form with a "globals" and "lo

Re: Is Eval *always* Evil?

2010-11-11 Thread Paul Rudin
Robert Kern writes: > On 2010-11-10 17:14 , Christian Heimes wrote: >> Am 10.11.2010 18:56, schrieb Simon Mullis: >> >> Yes, eval is evil, may lead to security issues and it's unnecessary >> slow, too. Still - it is used in the standard library... -- http://mail.python.org/mailman/listinfo/pyth

Re: Questions: While And List Comprehension

2010-11-11 Thread Peter Otten
James Mills wrote: > On Thu, Nov 11, 2010 at 11:01 AM, alex23 wrote: >> +1 on this approach. Clear and obvious and not reliant on any library >> modules other than sys. >> >> itertools, what WAS I thinking? :) > > maybe: > > import sys > from itertools import islice > > print [v for v in islic

Re: How convert list to nested dictionary?

2010-11-11 Thread Alexander Gattin
Hello, On Thu, Nov 04, 2010 at 02:10:12PM -0700, macm wrote: > > > How convert list to nested dictionary? > > > > l > > > ['k1', 'k2', 'k3', 'k4', 'k5'] > > result > > > {'k1': {'k2': {'k3': {'k4': {'k5': {}} > > http://www.amk.ca/python/writing/functional so, why didn't you try pyt

Re: Class extension confusion :(

2010-11-11 Thread r0g
On 10/11/10 09:52, Peter Otten wrote: class PlainAJAXRequestHandler(BaseHTTPRequestHandler): def __init__(self, api_call, paths, *args, **kw): BaseHTTPRequestHandler.__init__(self, *args, **kw) self.api_call = api_call self.paths = paths Hmm, the plot thickens!

Re: Is Eval *always* Evil?

2010-11-11 Thread Simon Mullis
On 11 November 2010 09:07, John Nagle wrote: >>> Am 10.11.2010 18:56, schrieb Simon Mullis: >>> Yes, eval is evil, may lead to security issues and it's unnecessary >>> slow, too. > >   If you have to use "eval", use the 2 or 3 argument form with a > "globals" and "locals" dictionary.  This lists t

Re: Class extension confusion :(

2010-11-11 Thread Peter Otten
r0g wrote: > On 10/11/10 09:52, Peter Otten wrote: >> class PlainAJAXRequestHandler(BaseHTTPRequestHandler): >> def __init__(self, api_call, paths, *args, **kw): >> BaseHTTPRequestHandler.__init__(self, *args, **kw) >> self.api_call = api_call >> self.paths = paths

Re: Questions: While And List Comprehension

2010-11-11 Thread Felipe Vinturini
On Thu, Nov 11, 2010 at 6:10 AM, Peter Otten <[email protected]> wrote: > James Mills wrote: > > > On Thu, Nov 11, 2010 at 11:01 AM, alex23 wrote: > >> +1 on this approach. Clear and obvious and not reliant on any library > >> modules other than sys. > >> > >> itertools, what WAS I thinking? :) >

Re: Questions: While And List Comprehension

2010-11-11 Thread James Mills
On Thu, Nov 11, 2010 at 6:10 PM, Peter Otten <[email protected]> wrote: > (line for line in sys.stdin) > > and sys.stdin are equivalent as are > > [v for v in items] > > and list(items) > > So > > print list(islice(sys.stdin, 5)) I was being a little verbose ... But I like your simplification :) c

Re: Enumeration of strings and export of the constants

2010-11-11 Thread lnenov
On 11/11/2010 01:30 AM, Ian wrote: On Nov 10, 6:12 am, lnenov wrote: Is there a better and more common way to do this? from itertools import count, izip class APINamespace(object): def __init__(self): self._named_values = [] def enumerate(self, names, start=0, step=1):

Re: Enumeration of strings and export of the constants

2010-11-11 Thread lnenov
On 11/10/2010 11:19 PM, Emile van Sebille wrote: On 11/10/2010 5:12 AM lnenov said... Hi, I need to enumerate a couple hundred strings to constants and export them to another module(s) globals. Do they really need to be globals? Why not a constants in an object/container that would neither

Re: Learning Pyhton - Functional Programming - How intersect/difference two dict with dict/values? fast!

2010-11-11 Thread Alexander Gattin
Hello, On Tue, Nov 09, 2010 at 09:32:17AM -0800, macm wrote: > dict1 = {'ab':[[1,2,3,'d3','d4',5],12],'ac':[[1,3,'78a','79b'], > 54],'ad': [[56,57,58,59],34], 'ax': [[56,57,58,59],34]} > dict2 = {'ab':[[22,2,'a0','42s','c4','d3'],12],'ab':[[2,4,50,42,'c4'], > 12],'ac':[[1,3,'79b',45,65,'er4'],54],

Re: Learning Pyhton - Functional Programming - How intersect/difference two dict with dict/values? fast!

2010-11-11 Thread Alexander Gattin
On Thu, Nov 11, 2010 at 11:51:33AM +0200, Alexander Gattin wrote: > functional-style code emerges: > > > >>> dict(filter(lambda t: t[1], > > ... map(lambda k: (k, filter(lambda v: v in dict2[k][0], dict1[k][0])), > > ...filter(dict2.has_key, dict1.iterkeys())) > > ...) > > ...

Re: multiple discontinued ranges

2010-11-11 Thread [email protected]
On Nov 10, 10:02 am, Mel wrote: > xoff wrote: > > I was wondering what the best method was in Python programming for 2 > > discontinued ranges. e.g. I want to use the range 3 to 7 and 17 to 23. > > Am I obliged to use 2 for loops defining the 2 ranges like this: > > > for i in range (3,7): > > do

Open Multiples Files at same time with multiprocessing - How "declare" dynamically the var?

2010-11-11 Thread macm
Hi Folks My approach to open multiples files at same time is: def openFiles(self,file,q): fp = open(file, 'rb') fp.seek(0) fcontent = fp.read() fp.close() q.put(fcontent) return def testOpen(self): L = ['file1.txt','file2.txt','file

Re: How to test if a module exists?

2010-11-11 Thread Mark Wooding
r0g writes: > Really? I get a metric butt-ton of spam every day to this address. I'm sure I get sent a lot of spam (though I don't know for sure -- see below). But I don't think much of it comes from Usenet harvesters any more. > Right now it simply filtered by address straight into my recycle

strange problem with multiprocessing

2010-11-11 Thread Neal Becker
Any idea what this could be about? Traceback (most recent call last): File "run-tests-1004.py", line 48, in results = pool.map (run_test, cases) File "/usr/lib64/python2.7/multiprocessing/pool.py", line 199, in map return self.map_async(func, iterable, chunksize).get() File "/us

Re: Commercial or Famous Applicattions.?

2010-11-11 Thread Martin Gregorie
On Wed, 10 Nov 2010 16:58:06 -0800, alex23 wrote: > Martin Gregorie wrote: >> Now, if ESR had fixed fetchmail [...] > > Did you try submitting patches? Nope. I'd already seen comments that bug reports etc. are ignored and tried getmail. Since that does the needful, why should I bother? -- m

Re: strange problem with multiprocessing

2010-11-11 Thread Marc Christiansen
Neal Becker wrote: > Any idea what this could be about? > > Traceback (most recent call last): > File "run-tests-1004.py", line 48, in >results = pool.map (run_test, cases) > File "/usr/lib64/python2.7/multiprocessing/pool.py", line 199, in map >return self.map_async(func, iterable

Re: A matter of queues, tasks and multiprocessing

2010-11-11 Thread Emanuele D'Arrigo
On Nov 10, 9:19 pm, "[email protected]" wrote: > If you are using Python 2.6 or greater, look into the multiprocessing > module. It may contain 90% of what you need. Thank you Dan, indeed the multi-processing module has been my first port of call and indeed it has all the basic ingredients. Wh

Re: A matter of queues, tasks and multiprocessing

2010-11-11 Thread Tim Golden
On 11/11/2010 14:04, Emanuele D'Arrigo wrote: On Nov 10, 9:19 pm, "[email protected]" wrote: If you are using Python 2.6 or greater, look into the multiprocessing module. It may contain 90% of what you need. Thank you Dan, indeed the multi-processing module has been my first port of call an

is there an Python equivalent for the PHP super globals like $_POST, $_COOKIE ?

2010-11-11 Thread Stef Mientki
hello, finally got Python running at my server. Now I would like to replace the PHP server scripts with Python ( for easier maintenance). But I can't find how th get to PHP's equivalent of $_Post and $_Cookie ? Google finds lots of links, but I can't find the answer. thanks, Stef Mientki -- h

How do I skip over multiple words in a file?

2010-11-11 Thread chad
Let's say that I have an article. What I want to do is read in this file and have the program skip over ever instance of the words "the", "and", "or", and "but". What would be the general strategy for attacking a problem like this? -- http://mail.python.org/mailman/listinfo/python-list

Re: Ways of accessing this mailing list?

2010-11-11 Thread Jonathan Hartley
On Nov 3, 9:27 pm, Ben Finney wrote: > Grant Edwards writes: > > On 2010-11-02, John Bond wrote: > > > My normal inbox is getting unmanageable, and I think I need to find > > > a new way of following this and other lists. > > > Point an NNTP client at new.gmane.org. > > Ditto, but the correct ho

Re: How do I skip over multiple words in a file?

2010-11-11 Thread Tim Chase
On 11/11/10 09:07, chad wrote: Let's say that I have an article. What I want to do is read in this file and have the program skip over ever instance of the words "the", "and", "or", and "but". What would be the general strategy for attacking a problem like this? I'd keep a file of "stop words"

Re: udp sockets with python

2010-11-11 Thread Jean-Paul Calderone
On Nov 10, 9:23 pm, Tim Roberts wrote: > Mag Gam wrote: > > >I am measuring the round trip time using tcpdump. The C version is > >giving me around 80 microseconds (average) and the python is giving me > >close to 300 microseconds (average). > > If you need the performance of a compiled language,

Re: Looping through files in a directory

2010-11-11 Thread fuglyducky
On Nov 10, 4:14 pm, James Mills wrote: > On Thu, Nov 11, 2010 at 8:46 AM, Matty Sarro wrote: > > Short story - I have a few thousand files in a directory I need to parse > > through. Is there a simple way to loop through files? I'd like to avoid > > writing a python script that can parse 1 file,

Re: Open Multiples Files at same time with multiprocessing - How "declare" dynamically the var?

2010-11-11 Thread Ian Kelly
On 11/11/2010 4:28 AM, macm wrote: def openFiles(self,file,q): fp = open(file, 'rb') fp.seek(0) The seek is unnecessary; the file will already be at position 0 after it is opened. def testOpen(self): L = ['file1.txt','file2.txt','file3.txt','file4.txt','

Question on using urllib

2010-11-11 Thread Olivier Scalbert
Hello all, Sorry if this question is not 100% python related, it is also related to http or html ... Everything takes place in this page: http://www.infometeo.be/klanten/KYC/campage2mega.php With the following program, I can download the 2 small meteo images, without any problem: import urllib

Re: ANN: PyGUI 2.3

2010-11-11 Thread Daniel Fetchinson
>> The problem is that some part of the application gets installed to >> >> /home/fetchinson/.local/lib/python2.6/site-packages/GUI >> >> and some other parts get installed to >> >> /home/fetchinson/.local/lib/python/site-packages/GUI > > Which parts get installed in which places, exactly? This ge

Re: Question on using urllib

2010-11-11 Thread Peter Otten
Olivier Scalbert wrote: > Sorry if this question is not 100% python related, it is also related to > http or html ... > > Everything takes place in this page: > http://www.infometeo.be/klanten/KYC/campage2mega.php > > With the following program, I can download the 2 small meteo images, > without

Re: is there an Python equivalent for the PHP super globals like $_POST, $_COOKIE ?

2010-11-11 Thread Steve Holden
On 11/11/2010 9:22 AM, Stef Mientki wrote: > hello, > > finally got Python running at my server. > > Now I would like to replace the PHP server scripts with Python ( for easier > maintenance). > > But I can't find how th get to PHP's equivalent of $_Post and $_Cookie ? > Google finds lots of li

Re: Am I The Only One Who Keeps Reading “Numpy” as “Numpty”?

2010-11-11 Thread rantingrick
On Nov 10, 5:35 pm, Arnaud Delobelle wrote: > So pypy is "pie-pee", not "pie-pie" or "pee-pee".  With that edifying > thought, I'm off to bed. :) Good catch! Actually i've always thought of pypi as pie-pie and Scipy as cy-pie. Num-pie does not work for me. Maybe some linguist could chime in an

Re: is there an Python equivalent for the PHP super globals like $_POST, $_COOKIE ?

2010-11-11 Thread Stef Mientki
On 11-11-2010 19:01, Steve Holden wrote: > On 11/11/2010 9:22 AM, Stef Mientki wrote: >> hello, >> >> finally got Python running at my server. >> >> Now I would like to replace the PHP server scripts with Python ( for easier >> maintenance). >> >> But I can't find how th get to PHP's equivalent of

Re: Question on using urllib

2010-11-11 Thread Olivier Scalbert
On 11/11/2010 06:37 PM, Peter Otten wrote: > The problem is indeed not Python-related. The provider of the images doesn't > like what you're trying to do and verifies the referer, i. e. that the page > you claim to be coming from is acceptable. Here's one way to satisfy that > check: > fr

Re: Silly newbie question - Caret character (^)

2010-11-11 Thread Seebs
(Note followups, this has stopped being very Pythony.) On 2010-11-11, Lawrence D'Oliveiro wrote: > Another function that should be deprecated is strncat???I myself was caught > out misunderstanding it recently. What purpose does it serve? I'm wondering if you're thinking of strncpy(), which is

os.tmpfile() vs. tempfile.TemporaryFile()

2010-11-11 Thread John Nagle
Is there any reason to prefer "tempfile.TemporaryFile()" over "os.tmpfile()"? Both create a nameless temporary file that will be deleted on close. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: os.tmpfile() vs. tempfile.TemporaryFile()

2010-11-11 Thread [email protected]
On Nov 11, 11:32 am, John Nagle wrote: >    Is there any reason to prefer "tempfile.TemporaryFile()" > over "os.tmpfile()"?  Both create a nameless temporary file > that will be deleted on close. > >                                 John Nagle tempfile.TemporaryFile has more options, e.g. file pre

Re: is there an Python equivalent for the PHP super globals like $_POST, $_COOKIE ?

2010-11-11 Thread david wright
From: Stef Mientki To: [email protected] Sent: Thu, November 11, 2010 10:20:03 AM Subject: Re: is there an Python equivalent for the PHP super globals like $_POST, $_COOKIE ? On 11-11-2010 19:01, Steve Holden wrote: > On 11/11/2010 9:22 AM, Stef Mientki

Re: is there an Python equivalent for the PHP super globals like $_POST, $_COOKIE ?

2010-11-11 Thread Stef Mientki
On 11-11-2010 19:36, david wright wrote: > > > *From:* Stef Mientki > *To:* [email protected] > *Sent:* Thu, November 11, 2010 10:20:03 AM > *Subject:* Re: is there an Python equivalent for th

ANNOUNCE: NHI1-0.9, PLMK-1.7 und libmsgque-4.7

2010-11-11 Thread Andreas Otto
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dear User, ANNOUNCE:Major Feature Release libmsgque: Application-Server-Toolkit for C, C++, JAVA, C#, TCL, PERL, PHP, PYTHON, RUBY, VB.NET PLMK: Programming-Language-Microkernel NHI1:

Re: Class extension confusion :(

2010-11-11 Thread r0g
On 11/11/10 09:34, Peter Otten wrote: r0g wrote: Question B) The only reason I can think of so far is that I don't have a clear picture of how those names came to end up in that scope, it seems very convenient but I'm worried it's black magic of some sort! Could anyone explain or point me to th

Re: How to test if a module exists?

2010-11-11 Thread r0g
On 11/11/10 11:28, Mark Wooding wrote: r0g writes: Really? I get a metric butt-ton of spam every day to this address. I'm sure I get sent a lot of spam (though I don't know for sure -- see below). But I don't think much of it comes from Usenet harvesters any more. Right now it simply filt

Re: How to test if a module exists?

2010-11-11 Thread Lawrence D'Oliveiro
In message , Jon Dufresne wrote: > On Wed, Nov 10, 2010 at 1:50 AM, Lawrence D'Oliveiro wrote: > >> In message , Jon >> Dufresne wrote: >> >>> On Mon, Nov 8, 2010 at 11:35 PM, Lawrence D'Oliveiro ... >> >> I see that you published my unobfuscated e-mail address on USENET for all >> to see. I obfu

Re: is there an Python equivalent for the PHP super globals like $_POST, $_COOKIE ?

2010-11-11 Thread r0g
On 11/11/10 14:22, Stef Mientki wrote: hello, finally got Python running at my server. Now I would like to replace the PHP server scripts with Python ( for easier maintenance). But I can't find how th get to PHP's equivalent of $_Post and $_Cookie ? Google finds lots of links, but I can't fin

please subscribe me to the list

2010-11-11 Thread Ryszard Czermiński
Thanks! Ryszard -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I skip over multiple words in a file?

2010-11-11 Thread r0g
On 11/11/10 15:07, chad wrote: Let's say that I have an article. What I want to do is read in this file and have the program skip over ever instance of the words "the", "and", "or", and "but". What would be the general strategy for attacking a problem like this? If your files are not too big

Re: udp sockets with python

2010-11-11 Thread r0g
On 11/11/10 16:03, Jean-Paul Calderone wrote: On Nov 10, 9:23 pm, Tim Roberts wrote: Mag Gam wrote: I am measuring the round trip time using tcpdump. The C version is giving me around 80 microseconds (average) and the python is giving me close to 300 microseconds (average). If you need the

Re: is there an Python equivalent for the PHP super globals like $_POST, $_COOKIE ?

2010-11-11 Thread Paul Watson
On 2010-11-11 11:20, Stef Mientki wrote: On 11-11-2010 19:01, Steve Holden wrote: On 11/11/2010 9:22 AM, Stef Mientki wrote: hello, finally got Python running at my server. Now I would like to replace the PHP server scripts with Python ( for easier maintenance). But I can't find how th get

Re: is there an Python equivalent for the PHP super globals like $_POST, $_COOKIE ?

2010-11-11 Thread r0g
On 11/11/10 18:01, Steve Holden wrote: On 11/11/2010 9:22 AM, Stef Mientki wrote: hello, finally got Python running at my server. Now I would like to replace the PHP server scripts with Python ( for easier maintenance). But I can't find how th get to PHP's equivalent of $_Post and $_Cookie ?

Re: please subscribe me to the list

2010-11-11 Thread MRAB
On 11/11/2010 20:08, Ryszard Czermiński wrote: Thanks! Ryszard What don't you do it yourself? Go to: http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list

Copy Protected PDFs and PIL

2010-11-11 Thread Brett Bowman
I'm trying to parse some basic details and a thumbnail from ~12,000 PDFs for my company, but a few hundred of them are copy protected. To make matters worse, I can't seem to trap the error it causes: whenever it happens PIL throws a "FATAL PDF disallows copying" message and dies. An automated way

Re: How to test if a module exists?

2010-11-11 Thread Lawrence D'Oliveiro
In message , Tim Chase wrote: > Amusingly, as others have noted, you replied with an unobfuscated > email address. This would seem to be an independent, true record of what members of python-list would see of my posting,

Re: How do I skip over multiple words in a file?

2010-11-11 Thread Paul Watson
On 2010-11-11 08:07, chad wrote: Let's say that I have an article. What I want to do is read in this file and have the program skip over ever instance of the words "the", "and", "or", and "but". What would be the general strategy for attacking a problem like this? I realize that you may need o

Re: How to test if a module exists?

2010-11-11 Thread Tim Chase
On 11/11/10 13:49, Lawrence D'Oliveiro wrote: Is this for real? I did a "replay all" to respond to your post. What are you suggesting? I don't see anything that looks like an obfuscated email. Tell me what you see here, for example

Re: is there an Python equivalent for the PHP super globals like $_POST, $_COOKIE ?

2010-11-11 Thread Steve Holden
On 11/11/2010 3:23 PM, r0g wrote: > On 11/11/10 18:01, Steve Holden wrote: >> On 11/11/2010 9:22 AM, Stef Mientki wrote: >>> hello, >>> >>> finally got Python running at my server. >>> >>> Now I would like to replace the PHP server scripts with Python ( for >>> easier maintenance). >>> >>> But I ca

Re: How do I skip over multiple words in a file?

2010-11-11 Thread Paul Rubin
chad writes: > Let's say that I have an article. What I want to do is read in this > file and have the program skip over ever instance of the words "the", > "and", "or", and "but". What would be the general strategy for > attacking a problem like this? Something like (untested): stopwords

Re: Copy Protected PDFs and PIL

2010-11-11 Thread Philip Semanchuk
On Nov 11, 2010, at 3:28 PM, Brett Bowman wrote: > I'm trying to parse some basic details and a thumbnail from ~12,000 PDFs for > my company, but a few hundred of them are copy protected. To make matters > worse, I can't seem to trap the error it causes: whenever it happens PIL > throws a "FATAL

Re: How to test if a module exists?

2010-11-11 Thread Ethan Furman
Lawrence D'Oliveiro wrote: In message , Tim Chase wrote: Amusingly, as others have noted, you replied with an unobfuscated email address. This would seem to be an independent, true record of what members of python-lis

Re: How to test if a module exists?

2010-11-11 Thread Steve Holden
On 11/11/2010 3:26 PM, Lawrence D'Oliveiro wrote: > In message , Tim Chase > wrote: > >> Amusingly, as others have noted, you replied with an unobfuscated >> email address. > > This > > would seem to be an independent, tr

Re: Copy Protected PDFs and PIL

2010-11-11 Thread MRAB
On 11/11/2010 20:28, Brett Bowman wrote: I'm trying to parse some basic details and a thumbnail from ~12,000 PDFs for my company, but a few hundred of them are copy protected. To make matters worse, I can't seem to trap the error it causes: whenever it happens PIL throws a "FATAL PDF disallows c

Re: Copy Protected PDFs and PIL

2010-11-11 Thread Steve Holden
On 11/11/2010 3:28 PM, Brett Bowman wrote: > I'm trying to parse some basic details and a thumbnail from ~12,000 PDFs > for my company, but a few hundred of them are copy protected. To make > matters worse, I can't seem to trap the error it causes: whenever it > happens PIL throws a "FATAL PDF dis

Re: How to test if a module exists?

2010-11-11 Thread r0g
On 11/11/10 20:26, Lawrence D'Oliveiro wrote: In message, Tim Chase wrote: Amusingly, as others have noted, you replied with an unobfuscated email address. This would seem to be an independent, true record of what membe

Re: How to test if a module exists?

2010-11-11 Thread Ian
On Nov 11, 1:26 pm, Lawrence D'Oliveiro wrote: > In message , Tim Chase > wrote: > > > Amusingly, as others have noted, you replied with an unobfuscated > > email address. > > This > > would seem to be an independent, true r

returning results from function

2010-11-11 Thread Neil Berg
Hi Python community, In a main script, I pass the year (yr), month (mo), day (dy) and hour(hr) into the utc_to_local function (pasted below) which converts that date and time into local standard time. I am passing several dates and times into this function and would like to work with the "retu

Re: How to test if a module exists?

2010-11-11 Thread Emile van Sebille
I'm using thunderbird via gmane and see the sender shown as [email protected] -- so, no lies -- you've been self-outed. Emile -- http://mail.python.org/mailman/listinfo/python-list

Re: Class extension confusion :(

2010-11-11 Thread r0g
On 11/11/10 19:34, r0g wrote: On 11/11/10 09:34, Peter Otten wrote: r0g wrote: If I understand correctly it may also be possible (and more efficient) to use setattr() to inject the parameters I want into the class as class attributes before use, rather than assigning them to data attributes eve

Re: How to test if a module exists?

2010-11-11 Thread MRAB
On 11/11/2010 20:26, Lawrence D'Oliveiro wrote: In message, Tim Chase wrote: Amusingly, as others have noted, you replied with an unobfuscated email address. This would seem to be an independent, true record of what mem

Re: Copy Protected PDFs and PIL

2010-11-11 Thread Emile van Sebille
On 11/11/2010 12:28 PM Brett Bowman said... I'm trying to parse some basic details and a thumbnail from ~12,000 PDFs for my company, but a few hundred of them are copy protected. To make matters worse, I can't seem to trap the error it causes: whenever it happens PIL throws a "FATAL PDF disallow

Re: Copy Protected PDFs and PIL

2010-11-11 Thread Brett Bowman
Windows currently, though I also have a Linux box running Ubuntu if need be. On Thu, Nov 11, 2010 at 12:28 PM, Brett Bowman wrote: > I'm trying to parse some basic details and a thumbnail from ~12,000 PDFs > for my company, but a few hundred of them are copy protected. To make > matters worse,

Re: How do I skip over multiple words in a file?

2010-11-11 Thread Stefan Sonnenberg-Carstens
Am 11.11.2010 21:33, schrieb Paul Watson: On 2010-11-11 08:07, chad wrote: Let's say that I have an article. What I want to do is read in this file and have the program skip over ever instance of the words "the", "and", "or", and "but". What would be the general strategy for attacking a problem

Re: How to test if a module exists?

2010-11-11 Thread Ethan Furman
Lawrence D'Oliveiro wrote: In message , Tim Chase wrote: Amusingly, as others have noted, you replied with an unobfuscated email address. This would seem to be an independent, true record of what members of python-li

Re: How to test if a module exists?

2010-11-11 Thread Lawrence D'Oliveiro
In message , MRAB wrote: > ... the next one at 3 Nov 2010 22:40 "Re: Allowing comments after the line > continuation backslash" and _all_ the subsequent ones arrived with an > _unobfuscated_ email address. You mean from this one on

Re: returning results from function

2010-11-11 Thread Chris Rebert
On Thu, Nov 11, 2010 at 1:16 PM, Neil Berg wrote: > Hi Python community, > > In a main script, I pass the year (yr), month (mo), day (dy) and hour(hr) > into the utc_to_local function (pasted below) which converts that date and > time into local standard time.  I am passing several dates and tim

Re: How to test if a module exists?

2010-11-11 Thread Dave Angel
On 2:59 PM, Lawrence D'Oliveiro wrote: In message, Tim Chase wrote: Amusingly, as others have noted, you replied with an unobfuscated email address. This would seem to be an independent, true record of what members of py

Re: returning results from function

2010-11-11 Thread Stefan Sonnenberg-Carstens
Am 11.11.2010 22:16, schrieb Neil Berg: Hi Python community, In a main script, I pass the year (yr), month (mo), day (dy) and hour(hr) into the utc_to_local function (pasted below) which converts that date and time into local standard time. I am passing several dates and times into this funct

Torrent VFS for Midnight Commander

2010-11-11 Thread Oleg Broytman
Torrent Virtual FileSystem for Midnight Commander WHAT IS IT View files, directories and meta information from a torrent metafile in Midnight Commander. WHAT'S NEW in version 1.0.0 (2010-11-11) Initial release. WHERE TO GET Master site: http://phd.pp.ru/Software/mc/ Mirrors:

Re: Am I The Only One Who Keeps Reading “Numpy” as “Numpty”?

2010-11-11 Thread Ben James
On 10/11/2010 06:53, Lawrence D'Oliveiro wrote: Sorry... I read it as "numpty" all the time! -- http://mail.python.org/mailman/listinfo/python-list

Re: How to test if a module exists?

2010-11-11 Thread Ethan Furman
Dave Angel wrote: On 2:59 PM, Lawrence D'Oliveiro wrote: In message, Tim Chase wrote: Amusingly, as others have noted, you replied with an unobfuscated email address. This would seem to be an independent, true record of

Re: How to test if a module exists?

2010-11-11 Thread MRAB
On 11/11/2010 21:53, Lawrence D'Oliveiro wrote: In message, MRAB wrote: ... the next one at 3 Nov 2010 22:40 "Re: Allowing comments after the line continuation backslash" and _all_ the subsequent ones arrived with an _unobfuscated_ email address. You mean from this one on

Re: returning results from function

2010-11-11 Thread Neil Berg
My main script reads in monthly netCDF files that record variables each hour for that month. The length of all time variables is equal to the number of hours per month. Using January 1995, for example, time_y is a 1d array of the integer 1995 repeated 744 times, time_m is a 1d array of the int

Re: How to test if a module exists?

2010-11-11 Thread Emile van Sebille
On 11/11/2010 2:01 PM Dave Angel said... I subscribe to this list by email, in digest form. And your email address here has a real "@" in it. Don't be so free to call people liars when they're reporting what they actually see. If you get this message directly, you can look at the TO: list. I jus

Re: How to test if a module exists?

2010-11-11 Thread Steve Holden
On 11/11/2010 1:53 PM, Lawrence D'Oliveiro wrote: > In message , MRAB wrote: > >> ... the next one at 3 Nov 2010 22:40 "Re: Allowing comments after the line >> continuation backslash" and _all_ the subsequent ones arrived with an >> _unobfuscated_ email address. > > You mean from this one on >

Re: How to test if a module exists?

2010-11-11 Thread Mark Wooding
Lawrence D'Oliveiro writes: > In message , MRAB wrote: > > > ... the next one at 3 Nov 2010 22:40 "Re: Allowing comments after the line > > continuation backslash" and _all_ the subsequent ones arrived with an > > _unobfuscated_ email address. > > You mean from this one on >

Re: returning results from function

2010-11-11 Thread Chris Rebert
> On Nov 11, 2010, at 1:54 PM, Chris Rebert wrote: >> On Thu, Nov 11, 2010 at 1:16 PM, Neil Berg wrote: >>> Hi Python community, >>> >>> In a main script, I pass the year (yr), month (mo), day (dy) and hour(hr) >>> into the utc_to_local function (pasted below) which converts that date and >>> ti

Re: How to test if a module exists?

2010-11-11 Thread Robert Kern
On 2010-11-11 14:26 , Lawrence D'Oliveiro wrote: In message, Tim Chase wrote: Amusingly, as others have noted, you replied with an unobfuscated email address. This would seem to be an independent, true record of what me

Re: Copy Protected PDFs and PIL

2010-11-11 Thread Robert Kern
On 2010-11-11 14:28 , Brett Bowman wrote: I'm trying to parse some basic details and a thumbnail from ~12,000 PDFs for my company, but a few hundred of them are copy protected. To make matters worse, I can't seem to trap the error it causes: whenever it happens PIL throws a "FATAL PDF disallows

Re: How to test if a module exists?

2010-11-11 Thread Seebs
On 2010-11-11, Lawrence D'Oliveiro wrote: > In message , Tim Chase > wrote: >> Amusingly, as others have noted, you replied with an unobfuscated >> email address. > This > > would seem to be an independent, true record of

Re: How to test if a module exists?

2010-11-11 Thread Seebs
On 2010-11-11, Lawrence D'Oliveiro wrote: > In message , MRAB wrote: >> ... the next one at 3 Nov 2010 22:40 "Re: Allowing comments after the line >> continuation backslash" and _all_ the subsequent ones arrived with an >> _unobfuscated_ email address. > You mean from this one on >

Re: How to test if a module exists?

2010-11-11 Thread Seebs
On 2010-11-11, Tim Chase wrote: >=== > From: Lawrence D'Oliveiro > Newsgroups: gmane.comp.python.general Oh, interesting. > Gee...your unobfuscated email addresses FROM YOU. No, from gmane. Out here in comp.lang.python (no gmane), it's obfuscated. So it sounds lik

Re: How to test if a module exists?

2010-11-11 Thread r0g
On 11/11/10 21:53, Lawrence D'Oliveiro wrote: In message, MRAB wrote: ... the next one at 3 Nov 2010 22:40 "Re: Allowing comments after the line continuation backslash" and _all_ the subsequent ones arrived with an _unobfuscated_ email address. You mean from this one on

Re: parse date/time from a log entry with only strftime (and no regexen)

2010-11-11 Thread Simon Mullis
This was a long time ago But just in case anyone googling ever has the same question, this is what I did (last year). The user just needs to supply a strftime formatted string, such as "%A, %e %b %h:%M" and this Class figures out the regex to use on the log entries... class RegexBuilder(object

Re: How to test if a module exists?

2010-11-11 Thread Lawrence D'Oliveiro
I have just received an admission from Barry Warsaw that a hack was done on python-list specifically to deal with bounces caused by a list member trying to reply to my obfuscated e-mail address. I have asked him to undo that hack. If he likes, he can filter out that (obfuscated) address of mine

Re: How to test if a module exists?

2010-11-11 Thread Ethan Furman
Lawrence D'Oliveiro wrote: The important point, as far as I’m concerned, is that I do NOT want to see my unobfuscated address appear on USENET. You sure did a lousy job of obfuscating for someone so concerned about it. As for those who persisted in posting my address after being warned of t

Re: How to test if a module exists?

2010-11-11 Thread Grant Edwards
On 2010-11-12, Lawrence D'Oliveiro wrote: > As for those who persisted in posting my address after being warned of this, > I'm still deciding what to do. Plonk. -- Grant -- http://mail.python.org/mailman/listinfo/python-list

Re: How to test if a module exists?

2010-11-11 Thread Steve Holden
On 11/11/2010 4:55 PM, Grant Edwards wrote: > On 2010-11-12, Lawrence D'Oliveiro wrote: > >> As for those who persisted in posting my address after being warned of this, >> I'm still deciding what to do. > > Plonk. > Don't you mean >> On 2010-11-12, Lawrence D'Oliveiro wrote: ? regards St

neglecting daylight savings

2010-11-11 Thread Neil Berg
Hi Python community, I am trying to convert UTC to PST and want to neglect daylight savings even for the days that are in PDT, not PST. I simply want every UTC date to be pushed back by 8 hours and not worry about the days when the difference is really -7 due to daylight savings. I have writ

Re: is there an Python equivalent for the PHP super globals like $_POST, $_COOKIE ?

2010-11-11 Thread Roy Smith
In article , r0g wrote: > On 11/11/10 14:22, Stef Mientki wrote: >> I can't find how th get to PHP's equivalent of $_Post and $_Cookie ? PHP is mostly a one-trick pony. It's meant to be run as a web scripting language with Apache (or, I suppose, something else) on the front end. As a result

Re: How to test if a module exists?

2010-11-11 Thread Tim Chase
On 11/11/10 18:20, Lawrence D'Oliveiro wrote: As for those who persisted in posting my address after being warned of this, I’m still deciding what to do. I've got a hint: 1) You can pursue it with various ISPs. If you choose the latter, I can fairly confidently say that any provider, upon r

  1   2   >