Re: Windows service in production?

2011-08-18 Thread Adam Jorgensen
Yeah, we run our Python App as a service under Windows. You can look at the open-souce part of our product using http://trac.sjsoft.com/browser If you look into the code you should be able to find some stuff to do with services. Specficially, look in trunk/j5/src/j5/OS/WinService.py On 19 August

Re: Windows service in production?

2011-08-18 Thread Stephen Hansen
On 8/15/11 9:32 PM, snorble wrote: > Anyone know of a Python application running as a Windows service in > production? I'm planning a network monitoring application that runs as > a service and reports back to the central server. Sort of a heartbeat > type agent to assist with "this server is down,

Re: List spam

2011-08-18 Thread Terry Reedy
On 8/18/2011 10:10 PM, Steven D'Aprano wrote: Now, an ISP might not have the bandwidth to supply all the needs of their customers, that's a separate issue. But complaining that the problem is specifically because they use bittorrent, as if it would disappear if they changed to HTTP, is bogus.

Re: [Python] Re: Windows service in production?

2011-08-18 Thread Chris Gonnerman
Chiming in late here, but I've been running a very simple Python service for some time now on a number of computers. It's my Raw Print Server, available at http://newcenturycomputers.net/projects/rawprintserver.html, and I have instructions on the page for installing the Windows service versio

Re: Help with regular expression in python

2011-08-18 Thread Josh Benner
On Thu, Aug 18, 2011 at 4:03 PM, Matt Funk wrote: > Hi guys, > > thanks for the suggestions. I had tried the white space before as well (to > no > avail). So here is the expression i am using (based on suggestions), but > still > no success: > > instance_linetype_pattern_str =\ >r'(([-+]?

Check email header for RFC 822 standard and match emails between imap servers.

2011-08-18 Thread Vincent Davis
The sort story, I have been attempting to use the Google Migration assistant to migrate emails from one google account to another, about 80,000 emails. I have two problems. 1. Many emails that fail to transfer because of errors like "Invalid RFC 822 Message: Date header "Mon Feb 05 22:07:16 2007" i

Re: Windows service in production?

2011-08-18 Thread Grummble
On 08/16/2011 12:32 AM, snorble wrote: Anyone know of a Python application running as a Windows service in production? I'm planning a network monitoring application that runs as a service and reports back to the central server. Sort of a heartbeat type agent to assist with "this server is down, g

Re: List spam

2011-08-18 Thread Steven D'Aprano
Alain Ketterlin wrote: > "Jason Staudenmayer" writes: > >> I really like this list as part of my learning tools but the amount of >> spam that I've been getting from it is CRAZY. Doesn't anything get >> scanned before it sent to the list? > > I'm using nntp to read this newsgroup (through an ac

Re: Measure the amount of memory used?

2011-08-18 Thread MrJean1
Take a look it this recipe (for Linux only): /Jean On Aug 18, 8:08 am, Jack Bates wrote: > I wrote a content filter for Postfix with > Python,https://github.com/jablko/cookie > > It should get started once, and hopefully run for a long time - so I'

Re: List spam

2011-08-18 Thread Steven D'Aprano
gene heskett wrote: >> But I'd like to return the question. What's wrong with nntp? > > The sheer volume of traffic eats 99% of an ISP's bandwidth. I doubt that very much, particularly if the ISP drops the binary newsgroups. My ISP, Internode, has provided nntp for many years. For a while a fe

Re: 'super' object has no attribute '__setitem__'

2011-08-18 Thread Eric Snow
On Thu, Aug 18, 2011 at 7:44 PM, luvspython wrote: > I'm using Python 2.7 and the code below fails at the 'super' statement > in the __setitem__ function in the HistoryKeeper class.  The error is: >   'super' object has no attribute '_setitem__' > > Can anyone please tell me why and how to fix it?

Re: 'super' object has no attribute '__setitem__'

2011-08-18 Thread Benjamin Peterson
luvspython gmail.com> writes: > def __setitem__(self, item, value): > super(HistoryKeeper, self).__setitem__(item, value) object has no __setitem__. Are you looking for __setattr__? > > class Vehicle(HistoryKeeper): > def __init__(self, tag, make, model): > args = locals

'super' object has no attribute '__setitem__'

