Re: what happens to Popen()'s parent-side file descriptors?

2010-10-14 Thread Lawrence D'Oliveiro
In message <8bec27dd-b1da-4aa3-81e8-9665db040...@n40g2000vbb.googlegroups.com>, Roger Davis wrote: > Documentation on python.org states that GC can be postponed or omitted > altogether ... Yes, but no sensible Python implementation would do that, as it’s a recipe for resource bloat. -- http://

Re: what happens to Popen()'s parent-side file descriptors?

2010-10-14 Thread Lawrence D'Oliveiro
In message , Chris Torek wrote: > Running the above code fragment in a different implementation, in > which garbage collection is deferred, would *not* close the file > descriptor, and the system would potentially run out (depending on > when a gc occurred, and/or whether the system would attempt

Re: what happens to Popen()'s parent-side file descriptors?

2010-10-14 Thread Nobody
On Thu, 14 Oct 2010 08:48:45 -0700, Roger Davis wrote: > On a related point here, I have one case where I need to replace the > shell construct > >externalprog otherfile > > I suppose I could just use os.system() here but I'd rather keep the > Unix shell completely out of the picture (which

Re: Boolean value of generators

2010-10-14 Thread Arnaud Delobelle
Paul Rubin writes: > Steven D'Aprano writes: >> (4) Expensive generators. The beauty of generators is that they produce >> values on demand. Making all generators cache their first value means >> that you pay that cost even if you end up never needing the first value. > > You wouldn't generate

Weird try-except vs if behavior

2010-10-14 Thread James Matthews
Hi, I have this code http://gist.github.com/627687 (I don't like pasting code into the mailing list). I am wondering why the try except is taking longer. I assume that if the IF statement checks every iteration of the loop (1000 times) shouldn't it be slower? James -- http://www.goldwatches.co

Re: PyCharm

2010-10-14 Thread Vladimir Ignatov
Hello, > One thing that bugs me in refactoring though is that renaming a method or > variable does not necessarily work. It's supposed to track down all > >references and correctly change them, but it tends to be hit or miss. Since we got a true dynamic language here (Python) I don't see a way

Re: extract method with generators

2010-10-14 Thread Steve Howell
On Oct 14, 8:45 pm, Cameron Simpson wrote: > On 14Oct2010 20:11, Steve Howell wrote: > | Is there a way to extract code out of a generator function f() into > | g() and be able to have f() yield g()'s result without this idiom?: > | > |   for g_result in g(): > |     yield g_result > | > | It fee

Re: Help with sets

2010-10-14 Thread Steve Howell
On Oct 14, 9:22 pm, Lawrence D'Oliveiro wrote: > In message > <12fcd67a-774d-42f0-851a-9c3497df9...@s24g2000pri.googlegroups.com>, Steve > > Howell wrote: > > On Oct 14, 4:09 pm, Gregory Ewing wrote: > >> Steve Howell wrote: > > >> Maybe "analogy" or "similarity" would be a better word here. > >

Re: EOF while scanning triple-quoted string literal

2010-10-14 Thread Lawrence D'Oliveiro
In message , Rhodri James wrote: > ... frankly putting arbitrary binary into a literal string is rather > asking for something like this to come and bite you. It normally works fine on sensible OSes. -- http://mail.python.org/mailman/listinfo/python-list

Re: Class-level variables - a scoping issue

2010-10-14 Thread Lawrence D'Oliveiro
In message <8hl2jvfb1...@mid.individual.net>, Gregory Ewing wrote: > Lawrence D'Oliveiro wrote: > >> If you can’t do it statically, do it dynamically. > > But how can that be done without seeing into the future? “Dynamically” is when that “future” becomes the present, so you can see it right i

Re: python/c api

2010-10-14 Thread Lawrence D'Oliveiro
In message , Diez B. Roggisch wrote: > ... and a lot of embedding python into a software. Let me mention some notable Free Software that does this: Blender, GIMP and Scribus, among ones I’ve messed about with recently. Makes an amazing amount of power available. -- http://mail.python.org/mailm

Re: Help with sets

2010-10-14 Thread Lawrence D'Oliveiro
In message <12fcd67a-774d-42f0-851a-9c3497df9...@s24g2000pri.googlegroups.com>, Steve Howell wrote: > On Oct 14, 4:09 pm, Gregory Ewing wrote: >> Steve Howell wrote: >> >> Maybe "analogy" or "similarity" would be a better word here. > > Agreed. "Analogy" seems particularly appropriate. Excep

Re: PEP 249 (database api) -- executemany() with iterable?

2010-10-14 Thread Lawrence D'Oliveiro
In message , M.-A. Lemburg wrote: > However, even with iterables, please keep in mind that pushing > the data row-per-row over a network does not result in good > performance, so using an iterable will make you update slower. > > cursor.executemany() is meant to allow the database module > to op

Re: extract method with generators

2010-10-14 Thread Cameron Simpson
On 14Oct2010 20:11, Steve Howell wrote: | Is there a way to extract code out of a generator function f() into | g() and be able to have f() yield g()'s result without this idiom?: | | for g_result in g(): | yield g_result | | It feels like a clumsy hindrance to refactoring, to have to intr

Re: toy list processing problem: collect similar terms

2010-10-14 Thread Xah Lee
On Sep 25, 9:05 pm, Xah Lee wrote: > here's a interesting toy list processing problem. > > I have a list of lists, where each sublist is labelled by > a number. I need to collect together the contents of all sublists > sharing > the same label. So if I have the list > > ((0 a b) (1 c d) (2 e f) (

extract method with generators

2010-10-14 Thread Steve Howell
Is there a way to extract code out of a generator function f() into g() and be able to have f() yield g()'s result without this idiom?: for g_result in g(): yield g_result It feels like a clumsy hindrance to refactoring, to have to introduce a local variable and a loop. Here is a program t

Re: ENVIRONMENT Variable expansion in ConfigParser

2010-10-14 Thread Rodrick Brown
How about doing something like host.name=%HOSTNAME% Then when you parse in the value %HOSTNAME% from your configParser module you do a pattern substitution of %HOSTNAME% with os.environ['HOSTNAME']. Sent from my iPhone 4. On Oct 14, 2010, at 7:57 PM, pikespeak wrote: > Hi, > I am using Conf

Re: Boolean value of generators

2010-10-14 Thread Steve Howell
On Oct 14, 7:08 pm, Paul Rubin wrote: > Steven D'Aprano writes: > > (4) Expensive generators. The beauty of generators is that they produce > > values on demand. Making all generators cache their first value means > > that you pay that cost even if you end up never needing the first value. > > Yo

Re: Boolean value of generators

2010-10-14 Thread Tim Chase
On 10/14/10 20:48, Steven D'Aprano wrote: (3) Generators with side-effects. I know, I know, if you write functions with side-effects, you're in a state of sin already, but there's no need for Python to make it worse. (4) Expensive generators. The beauty of generators is that they produce values

Re: Boolean value of generators

2010-10-14 Thread Steven D'Aprano
On Thu, 14 Oct 2010 14:43:29 -0400, Albert Hopkins wrote: > There may be times, however, that a generator may "know" that it > doesn't/isn't/won't generate any values, and so you may be able to > override boolean evaluation. Consider this example: [snip example] This is a good example, but it'

Re: Boolean value of generators

2010-10-14 Thread Paul Rubin
Steven D'Aprano writes: > (4) Expensive generators. The beauty of generators is that they produce > values on demand. Making all generators cache their first value means > that you pay that cost even if you end up never needing the first value. You wouldn't generate the cached value ahead of ti

Re: PyCharm

2010-10-14 Thread Brian Jones
I've been using PyCharm since the very first EAP releases, and downloaded 1.0 yesterday. I've tested out so many IDEs for use with Python, but PyCharm is the only one that gives me everything I want with just about zero work. Here's what won me over: 1. I can set up nose and coverage as a Run conf

Re: Compiling as 32bit on MacOSX

2010-10-14 Thread Ned Deily
In article <8hpgn7fho...@mid.individual.net>, Gregory Ewing wrote: > Ned Deily wrote: > > Perhaps you're > > calling ld(1) directly? To link multiple-arch executables (etc), the > > Apple gcc driver does the dirty work of calling ld multiple times and > > lipo-ing the results. > > Is this s

Re: Boolean value of generators

2010-10-14 Thread Steven D'Aprano
On Thu, 14 Oct 2010 14:13:30 -0500, Tim Chase wrote: >> I remember thinking that Python would be better off if all generators >> automatically cached an item, so you could test for emptiness, look >> ahead at the next item without consuming it, etc. This might have been >> a good change to make i

Re: PEP 249 (database api) -- executemany() with iterable?

2010-10-14 Thread Steve Howell
On Oct 13, 8:32 pm, Lawrence D'Oliveiro wrote: > In message > , Steve > > Howell wrote: > > Bulk-load strategies usually solve one or more of these problems: > > >  network latency > > That’s not an issue. This is a bulk operation, after all. > > >  index maintenance during the upload > > There ar

Re: Help with sets

2010-10-14 Thread Steve Howell
On Oct 14, 4:09 pm, Gregory Ewing wrote: > Steve Howell wrote: > > That was the original context of my comment.  The term "symmetry" gets > > used a couple times in that PEP, and I think we're in violent > > agreement that the concept of "symmetry" is wishy-washy at best. > > > Here is just one ex

Re: python/c api

2010-10-14 Thread alex23
On Oct 15, 5:53 am, de...@web.de (Diez B. Roggisch) wrote: > For example Ableton Live, an audio sequencer. I _have_ Live and I didn't realise this :O Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Get alternative char name with unicodedata.name() if no formal one defined

2010-10-14 Thread John Machin
On Oct 14, 7:25 pm, Dirk Wallenstein wrote: > Hi, > I'd like to get control char names for the first 32 codepoints, but they > apparently only have an alias and no official name. Is there a way to > get the alternative character name (alias) in Python? > AFAIK there is no programatically-availabl

Re: PyCharm

2010-10-14 Thread alex23
Jeffrey Gaynor wrote: > Certainly give it a shot. The only other IDE I found that was > remotely close to it was Komodo which costs a lot more > (Jetbrains is offering a 50% off coupon as a promotional offer > for a while.) I recently tried out PyCharm in anger after something (I forget what) in

Re: Does everyone keep getting recruiting emails from google?

2010-10-14 Thread Philip Semanchuk
On Oct 14, 2010, at 11:49 AM, Daniel Fetchinson wrote: > I keep getting recruiting emails from charlesngu...@google.com about > working for google as an engineer. I know what you mean. Apparently Charles Nguyen doesn't realize that I already get no end of emails and phone calls from Sergei and

ENVIRONMENT Variable expansion in ConfigParser

2010-10-14 Thread pikespeak
Hi, I am using ConfigParser module and would like to know if it has the feature to autoexpand environment variables. For example currently, I have the below section in config where hostname is hardcoded. I would like it to be replaced with the values from the env variable os.envion['HOSTNAME'] so t

Re: Help with sets

2010-10-14 Thread Gregory Ewing
Steve Howell wrote: That was the original context of my comment. The term "symmetry" gets used a couple times in that PEP, and I think we're in violent agreement that the concept of "symmetry" is wishy-washy at best. Here is just one example from the PEP: The symmetry between "if x in y

Re: Compiling as 32bit on MacOSX

2010-10-14 Thread Gregory Ewing
Ned Deily wrote: Perhaps you're calling ld(1) directly? To link multiple-arch executables (etc), the Apple gcc driver does the dirty work of calling ld multiple times and lipo-ing the results. Is this something that only works at link time, then? The gcc man page says: "Multiple options w

Re: Boolean value of generators

2010-10-14 Thread Carl Banks
On Oct 14, 10:53 am, Paul Rubin wrote: > Carl Banks writes: > > In general, the only way to test if a generator is empty is to try to > > consume an item.  (It's possible to write an iterator that consumes an > > item and caches it to be returned on the next next(), and whose > > boolean status i

Re: Exceptions are not just for errors

2010-10-14 Thread Gregory Ewing
Ben Finney wrote: Another way of thinking about it is that there's no sensible sequence of bytes to return at EOF, so the Pythonic thing to do is to raise an exception for this exceptional circumstance. But this is *not* what Python does, so it's obviously not Pythonic. :-) If f.read(n) is to

Re: PyCharm

2010-10-14 Thread Jeffrey Gaynor
Yip. I'm using it and for the most part like it. But... I used their Java IDE for years (it totally rocks, highly recommended), so I it is very comfortable to use PyCharm. One thing that bugs me in refactoring though is that renaming a method or variable does not necessarily work. It's suppose

Re: Question regarding python2.5 migration from windows xp to windows 7

2010-10-14 Thread Brian Curtin
On Thu, Oct 14, 2010 at 01:37, python_tsp wrote: > Hi, > > We have a Python based test framework which is being used in various > projects. > > Our current environment is > Python (ver 2.5.1) > wxPython (wxPython2.8-win32-ansi-2.8.6.0-py25) > pywin32-210.win32-py2.5 > vcredist_x86.exe > pyserial-

Re: Question regarding python2.5 migration from windows xp to windows 7

2010-10-14 Thread CM
On Oct 14, 2:37 am, python_tsp wrote: > Hi, > > We have a Python based test framework which is being used in various > projects. > > Our current environment is > Python (ver 2.5.1) > wxPython (wxPython2.8-win32-ansi-2.8.6.0-py25) > pywin32-210.win32-py2.5 > vcredist_x86.exe > pyserial-2.2 > > Our

Re: Does everyone keep getting recruiting emails from google?

2010-10-14 Thread James Harris
On 14 Oct, 16:49, Daniel Fetchinson wrote: > I keep getting recruiting emails from charlesngu...@google.com about > working for google as an engineer. The messages are pretty much the > same and go like this: ... > I'm guessing I'm not the only one on this list to get these emails and > suspect

Re: Boolean value of generators

2010-10-14 Thread Cameron Simpson
On 14Oct2010 14:13, Tim Chase wrote: | On 10/14/10 12:53, Paul Rubin wrote: | >Carl Banks writes: | >>In general, the only way to test if a generator is empty is to try to | >>consume an item. (It's possible to write an iterator that consumes an | >>item and caches it to be returned on the next

Re: My first Python program

2010-10-14 Thread Hallvard B Furuseth
Seebs writes: >> For long strings, another option is triple-quoting as you've seen in doc >> strings: print """foo >> bar""". > > I assume that this inserts a newline, though, and in this case I don't > want that. True. $ python >>> """foo ... bar""" 'foo\nbar' >>> """foo\

Re: Does everyone keep getting recruiting emails from google?

2010-10-14 Thread John Nagle
On 10/14/2010 8:49 AM, Daniel Fetchinson wrote: I keep getting recruiting emails from charlesngu...@google.com about working for google as an engineer. The messages are pretty much the same and go like this: I am part of the Google Staffing team and was wonde

Re: GCC process not working as expected when called in Python (3.1.2) subprocess-shell, but OK otherwise

2010-10-14 Thread Chris Rebert
On Wed, Oct 13, 2010 at 7:06 PM, Kingsley Turner wrote: >  Hi, > > I'm using GCC as a pre-processor for a C-like language (EDDL) to handle all > the includes, macros, etc. producing a single source file for another > compiler.  My python code massages the inputs (which arrive in a .zip file), > th

Re: RE: Hyperlink to a file using python

2010-10-14 Thread Dave Angel
On 2:59 PM, Pratik Khemka wrote: I think I did not frame the question in a proper manner.. I want to open pratik.html which is there in the same folder as the python program. I do not want to specify the path like you can see below in the code (blue) c:\Documents and Settings\My Documents

Re: what happens to Popen()'s parent-side file descriptors?

2010-10-14 Thread Seebs
On 2010-10-14, Roger Davis wrote: > Seebs, you are of course correct that the example I quoted (`cat | > grep | whatever`) is best done internally with the re module and built- > in language features, and in fact that has already been done wherever > possible. I should have picked a better example

Re: GCC process not working as expected when called in Python (3.1.2) subprocess-shell, but OK otherwise

2010-10-14 Thread Diez B. Roggisch
Kingsley Turner writes: > Hi, > > I'm using GCC as a pre-processor for a C-like language (EDDL) to > handle all the includes, macros, etc. producing a single source file > for another compiler. My python code massages the inputs (which > arrive in a .zip file), then calls GCC. > > I have a prob

Re: My first Python program

2010-10-14 Thread Seebs
On 2010-10-14, Hallvard B Furuseth wrote: > A class which holds an OS resource like a file, should provide a context > manager and/or a release function, the latter usually called in a > 'finally:' block. When the caller doesn't bother with either, the class > often might as well depend on the de

Re: python/c api

2010-10-14 Thread Diez B. Roggisch
Tony writes: > hi, > > is the python/c api extensively used? and what world-famous software > use it? thanks! It is, for a lot of extensions for python, and a lot of embedding python into a software. For example Ableton Live, an audio sequencer. Arc GIS has it, and the Eve Online. Many more do,

Re: Does everyone keep getting recruiting emails from google?

2010-10-14 Thread Seebs
On 2010-10-14, Daniel Fetchinson wrote: > I keep getting recruiting emails from charlesngu...@google.com about > working for google as an engineer. I've gotten one of those, ever, and it named a specific person who had referred me. (It turns out to be a moot point, $DAYJOB has telecommuting, and

Re: processing input from multiple files

2010-10-14 Thread John Posner
On 10/14/2010 10:44 AM, Christopher Steele wrote: The issue is that I need to be able to both, split the names of the files so that I can extract the relevant times, and open each individual file and process each line individually. Once I have achieved this I need to append the sorted files ont

VipIMAGE 2011 – ECCOMAS Thematic Conference - FIRS T ANNOUNCE

2010-10-14 Thread tava...@fe.up.pt
--- International ECCOMAS Thematic Conference VipIMAGE 2011 - III ECCOMAS THEMATIC CONFERENCE ON COMPUTATIONAL VISION AND MEDICAL IMAGE PROCESSING 12-14th October 2011,

Re: Boolean value of generators

2010-10-14 Thread Tim Chase
On 10/14/10 12:53, Paul Rubin wrote: Carl Banks writes: In general, the only way to test if a generator is empty is to try to consume an item. (It's possible to write an iterator that consumes an item and caches it to be returned on the next next(), and whose boolean status indicates if there'

GCC process not working as expected when called in Python (3.1.2) subprocess-shell, but OK otherwise

2010-10-14 Thread Kingsley Turner
Hi, I'm using GCC as a pre-processor for a C-like language (EDDL) to handle all the includes, macros, etc. producing a single source file for another compiler. My python code massages the inputs (which arrive in a .zip file), then calls GCC. I have a problem where if I call GCC from my pyt

Re: Boolean value of generators

2010-10-14 Thread Albert Hopkins
On Thu, 2010-10-14 at 10:16 +0100, Tony wrote: > I have been using generators for the first time and wanted to check for > an empty result. Naively I assumed that generators would give > appopriate boolean values. For example > > def xx(): > l = [] > for x in l: > yield x > > y = xx() >

Re: Hyperlink to a file using python

2010-10-14 Thread MRAB
On 14/10/2010 18:54, Pratik Khemka wrote: I think I did not frame the question in a proper manner.. I want to open pratik.html which is there in the same folder as the python program. I do not want to specify the path like you can see below in the code (blue) *_c:\Documents_ and Settings\My Doc

Re: Help needed - To get path of a directory

2010-10-14 Thread Emmanuel Surleau
> Dear Emmanuel, > > Thank you for your reply. > Actually what I want to do is, at the run time I want to know the location > of a specific directory. > Then I will add some file name to the path and load the file. > The directory can reside in any drive, depending on the user. Well... If you don

Re: Re: Re: UTF-8 problem encoding and decoding in Python3

2010-10-14 Thread hidura
Finally did it, thank you all for your help, the code i will upload because can be used by Python 3 for handle the wsgi issue of the Bytes! Almar, sorry for the mails gmails sometimes sucks!! On Oct 14, 2010 1:00pm, hid...@gmail.com wrote: Finally did it, thank you all for your help, the code i

python/c api

2010-10-14 Thread Tony
hi, is the python/c api extensively used? and what world-famous software use it? thanks! tony -- http://mail.python.org/mailman/listinfo/python-list

Re: Boolean value of generators

2010-10-14 Thread Paul Rubin
Carl Banks writes: > In general, the only way to test if a generator is empty is to try to > consume an item. (It's possible to write an iterator that consumes an > item and caches it to be returned on the next next(), and whose > boolean status indicates if there's an item left. ...) I remember

RE: Hyperlink to a file using python

2010-10-14 Thread Pratik Khemka
I think I did not frame the question in a proper manner.. I want to open pratik.html which is there in the same folder as the python program. I do not want to specify the path like you can see below in the code (blue) c:\Documents and Settings\My Documents..The reason for this is that I wan

Re: Does everyone keep getting recruiting emails from google?

2010-10-14 Thread Matteo Landi
I got one a couple of months ago. I answered back I was interested and then we scheduled a phone conversation. Good luck, Matteo On Thu, Oct 14, 2010 at 5:58 PM, Grant Edwards wrote: > On 2010-10-14, Daniel Fetchinson wrote: > >> I keep getting recruiting emails from charlesngu...@google.com ab

Re: Boolean value of generators

2010-10-14 Thread Carl Banks
On Oct 14, 6:36 am, Peter Otten <__pete...@web.de> wrote: > * I would recommend that you avoid the above approach. Pythonic solutions > favour EAFP (http://docs.python.org/glossary.html#term-eafp) over look- > before-you-leap: > > try: >     value = next(y) > except StopIteration: >     print "ran

Re: Boolean value of generators

2010-10-14 Thread Carl Banks
On Oct 14, 2:16 am, Tony wrote: > I have been using generators for the first time and wanted to check for > an empty result.  Naively I assumed that generators would give > appopriate boolean values.  For example > > def xx(): >   l = [] >   for x in l: >     yield x > > y = xx() > bool(y) > > I e

Re: what happens to Popen()'s parent-side file descriptors?

2010-10-14 Thread Chris Torek
In article <8bec27dd-b1da-4aa3-81e8-9665db040...@n40g2000vbb.googlegroups.com> >'Nobody' (clearly a misnomer!) and Chris, thanks for your excellent >explanations about garbage collection. (Chris, I believe you must have >spent more time looking at the subprocess source and writing your >response th

Re: Scheme as a virtual machine?

2010-10-14 Thread namekuseijin
On 14 out, 00:26, Ertugrul Söylemez wrote: > BTW, you mentioned symbols ('$', '.' and '>>='), which are not syntactic > sugar at all.  They are just normal functions, for which it makes sense > to be infix.  The fact that you sold them as syntactic sugar or > "perlisms" proves that you have no ide

Re: [Eric] ANN: automated daily snapshot builds for PyQt and friend on openSUSE build service

2010-10-14 Thread Detlev Offenbach
On Donnerstag, 14. Oktober 2010, Hans-Peter Jansen wrote: > [Sorry for cross posting] > > Hi PyQtnistas, > > I proudly announce the availability of automated builds of the most > current PyQt and related packages including snapshots on openSUSEs > build service for openSUSE 11.1, 11.2 and 11.3, h

Re: multiple assignments (was: My first Python program)

2010-10-14 Thread Ian Kelly
On Wed, Oct 13, 2010 at 3:53 PM, Ethan Furman wrote: > Ian Kelly wrote: > >> here is an example >> where the order of assignment actually matters: >> >> >>> d['a'] = d = {} >> Traceback (most recent call last): >> File "", line 1, in >> NameError: name 'd' is not defined >> >>> d = d['a'] =

Re: Does everyone keep getting recruiting emails from google?

2010-10-14 Thread Grant Edwards
On 2010-10-14, Daniel Fetchinson wrote: > I keep getting recruiting emails from charlesngu...@google.com about > working for google as an engineer. The messages are pretty much the > same and go like this: I got one a year or two back (from somebody else at google). I replied saying that I wasn

Re: what happens to Popen()'s parent-side file descriptors?

2010-10-14 Thread Roger Davis
Many thanks to all who responded to my question! It's nice to know, as someone new to Python, that there are lots of well-informed people out there willing to help with such issues. Thanks, Mike, for your pipes suggestion, I will keep that in mind for future projects. Seebs, you are of course cor

Does everyone keep getting recruiting emails from google?

2010-10-14 Thread Daniel Fetchinson
I keep getting recruiting emails from charlesngu...@google.com about working for google as an engineer. The messages are pretty much the same and go like this: I am part of the Google Staffing team and was wondering if you would be open to exploring engineering

imaplib AND date format

2010-10-14 Thread harryos
In imaplib.IMAP4.search() the search string SENTON can be used '(SENTON 22-Jun-2010)' . But the RFC 2060 defines search key as SENTON Messages whose [RFC-822] Date: header is within the specified date. and in RFC822 it is given as, date= 1*2DIGIT month 2DIGIT

Excellent website for IT professionals

2010-10-14 Thread It_wise
Excellent website for IT professionals. http://digg.com/news/technology/what_is_CISCO_CCNA_Boot_Camp Good luck. -- http://mail.python.org/mailman/listinfo/python-list

Re: Question regarding python2.5 migration from windows xp to windows 7

2010-10-14 Thread nn
On Oct 14, 2:37 am, python_tsp wrote: > Hi, > > We have a Python based test framework which is being used in various > projects. > > Our current environment is > Python (ver 2.5.1) > wxPython (wxPython2.8-win32-ansi-2.8.6.0-py25) > pywin32-210.win32-py2.5 > vcredist_x86.exe > pyserial-2.2 > > Our

Re: processing input from multiple files

2010-10-14 Thread John Posner
On 10/14/2010 6:08 AM, Christopher Steele wrote: Hi I've been trying to decode a series of observations from multiple files (each file is a different time) and put each type of observation into their own separate file. The script runs successfully for one file but whenever I try it for more they

Re: processing input from multiple files

2010-10-14 Thread Christopher Steele
The issue is that I need to be able to both, split the names of the files so that I can extract the relevant times, and open each individual file and process each line individually. Once I have achieved this I need to append the sorted files onto one another in one long file so that I can pass them

Re: send command to parent shell

2010-10-14 Thread Giampaolo Rodolà
Sorry I realize now that you wrote "how to send a command to the shell" and not "how to kill the shell". In this case I don't know exactly what you mean. Regards, --- Giampaolo http://code.google.com/p/pyftpdlib/ http://code.google.com/p/psutil/ 2010/10/14 Giampaolo Rodolà : > On Wed, 13 Oct 2

Re: send command to parent shell

2010-10-14 Thread Giampaolo Rodolà
On Wed, 13 Oct 2010 06:30:15 -0700, Martin Landa wrote: > is there a way how to send command from python script to the shell > (known id) from which the python script has been called? By using psutil (http://code.google.com/p/psutil/): giampa...@ubuntu:~$ python Python 2.6.6 (r266:84292, Sep 15 2

Re: Boolean value of generators

2010-10-14 Thread Peter Otten
Tony wrote: > I have been using generators for the first time and wanted to check for > an empty result. Naively I assumed that generators would give > appopriate boolean values. For example > > def xx(): > l = [] > for x in l: > yield x > > y = xx() > bool(y) > > > I expected the la

Re: My first Python program

2010-10-14 Thread Hallvard B Furuseth
Seebs writes: >> You can't really rely on the destructor __del__ being called. > > Interesting. Do I just rely on files getting closed? Sometimes, but that's not it. Think Lisp, not C++. __del__ is not that useful. Python is garbage-collected and variables have dynamic lifetime, so the class c

Re: Boolean value of generators

2010-10-14 Thread Cameron Simpson
On 14Oct2010 10:16, Tony wrote: | I have been using generators for the first time and wanted to check for | an empty result. Naively I assumed that generators would give | appopriate boolean values. For example | | def xx(): | l = [] | for x in l: | yield x | | y = xx() | bool(y) | |

Re: Scheme as a virtual machine?

2010-10-14 Thread Pascal J. Bourguignon
namekuseijin writes: > On 13 out, 19:41, p...@informatimago.com (Pascal J. Bourguignon) > wrote: >> namekuseijin writes: >> > On 11 out, 08:49, Oleg  Parashchenko wrote: >> >> Hello, >> >> >> I'd like to try the idea that Scheme can be considered as a new >> >> portable assembler. We could code

Re: Performance evaluation of HTTPS library

2010-10-14 Thread Antoine Pitrou
On Thu, 14 Oct 2010 05:06:30 -0700 (PDT) Ashish wrote: > > One more question: If I run the tool from multicore machine, will > python3.1 or 3.2 be able to actually use multicore? or it will be > running only on one core? Only partly. Pure Python code is serialized (by the Global Interpreter Lock

Re: PEP 249 (database api) -- executemany() with iterable?

2010-10-14 Thread Martin Gregorie
On Thu, 14 Oct 2010 16:36:34 +1300, Lawrence D'Oliveiro wrote: > In message <4cb5e659$0$1650$742ec...@news.sonic.net>, John Nagle wrote: > >> Also note that there are some issues with doing a huge volume of >> updates in one MySQL InnoDB transaction. The system has to keep the >> data neede

ANN: A new version (0.2.5) of the Python module which wraps GnuPG has been released.

2010-10-14 Thread Vinay Sajip
A new version of the Python module which wraps GnuPG has been released. What Changed? = This is a minor enhancement and bug-fix release. See the project website ( http://code.google.com/p/python-gnupg/ ) for more information. Summary: Detached signatures can now be created and verifie

Re: Performance evaluation of HTTPS library

2010-10-14 Thread Ashish
On Oct 13, 6:12 pm, Antoine Pitrou wrote: > On Wed, 13 Oct 2010 05:27:29 -0700 (PDT)Ashish wrote: > > > Well, CBSocket is socket implementation that calls my callback on > > data. > > Both my classes AsyncHTTPSConnection and AsyncHTTPConnection use it > > and use it the same way ( self.sock = CBS

Re: socket problem and html problem

2010-10-14 Thread Stefan Behnel
bussiere bussiere, 11.10.2010 08:30: here is my code and two questions : why it says to me that i can't bind the socket ? normally it had closed it and kill it :/ and why it returns me plain text and not html ? I think the reason why no-one answered yet is that it's not immediately clear what

Boolean value of generators

2010-10-14 Thread Tony
I have been using generators for the first time and wanted to check for an empty result. Naively I assumed that generators would give appopriate boolean values. For example def xx(): l = [] for x in l: yield x y = xx() bool(y) I expected the last line to return False but it actually r

Re: send command to parent shell

2010-10-14 Thread Diez B. Roggisch
Martin Landa writes: > Hi, > > is there a way how to send command from python script to the shell > (known id) from which the python script has been called? More > precisely, the goal is to exit running bash (on Linux) or cmd (on > Windows) directly from wxPython application, currently user needs

Re: "Strong typing vs. strong testing" [OT]

2010-10-14 Thread Arnaud Delobelle
Steven D'Aprano writes: > On Wed, 13 Oct 2010 21:52:54 +0100, Arnaud Delobelle wrote: >> >> Given two circles with radii r1 and r2, circumferences C1 and C2, one is >> obviously the scaled-up version of the other, therefore the ratio of >> their circumferences is equal to the ratio of their radi

Re: PEP 249 (database api) -- executemany() with iterable?

2010-10-14 Thread M.-A. Lemburg
Terry Reedy wrote: > On 10/12/2010 11:10 AM, Roy Smith wrote: >> PEP 249 says about executemany(): >> >> Prepare a database operation (query or command) and then >> execute it against all parameter sequences or mappings >> found in the sequence seq_of_parameters. >> >> ar

ANN: automated daily snapshot builds for PyQt and friend on openSUSE build service

2010-10-14 Thread Hans-Peter Jansen
[Sorry for cross posting] Hi PyQtnistas, I proudly announce the availability of automated builds of the most current PyQt and related packages including snapshots on openSUSEs build service for openSUSE 11.1, 11.2 and 11.3, here: https://build.opensuse.org/project/monitor?project=home%3Afrispe

Re: Whining about "struct"

2010-10-14 Thread Brendan Simon (eTRIX)
On 14/10/10 5:17 PM, python-list-requ...@python.org wrote: > Subject: > Whining about "struct" > From: > Tim Roberts > Date: > Wed, 13 Oct 2010 21:30:38 -0700 > > To: > python-list@python.org > > > I have a bad memory. I admit it. Because of that, the Python "help" > system is invaluable to me.

processing input from multiple files

2010-10-14 Thread Christopher Steele
Hi I've been trying to decode a series of observations from multiple files (each file is a different time) and put each type of observation into their own separate file. The script runs successfully for one file but whenever I try it for more they just overwrite each other. I'm new to python and I

Re: "Strong typing vs. strong testing" [OT]

2010-10-14 Thread Gregory Ewing
Steven D'Aprano wrote: under Euclidean geometry, there was a time when people didn't know whether or not the ratio of circumference to radius was or wasn't a constant, and proving that it is a constant is non-trivial. I'm not sure that the construction you mentioned proves that either, becaus

Re: multiple assignments

2010-10-14 Thread Ben Finney
Ethan Furman writes: > Ah! I was thinking the assignments went in a filter fashion, but now > what I think is happening is that the first item is bound to the last, > then the next item is bound to the last, etc, etc. > > Is this correct? Assignment is always the same direction: the rightmost o

Get alternative char name with unicodedata.name() if no formal one defined

2010-10-14 Thread Dirk Wallenstein
Hi, I'd like to get control char names for the first 32 codepoints, but they apparently only have an alias and no official name. Is there a way to get the alternative character name (alias) in Python? -- Greetings, Dirk -- http://mail.python.org/mailman/listinfo/python-list

Re: Using csv.DictReader with \r\n in the middle of fields

2010-10-14 Thread pstatham
On Oct 13, 4:01 pm, Neil Cerutti wrote: > On 2010-10-13, pstatham wrote: > > > Hopefully this will interest some, I have a csv file (can be > > downloaded fromhttp://www.paulstathamphotography.co.uk/45.txt) which > > has five fields separated by ~ delimiters. To read this I've been > > using a cs

Re: Whining about "struct"

2010-10-14 Thread Tim Golden
On 14/10/2010 05:30, Tim Roberts wrote: I have a bad memory. I admit it. Because of that, the Python "help" system is invaluable to me. Up through Python 2.5, I could get a quick reference to the format specifiers for the struct module via import struct; help(struct) I used that a LOT. Bu

Re: Help needed - To get path of a directory

2010-10-14 Thread Tim Golden
On 13/10/10 15:26, Bishwarup Banerjee wrote: I want to get the absolute path of the Directory I pass explicitly. Like functionName("\abcd"). On 13/10/2010 05:44, Kingsley Turner wrote: One way to achieve this is to fetch a recursive directory list for all drives, and then search for your direc

Re: "Strong typing vs. strong testing" [OT]

2010-10-14 Thread Antoon Pardon
On Wed, Oct 13, 2010 at 07:31:59PM +, Steven D'Aprano wrote: > On Wed, 13 Oct 2010 16:17:19 +0200, Antoon Pardon wrote: > > > On Wed, Oct 13, 2010 at 01:20:30PM +, Steven D'Aprano wrote: > >> On Tue, 12 Oct 2010 22:13:26 -0700, RG wrote: > >> > >> >> The formula: circumference = 2 x pi x

  1   2   >