Re: How to test if a module exists?

2010-11-11 Thread alex23
On Nov 12, 2:53 pm, Lawrence D'Oliveiro wrote: > I have asked for my messages to be filtered from being distributed to > python-list. As far as I’m concerned, the lot of you can bloody piss off. Oh Lawrence, the feeling is mutual. At least then we'd be spared your constant indignation at Windows.

Re: subprocess.Popen deadlocks

2010-11-11 Thread Lawrence D'Oliveiro
In message <2cf9a225-7d1c-4490-8a62-807e79bdd...@n30g2000vbb.googlegroups.com>, eraserix wrote: > I try to control several process from a python script. Each process is > started from a thread, the threads just wait() for the child to exit > and can then be joined. Main waits for SIGINT. After i

HAI WANT TO MEET FRIENDS FOR REAL FUN, CLICK FRIENDS-4-FUN

2010-11-11 Thread fun for u all
HAI WANT TO MEET FRIENDS FOR REAL FUN, CLICK FRIENDS-4-FUN HAI WANT TO MEET FRIENDS FOR REAL FUN, CLICK FRIENDS-4-FUN http://tinyurl.com/friend-4-fun or http://goo.gl/1bour or http://tinyurl.com/friend-4-fun1 -- http://mail.python.org/mailman/listinfo/python

HAI WANT TO MEET FRIENDS FOR REAL FUN, CLICK FRIENDS-4-FUN

2010-11-11 Thread fun for u all
HAI WANT TO MEET FRIENDS FOR REAL FUN, CLICK FRIENDS-4-FUN HAI WANT TO MEET FRIENDS FOR REAL FUN, CLICK FRIENDS-4-FUN http://tinyurl.com/friend-4-fun or http://goo.gl/1bour or http://tinyurl.com/friend-4-fun1 -- http://mail.python.org/mailman/listinfo/python

Re: How to test if a module exists?

2010-11-11 Thread Lawrence D'Oliveiro
I have asked for my messages to be filtered from being distributed to python-list. As far as I’m concerned, the lot of you can bloody piss off. -- http://mail.python.org/mailman/listinfo/python-list

Extending Thunderbird mail client with Python

2010-11-11 Thread John Bond
Anyone have any experience with this, ideally using Python 3? I'd like to sync my Thunderbird contacts with various things including my mobile phone. Of course, I want to do it with Python! I've seen some stuff around, eg. an XPI that provides Python bindings to the Mozilla XPCOM APIs (through

Re: How to test if a module exists?

2010-11-11 Thread Seebs
On 2010-11-12, Lawrence D'Oliveiro wrote: > 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. That's... Fascinating. But it does mean that the pe

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

2010-11-11 Thread Martin Gregorie
On Thu, 11 Nov 2010 13:01:01 -0500, Steve Holden wrote: > Moving from one language to anther is not just a matter of > transliterating the code. Of you try that you will end up with a messy > code base that looks like PHP written in Python. > "The determined Real Programmer can write Fortran progr

Re: neglecting daylight savings

2010-11-11 Thread Emile van Sebille
On 11/11/2010 5:26 PM Neil Berg said... 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. IIRC, that what Arizona time is. Why not use it instead of attempting to redefine PST? Emile -- http://mail.pyth

Re: neglecting daylight savings

2010-11-11 Thread Ben Finney
Neil Berg writes: > I am trying to convert UTC to PST and want to neglect daylight savings > even for the days that are in PDT, not PST. Then you don't want “PST”. That name entails all the rules of the time zone. If that's not what you want, don't ask timezone libraries for it. Similarly for t

Re: How to test if a module exists?

2010-11-11 Thread Emile van Sebille
On 11/11/2010 4:20 PM Lawrence D'Oliveiro said... 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

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

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

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

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

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

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 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 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: 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 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: 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: 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: 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: 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 Emile van Sebille
I'm using thunderbird via gmane and see the sender shown as l...@geek-central.gen.nz -- so, no lies -- you've been self-outed. Emile -- http://mail.python.org/mailman/listinfo/python-list

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

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

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

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

please subscribe me to the list

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

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

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

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: 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:* python-list@python.org > *Sent:* Thu, November 11, 2010 10:20:03 AM > *Subject:* Re: is there an Python equivalent for th

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

2010-11-11 Thread david wright
From: Stef Mientki To: python-list@python.org 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: os.tmpfile() vs. tempfile.TemporaryFile()

2010-11-11 Thread danmcle...@yahoo.com
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

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

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

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

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

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

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

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, "danmcle...@yahoo.com" 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

Re: A matter of queues, tasks and multiprocessing

2010-11-11 Thread Emanuele D'Arrigo
On Nov 10, 9:19 pm, "danmcle...@yahoo.com" 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: 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: 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

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

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: multiple discontinued ranges

2010-11-11 Thread cbr...@cbrownsystems.com
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

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

  1   2   >