2011-08-18 Thread luvspython
I'm using Python 2.7 and the code below fails at the 'super' statement in the __setitem__ function in the HistoryKeeper class. The error is: 'super' object has no attribute '_setitem__' Can anyone please tell me why and how to fix it? (I've googled endlessly and I don't see the problem.) [T

Re: How to convert a list of strings into a list of variables

2011-08-18 Thread Steven D'Aprano
Chris Angelico wrote: > On Thu, Aug 18, 2011 at 5:09 PM, John Gordon wrote: >> for x in list_of_strings: >> list_of_variables.append(eval(x)) >> > > If this really is what you need, you can simplify it by using the > globals() dictionary - it's a regular dictionary whose contents are > all the g

nose + processes + xunit

2011-08-18 Thread Noon Silk
Has anyone had any trouble with this setup? I am in a situation where, the tests run fine when I don't include "--processes=N", however, when I *do* do that, they exit early? The reason I think they exit, is that I'm actually running a different executable, and I load it like so: retcode = subpr

Re: List spam

2011-08-18 Thread Chris Angelico
On Fri, Aug 19, 2011 at 12:03 AM, Seebs wrote: > I don't.  If I want to get started in a language, I might well want to > read about it a bit, and maybe ask questions like "what is a good book > for me to start with?" > > If I have to know the language to do that, well... > When I start with a la

Re: Word Perfect integration

2011-08-18 Thread Seebs
On 2011-08-18, Ethan Furman wrote: > Yes, we still use Word Perfect, and will as long as it is available. > The ability to see the codes in use (bold, margins, columns, etc) has so > far been unequaled in anything else I have looked at. I have used other software that had this functionality, bu

Re: List spam

2011-08-18 Thread Seebs
On 2011-08-18, Prasad, Ramit wrote: >>> Or 'Enter a Python keyword (search the tutorial if you do not know any) >>> ' >> >>Sounds good, but now you've trained the spammer who is without a doubt >>watching this list. > > Teach them Python before they can post, I like it! I don't. If I want

Re: Word Perfect integration

2011-08-18 Thread Rhodri James
On Thu, 18 Aug 2011 20:24:17 +0100, Ethan Furman wrote: Alec Taylor wrote: wow, people still use WordPerfect? Them's fightin' words right there! :) Yes, we still use Word Perfect, and will as long as it is available. The ability to see the codes in use (bold, margins, columns, etc) has

Re: List spam

2011-08-18 Thread Rhodri James
On Thu, 18 Aug 2011 16:00:40 +0100, Jason Staudenmayer wrote: I'm a strong opponent of dropping any email with a stupid footer spam. By contrast, an excessively large sig (particularly an excessively large sig without a proper separator) is something that's guaranteed to get on my wick,

Re: Help with regular expression in python

2011-08-18 Thread Matt Funk
Hi guys, thanks for the suggestions. I had tried the white space before as well (to no avail). So here is the expression i am using (based on suggestions), but still no success: instance_linetype_pattern_str =\ r'(([-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+))?\s+){32}(.+)' instance_linetype_

Re: List spam

2011-08-18 Thread Ben Finney
gene heskett writes: > Short answer is to disconnect the the NNTP link and make this list > into a REAL mailing list. Subscribers only, or get past a GOOD > captcha. Many of the more valuable contributors post via NNTP, which does not require mailing list subscription nor CAPTCHA. One of the co

RE: List spam

2011-08-18 Thread Prasad, Ramit
>> Or 'Enter a Python keyword (search the tutorial if you do not know any) >> ' > >Sounds good, but now you've trained the spammer who is without a doubt >watching this list. Teach them Python before they can post, I like it! Ramit Ramit Prasad | JPMorgan Chase Investment Bank | Currencies

Re: How to convert a list of strings into a list of variables

2011-08-18 Thread AB
Hi, If the «variables» are named attributes you can use getattr. # class colors: red=1 green=2 blue=3 c=colors() a=['red','green','blue'] for v in a: print v,getattr(c,v) #--- AB -- http://mail.python.org/mailman/listinfo/pytho

Re: pairwise combination of two lists

2011-08-18 Thread SigmundV
On Aug 17, 9:22 pm, Yingjie Lin wrote: > I found zip() but it only gives [('a', '1'), ('b', '2')],  not exactly what I > am looking for. Yet, if you feed the zip into a list comprehension you get what you want: li3 = [''.join(l) for l in zip(li1,li2)] Sigmund -- http://mail.python.org/mailma

Re: Help with regular expression in python

2011-08-18 Thread Vlastimil Brom
2011/8/18 Matt Funk : > Hi, > i am sorry if this doesn't quite match the subject of the list. If someone > takes offense please point me to where this question should go. Anyway, i have > a problem using regular expressions. I would like to match the line: > > 1.002000e+01 2.037000e+01 2.128000e+01

Re: List spam

2011-08-18 Thread gene heskett
On Thursday, August 18, 2011 05:18:42 PM Terry Reedy did opine: > On 8/18/2011 12:14 PM, gene heskett wrote: > > into a REAL mailing list. Subscribers only, or get past a GOOD > > captcha. > > I just had an idea. Ask 'What is python? __" or "What > can you do with a python?' with

Re: How to build python using visual studio 2005?

2011-08-18 Thread Brian Curtin
On Wed, Aug 17, 2011 at 13:16, smith jack wrote: > anybody here have build it correctly? > how to make a msi file just as the official site did? > is there any detailed tutorial online? We're currently shipping CPython built on VS 2008, but I do know of people building with 2005. How they do it

Re: How to print non-printable chars??

2011-08-18 Thread coldpizza
On Aug 13, 7:59 am, Julio Cesar Rodriguez Cruz wrote: > Hi all, > If I open an .exe file in any text editor I get lot of odd chars, > what I want is to know how to output those chars if I have the hexadecimal > code. I found out how to do the reverse process with the quopri module, > > i.e.:>>> im

Re: Word Perfect integration

2011-08-18 Thread Terry Reedy
On 8/18/2011 3:24 PM, Ethan Furman wrote: Alec Taylor wrote: wow, people still use WordPerfect? Them's fightin' words right there! :) Yes, we still use Word Perfect, and will as long as it is available. The ability to see the codes in use (bold, margins, columns, etc) has so far been unequale

Re: List spam

2011-08-18 Thread Terry Reedy
On 8/18/2011 12:14 PM, gene heskett wrote: into a REAL mailing list. Subscribers only, or get past a GOOD captcha. I just had an idea. Ask 'What is python? __" or "What can you do with a python?' with a free-form fill in the blank answer. Look for 'computer', 'program' or 'l

Re: Help with regular expression in python

2011-08-18 Thread John Gordon
In Matt Funk writes: > 1.002000e+01 2.037000e+01 2.128000e+01 1.908000e+01 1.871000e+01 1.914000e+01 > instance_linetype_pattern_str = '([-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?) > {32}' > instance_linetype_pattern = re.compile(instance_linetype_pattern_str) Does your regexp account for the s

Re: Help with regular expression in python

2011-08-18 Thread Martin Komoň
You don't seem to account for the whitespace between the floats. Try > '([-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?\s+){32}' (just added \s+). Martin On 8/18/2011 9:49 PM, Matt Funk wrote: > Hi, > i am sorry if this doesn't quite match the subject of the list. If someone > takes offense please poin

Re: List spam

2011-08-18 Thread Terry Reedy
I did check, though. I found a free, open news server with comp.lang.python after 6 that didn't work. Unfortunately, the one I found is read-only. I'll have to do some more looking if I want to participate in the newsgroup. I set it up in Thunderbird. I read and post to this and other Pyth

Help with regular expression in python

2011-08-18 Thread Matt Funk
Hi, i am sorry if this doesn't quite match the subject of the list. If someone takes offense please point me to where this question should go. Anyway, i have a problem using regular expressions. I would like to match the line: 1.002000e+01 2.037000e+01 2.128000e+01 1.908000e+01 1.871000e+01 1.91

Re: Word Perfect integration

2011-08-18 Thread Ethan Furman
John Gordon wrote: I suspect that learning how to integrate python with wordperfect will end up being much more work than learning wordperfect macros. Possibly... but I enjoy coding in Python. :) ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Word Perfect integration

2011-08-18 Thread Ethan Furman
Alec Taylor wrote: wow, people still use WordPerfect? Them's fightin' words right there! :) Yes, we still use Word Perfect, and will as long as it is available. The ability to see the codes in use (bold, margins, columns, etc) has so far been unequaled in anything else I have looked at. ~

Re: How to convert a list of strings into a list of variables

2011-08-18 Thread Nobody
On Thu, 18 Aug 2011 16:09:43 +, John Gordon wrote: >> How would you convert a list of strings into a list of variables using >> the same name of the strings? > >> So, ["red", "one", "maple"] into [red, one, maple] > > If the strings and the object names are exactly the same, you could use >

Re: List spam

2011-08-18 Thread Nobody
On Thu, 18 Aug 2011 14:30:37 +0100, Tim Golden wrote: >> I really like this list as part of my learning tools but the amount of >> spam that I've been getting from it is CRAZY. Doesn't anything get >> scanned before it sent to the list? > > I haven't seen any significant quantity of spam on the l

Re: List spam

2011-08-18 Thread Dan Stromberg
On Thu, Aug 18, 2011 at 6:39 AM, Jason Staudenmayer < jas...@adventureaquarium.com> wrote: > > > On 18/08/2011 13:58, Jason Staudenmayer wrote: > > > I really like this list as part of my learning tools but the amount > > > of spam that I've been getting from it is CRAZY. Doesn't > > anything get

Re: List spam

2011-08-18 Thread gene heskett
On Thursday, August 18, 2011 02:26:24 PM Peter Pearson did opine: > On Thu, 18 Aug 2011 12:15:59 -0400, gene heskett > wrote: [snip] > > > What is wrong with the mailing list only approach? > > In the mailing-list approach, how do I search for prior discussions > on a subject? (I'm not particu

Re: List spam

2011-08-18 Thread gene heskett
On Thursday, August 18, 2011 02:12:58 PM Alain Ketterlin did opine: > gene heskett writes: > >> Or save work and find a public nntp server (or setup one, or ask your > >> provider), and use a news reader to follow the list (even thunderbird > >> can do this). No spam, no need to store messages on

Re: List spam

2011-08-18 Thread Anssi Saari
Ghodmode writes: > Newsgroups aren't inherently spam-free. They're filtered. At least > that's the case with Gmane (http://gmane.org/spam.php). > > My own ISP doesn't provide a news server and, although there are many > links for free open news servers, most of them don't seem to work. You kno

Re: Wait for a keypress before continuing?

2011-08-18 Thread Nobody
On Thu, 18 Aug 2011 01:24:30 -0700, peter wrote: > This is very similar to my solution, which was to use stty turn off > keyboard echo, then repeatedly read sys.stdin.read(1) until a unique > keystroke had been defined. For example, the 'Insert' key seems to > return a sequence of four codes, name

Re: Word Perfect integration

2011-08-18 Thread Alec Taylor
wow, people still use WordPerfect? On Fri, Aug 19, 2011 at 2:51 AM, John Gordon wrote: > In Ethan Furman > writes: > >> I have WordPerfect v13 which we are currently using for letter merges. >> I would like to automate this with Python instead of learning the WP >> Macro language. > > I suspec

Re: List spam

2011-08-18 Thread Alec Taylor
5963 unread emails. Thanks python-list + other mailing-lists! My recommendation to you is to setup a different account for your mailing-lists. Alternatively setup some mail rules. On Fri, Aug 19, 2011 at 3:46 AM, Chris Angelico wrote: > On Thu, Aug 18, 2011 at 3:37 PM, Ghodmode wrote: >> Make

Re: How to convert a list of strings into a list of variables

2011-08-18 Thread Chris Angelico
On Thu, Aug 18, 2011 at 5:09 PM, John Gordon wrote: > for x in list_of_strings: >    list_of_variables.append(eval(x)) > If this really is what you need, you can simplify it by using the globals() dictionary - it's a regular dictionary whose contents are all the global variables in your current m

Re: Measure the amount of memory used?

2011-08-18 Thread Dan Stromberg
"A person with one watch knows what time it is. A person with two is never sure." You're probably best off just picking one or more measures that work for your purposes, and going with them. Don't concern yourself overmuch with finding "the" amount. Memory can actually contract on some modern s

Re: List spam

2011-08-18 Thread Chris Angelico
On Thu, Aug 18, 2011 at 3:37 PM, Ghodmode wrote: > Make an effort to curb the spam even if it means killing the newsgroup > availability.  Choose mailman or Google Groups, or another single > solution.  Make it members only, but allow anyone to register with an > automated confirmation email and a

Re: List spam

2011-08-18 Thread Ghodmode
On Fri, Aug 19, 2011 at 12:37 AM, Ned Deily wrote: > 4. gmane (various formats) >   http://dir.gmane.org/gmane.comp.python.general >   a.  gmane.comp.python.general (non-Usenet group via NNTP) > All of the above allow both reading and posting.  gmane does spam > filtering so, if you read and post

Re: List spam

2011-08-18 Thread Philip Semanchuk
On Aug 18, 2011, at 1:10 PM, Peter Pearson wrote: > On Thu, 18 Aug 2011 12:15:59 -0400, gene heskett wrote: > [snip] >> What is wrong with the mailing list only approach? > > In the mailing-list approach, how do I search for prior discussions > on a subject? (I'm not particularly opposed to th

Re: List spam

2011-08-18 Thread Peter Pearson
On Thu, 18 Aug 2011 12:15:59 -0400, gene heskett wrote: [snip] > What is wrong with the mailing list only approach? In the mailing-list approach, how do I search for prior discussions on a subject? (I'm not particularly opposed to the mailing list, I'm just an NNTP follower worried about the unc

Re: List spam

2011-08-18 Thread Peter Pearson
On Thu, 18 Aug 2011 16:58:04 +0200, Alain Ketterlin wrote: > Ghodmode writes: > > [...] >> Make an effort to curb the spam even if it means killing the newsgroup >> availability. Choose mailman or Google Groups, or another single >> solution. Make it members only, but allow anyone to register wi

Re: List spam

2011-08-18 Thread Alain Ketterlin
gene heskett writes: >> Or save work and find a public nntp server (or setup one, or ask your >> provider), and use a news reader to follow the list (even thunderbird >> can do this). No spam, no need to store messages on your machine, >> auto-purge after a configurable delay, etc. > That is ask

Re: Word Perfect integration

2011-08-18 Thread John Gordon
In Ethan Furman writes: > I have WordPerfect v13 which we are currently using for letter merges. > I would like to automate this with Python instead of learning the WP > Macro language. I suspect that learning how to integrate python with wordperfect will end up being much more work than lea

Re: lists and for loops

2011-08-18 Thread Peter Pearson
On Wed, 17 Aug 2011 20:08:23 -0700 (PDT), Emily Anne Moravec wrote: > I want to add 5 to each element of a list by using a for loop. > > Why doesn't this work? > > numbers = [1, 2, 3, 4, 5] > for n in numbers: > n = n + 5 > print numbers Because integers are immutable. You cannot turn 1 into

Word Perfect integration

2011-08-18 Thread Ethan Furman
I have WordPerfect v13 which we are currently using for letter merges. I would like to automate this with Python instead of learning the WP Macro language. Does anyone have any pointers? ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: List spam

2011-08-18 Thread Ned Deily
In article , Ghodmode wrote: > Newsgroups aren't inherently spam-free. They're filtered. At least > that's the case with Gmane (http://gmane.org/spam.php). > > My own ISP doesn't provide a news server and, although there are many > links for free open news servers, most of them don't seem to

Re: List spam

2011-08-18 Thread gene heskett
On Thursday, August 18, 2011 12:14:39 PM Alain Ketterlin did opine: > Ghodmode writes: > > [...] > > > Make an effort to curb the spam even if it means killing the newsgroup > > availability. Choose mailman or Google Groups, or another single > > solution. Make it members only, but allow anyo

Re: List spam

2011-08-18 Thread gene heskett
On Thursday, August 18, 2011 12:08:38 PM Alain Ketterlin did opine: > "Jason Staudenmayer" writes: > > I really like this list as part of my learning tools but the amount of > > spam that I've been getting from it is CRAZY. Doesn't anything get > > scanned before it sent to the list? > > I'm usi

Re: List spam

2011-08-18 Thread Ghodmode
On Thu, Aug 18, 2011 at 10:58 PM, Alain Ketterlin wrote: > Ghodmode writes: > > [...] >> Make an effort to curb the spam even if it means killing the newsgroup >> availability.  Choose mailman or Google Groups, or another single >> solution.  Make it members only, but allow anyone to register wit

Re: How to convert a list of strings into a list of variables

2011-08-18 Thread John Gordon
In <2ab25f69-6017-42a6-a7ef-c71bc2ee8...@l2g2000vbn.googlegroups.com> noydb writes: > How would you convert a list of strings into a list of variables using > the same name of the strings? > So, ["red", "one", "maple"] into [red, one, maple] > Thanks for any help! If the strings and the objec

Re: List spam

2011-08-18 Thread gene heskett
On Thursday, August 18, 2011 12:08:00 PM Ghodmode did opine: > On Thu, Aug 18, 2011 at 9:39 PM, Philip Semanchuk wrote: > > On Aug 18, 2011, at 8:58 AM, Jason Staudenmayer wrote: > >> I really like this list as part of my learning tools but the amount > >> of spam that I've been getting from it

RE: List spam

2011-08-18 Thread Jason Staudenmayer
> On Aug 18, 8:39 am, "Jason Staudenmayer" > wrote: > > > > [snip irony] > > > > Adventure Aquarium is America's Most Touchable Aquarium! > > Featuring the ALL NEW Stingray Beach Club > > Where you can touch and hand feed the gentle stingrays > > > > To buy and print your tickets at home visit   w

Sqlalchemy + Cherrypy

2011-08-18 Thread Navkirat Singh
Hi Guys, I am not sure if this is the right place to put this question. I am trying to figure out what the proper/clean way is to integrate cherrypy and sqlalchemy? I am currently trying to do this cherrypy 3 and sqlalchemy .7 in python 3.2 a) Cherrypy tools b) Integrate it directly into the app

Re: List spam

2011-08-18 Thread D'Arcy J.M. Cain
On Thu, 18 Aug 2011 22:37:37 +0800 Ghodmode wrote: > Make an effort to curb the spam even if it means killing the newsgroup > availability. Choose mailman or Google Groups, or another single > solution. Make it members only, but allow anyone to register with an > automated confirmation email and

Re: How to convert a list of strings into a list of variables

2011-08-18 Thread noydb
On Aug 18, 11:29 am, Jerry Hill wrote: > On Thu, Aug 18, 2011 at 11:19 AM, noydb wrote: > > I am being passed the list of strings.  I have variables set up > > already pointing to files.  I need to loop through each variable in > > the list and do things to the files.  The list of strings will ch

Re: Measure the amount of memory used?

2011-08-18 Thread John Gordon
In Jack Bates writes: > 1) How does the amount of memory used change as it runs? I've observed that the amount of memory consumed by a program will stay constant or increase; it never decreases. Or were you wanting to measure the rate of increase over time? > Has anyone else measured the me

Re: How to convert a list of strings into a list of variables

2011-08-18 Thread Jerry Hill
On Thu, Aug 18, 2011 at 11:19 AM, noydb wrote: > I am being passed the list of strings.  I have variables set up > already pointing to files.  I need to loop through each variable in > the list and do things to the files.  The list of strings will change > each time, include up to 22 of the same s

Re: How to convert a list of strings into a list of variables

2011-08-18 Thread noydb
On Aug 18, 11:12 am, David Robinow wrote: > On Thu, Aug 18, 2011 at 10:57 AM, noydb wrote: > > How would you convert a list of strings into a list of variables using > > the same name of the strings? > > > So, ["red", "one", "maple"] into [red, one, maple] > >   Why would you want to? I am being

Re: extend class: include factories functions inside constructor

2011-08-18 Thread aspineux
On Aug 18, 4:45 pm, Peter Otten <__pete...@web.de> wrote: > aspineux wrote: > > Hi > > I have a closed class and 2 factories function > > > class Data: > >   def __init__(self): > >     self.payload=None > > > def data_from_string(payload): > >   data=Data() > >   data.payload=payload > >   return

Measure the amount of memory used?

2011-08-18 Thread Jack Bates
I wrote a content filter for Postfix with Python, https://github.com/jablko/cookie It should get started once, and hopefully run for a long time - so I'm interested in how it uses memory: 1) How does the amount of memory used change as it runs? 2) How does the amount of memory used change as I

Re: How to convert a list of strings into a list of variables

2011-08-18 Thread David Robinow
On Thu, Aug 18, 2011 at 10:57 AM, noydb wrote: > How would you convert a list of strings into a list of variables using > the same name of the strings? > > So, ["red", "one", "maple"] into [red, one, maple] Why would you want to? -- http://mail.python.org/mailman/listinfo/python-list

Re: pairwise combination of two lists

2011-08-18 Thread Ian Kelly
On Wed, Aug 17, 2011 at 4:22 PM, Yingjie Lin wrote: > Hi Python users, > > I have two lists: > > li1 = ['a', 'b'] > li2 = ['1', '2'] > > and I wish to obtain a list like this > > li3 = ['a1', 'a2', 'b1', 'b2'] > > Is there a handy and efficient function to do this, especially when li1 and > li2 a

Re: List spam

2011-08-18 Thread Alain Ketterlin
Ghodmode writes: [...] > Make an effort to curb the spam even if it means killing the newsgroup > availability. Choose mailman or Google Groups, or another single > solution. Make it members only, but allow anyone to register with an > automated confirmation email and a CAPTCHA. Appoint a list

Re: extend class: include factories functions inside constructor

2011-08-18 Thread aspineux
On Aug 18, 4:45 pm, Peter Otten <__pete...@web.de> wrote: > aspineux wrote: > > Hi > > I have a closed class and 2 factories function > > > class Data: > >   def __init__(self): > >     self.payload=None > > > def data_from_string(payload): > >   data=Data() > >   data.payload=payload > >   return

How to convert a list of strings into a list of variables

2011-08-18 Thread noydb
How would you convert a list of strings into a list of variables using the same name of the strings? So, ["red", "one", "maple"] into [red, one, maple] Thanks for any help! -- http://mail.python.org/mailman/listinfo/python-list

Re: List spam

2011-08-18 Thread Alain Ketterlin
"Jason Staudenmayer" writes: > I really like this list as part of my learning tools but the amount of > spam that I've been getting from it is CRAZY. Doesn't anything get > scanned before it sent to the list? I'm using nntp to read this newsgroup (through an academic server). No spam at all. --

Re: extend class: include factories functions inside constructor

2011-08-18 Thread Peter Otten
aspineux wrote: > Hi > I have a closed class and 2 factories function > > class Data: > def __init__(self): > self.payload=None > > def data_from_string(payload): > data=Data() > data.payload=payload > return data > > def data_from_file(f): > data=Data() > data.payload=f.read()

Re: List spam

2011-08-18 Thread rantingrick
On Aug 18, 8:39 am, "Jason Staudenmayer" wrote: > > [snip irony] > > Adventure Aquarium is America's Most Touchable Aquarium! > Featuring the ALL NEW Stingray Beach Club > Where you can touch and hand feed the gentle stingrays > > To buy and print your tickets at home visit  www.AdventureAquarium.

Re: List spam

2011-08-18 Thread Ghodmode
On Thu, Aug 18, 2011 at 9:39 PM, Philip Semanchuk wrote: > > On Aug 18, 2011, at 8:58 AM, Jason Staudenmayer wrote: > >> I really like this list as part of my learning tools but the amount of spam >> that I've been getting from it is CRAZY. Doesn't anything get scanned before >> it sent to the l

Re: [Python] Re: Windows service in production?

2011-08-18 Thread Chris Gonnerman
Chiming in late here, but I've been running a very simple Python service for some time now on a number of computers. It's my Raw Print Server, available at http://newcenturycomputers.net/projects/rawprintserver.html, and I have instructions on the page for installing the Windows service versio

Re: List spam

2011-08-18 Thread Ghodmode
On Thu, Aug 18, 2011 at 9:30 PM, Tim Golden wrote: > On 18/08/2011 13:58, Jason Staudenmayer wrote: >> >> I really like this list as part of my learning tools but the amount >> of spam that I've been getting from it is CRAZY. Doesn't anything get >> scanned before it sent to the list? > > I haven'

Re: List spam

2011-08-18 Thread gene heskett
On Thursday, August 18, 2011 09:51:04 AM Philip Semanchuk did opine: > On Aug 18, 2011, at 8:58 AM, Jason Staudenmayer wrote: > > I really like this list as part of my learning tools but the amount of > > spam that I've been getting from it is CRAZY. Doesn't anything get > > scanned before it sent

RE: List spam

2011-08-18 Thread Jason Staudenmayer
> On Aug 18, 2011, at 8:58 AM, Jason Staudenmayer wrote: > > > I really like this list as part of my learning tools but > the amount of spam that I've been getting from it is CRAZY. > Doesn't anything get scanned before it sent to the list? > > This has been discussed on the list a number of times

extend class: include factories functions inside constructor

2011-08-18 Thread aspineux
Hi I have a closed class and 2 factories function class Data: def __init__(self): self.payload=None def data_from_string(payload): data=Data() data.payload=payload return data def data_from_file(f): data=Data() data.payload=f.read() return data And I want to extend the class,

RE: List spam

2011-08-18 Thread Jason Staudenmayer
> On 18/08/2011 13:58, Jason Staudenmayer wrote: > > I really like this list as part of my learning tools but the amount > > of spam that I've been getting from it is CRAZY. Doesn't > anything get > > scanned before it sent to the list? > > I haven't seen any significant quantity of spam on the li

Re: List spam

2011-08-18 Thread Philip Semanchuk
On Aug 18, 2011, at 8:58 AM, Jason Staudenmayer wrote: > I really like this list as part of my learning tools but the amount of spam > that I've been getting from it is CRAZY. Doesn't anything get scanned before > it sent to the list? This has been discussed on the list a number of times befor

Re: List spam

2011-08-18 Thread Tim Golden
On 18/08/2011 13:58, Jason Staudenmayer wrote: I really like this list as part of my learning tools but the amount of spam that I've been getting from it is CRAZY. Doesn't anything get scanned before it sent to the list? I haven't seen any significant quantity of spam on the list for ages. (Th

Re: Syntactic sugar for assignment statements: one value to multiple targets?

2011-08-18 Thread Roy Smith
In article <16ea4848-db0c-489a-968c-ca40700f5...@m5g2000prh.googlegroups.com>, gc wrote: > I frequently need to initialize several variables to the same > value, as I'm sure many do. Sometimes the value is a constant, often > zero; sometimes it's more particular, such as defaultdict(list). I us

List spam

2011-08-18 Thread Jason Staudenmayer
I really like this list as part of my learning tools but the amount of spam that I've been getting from it is CRAZY. Doesn't anything get scanned before it sent to the list? Jason ..·><º> -- http://mail.python.org/mailman/listinfo/python-list

Re: lists and for loops

2011-08-18 Thread Tim Chase
On 08/18/2011 07:22 AM, Mark Niemczyk wrote: Or, using list comprehension. numbers = [1, 2, 3, 4, 5] numbers = [n + 5 for n in numbers] numbers [6, 7, 8, 9, 10] Or, if you want it in-place: numbers[:] = [n+5 for n in numbers] which makes a difference if you have another reference to numb

Re: lists and for loops

2011-08-18 Thread Mark Niemczyk
Or, using list comprehension. >>> numbers = [1, 2, 3, 4, 5] >>> numbers = [n + 5 for n in numbers] >>> numbers [6, 7, 8, 9, 10] -- http://mail.python.org/mailman/listinfo/python-list

decorator issue with modules dbus & gobject

2011-08-18 Thread Makiavelik
Hi, Here is a sample code that reproduces the issue : [code] import logging import unittest import signal import gobject import dbus from functools import wraps from dbus.mainloop.glib import DBusGMainLoop class TimeoutException(Exception): pass def timeout(timeout_time=1800): """ decora

Re: Syntactic sugar for assignment statements: one value to multiple targets?

2011-08-18 Thread John Pinner
On Aug 3, 2:45 am, gc wrote: > Hi everyone! Longtime lurker, hardly an expert, but I've been using > Python for various projects since 2007 and love it. > > I'm looking for either (A) suggestions on how to do a very common > operation elegantly and Pythonically, or (B) input on whether my > propos

Re: Wait for a keypress before continuing?

2011-08-18 Thread peter
On Aug 17, 3:16 pm, Hans Mulder wrote: > On 17/08/11 10:03:00, peter wrote: > > > Is there an equivalent to msvcrt for Linux users?  I haven't found > > one, and have resorted to some very clumsy code which turns off > > keyboard excho then reads stdin. Seems such an obvious thing to want > > to d

Re: pairwise combination of two lists

2011-08-18 Thread Alain Ketterlin
Yingjie Lin writes: > I have two lists: > > li1 = ['a', 'b'] > li2 = ['1', '2'] > > and I wish to obtain a list like this > > li3 = ['a1', 'a2', 'b1', 'b2'] > > Is there a handy and efficient function to do this, especially when > li1 and li2 are long lists. It's not difficult to write your own

Re: pairwise combination of two lists

2011-08-18 Thread Paul Rubin
Yingjie Lin writes: > li1 = ['a', 'b'] > li2 = ['1', '2'] > > and I wish to obtain a list like this > li3 = ['a1', 'a2', 'b1', 'b2'] from itertools import * li3 = list(chain.from_iterable(izip(li1,li2))) -- http://mail.python.org/mailman/listinfo/python-list