apipkg-1.0 controling exported API + lazy importing

2010-10-14 Thread holger krekel
Hi, i just released apipkg-1.0, an around 100 LOC module for easy importing of export-controled namespaces. So far, it's successfully used in tox, pylib and a few other projects. With apipkg you can control the exported namespace of a Python package and greatly reduce the number of imports

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

Re: Whining about struct

2010-10-14 Thread Ned Deily
In article am1db6h9dh3abep1g3s21bqf3172fa3...@4ax.com, Tim Roberts t...@probo.com 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

Python, Windows, and file sockets

2010-10-14 Thread culix
Hey list, I have a question about unix-style file sockets and/or named pipes with python. I have a linux server program that uses a file socket to listen for connections. It has been ported to Windows with cygwin (I'm running WinXP SP3). On linux I have a python script that acts as a client - it

Question regarding python migration

2010-10-14 Thread Pramod Thirthachar Sridhar
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 Framework is being currently used in Windows XP.

Question regarding python migration

2010-10-14 Thread Pramod Thirthachar Sridhar
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 Framework is being currently used in Windows XP.

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

2010-10-14 Thread Chris Torek
In article b166181a-2aba-4c3a-948d-674755459...@c10g2000yqh.googlegroups.com Roger Davis r...@hawaii.edu wrote: My understanding is that this functionality is best coded via subprocess.Popen(). Best is always a big question mark. :-) I need to read output from these spawned children via a pipe

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

2010-10-14 Thread python_tsp
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 Framework is being currently used in Windows XP. The issue

Re: Eclipse/PyDev - BOM Lexical Error

2010-10-14 Thread Steven D'Aprano
On Thu, 14 Oct 2010 16:41:13 +1300, Lawrence D'Oliveiro wrote: In message mailman.1544.1286800257.29448.python-l...@python.org, Ethan Furman wrote: Lawrence D'Oliveiro wrote: In message mailman.1533.1286774527.29448.python-l...@python.org, Ethan Furman wrote: Lawrence D'Oliveiro wrote:

multiple assignments (was: My first Python program)

2010-10-14 Thread Ethan Furman
Ian Kelly wrote: here is an example where the order of assignment actually matters: d['a'] = d = {} Traceback (most recent call last): File stdin, line 1, in module NameError: name 'd' is not defined d = d['a'] = {} d {'a': {...}} As you can see, they're assigned left-to-right.

Re: Whining about struct

2010-10-14 Thread Lawrence D'Oliveiro
In message am1db6h9dh3abep1g3s21bqf3172fa3...@4ax.com, Tim Roberts wrote: I have a bad memory. I admit it. Because of that, the Python help system is invaluable to me. I’ve tried using that occasionally, but found it’s easier by far to have a Web page open with full documentation that I can

Re: help!!!

2010-10-14 Thread Lawrence D'Oliveiro
In message mailman.1595.1286847515.29448.python-l...@python.org, Jorge Biquez wrote: I was a teacher of Computer Sciences for some years in my case, women were better programming than men. but sure, on the IT industry the percentage of men is a lot more than the one of women. Why?

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

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

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

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 ne...@norwich.edu wrote: On 2010-10-13, pstatham pstat...@sefas.com 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

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

2010-10-14 Thread Ben Finney
Ethan Furman et...@stoneleaf.us 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:

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,

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

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 t...@probo.com 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.

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:

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. are there any

Re: Strong typing vs. strong testing [OT]

2010-10-14 Thread Arnaud Delobelle
Steven D'Aprano steve-remove-t...@cybersource.com.au 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

Re: send command to parent shell

2010-10-14 Thread Diez B. Roggisch
Martin Landa landa.mar...@gmail.com 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,

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

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

Re: Performance evaluation of HTTPS library

2010-10-14 Thread Ashish
On Oct 13, 6:12 pm, Antoine Pitrou solip...@pitrou.net wrote: On Wed, 13 Oct 2010 05:27:29 -0700 (PDT)Ashish amvya...@gmail.com wrote: Well, CBSocket is socket implementation that calls my callback on data. Both my classes AsyncHTTPSConnection and AsyncHTTPConnection use it and use it

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

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 needed to undo

Re: Performance evaluation of HTTPS library

2010-10-14 Thread Antoine Pitrou
On Thu, 14 Oct 2010 05:06:30 -0700 (PDT) Ashish amvya...@gmail.com 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

Re: Scheme as a virtual machine?

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

Re: Boolean value of generators

2010-10-14 Thread Cameron Simpson
On 14Oct2010 10:16, Tony ton...@ximera.net 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 =

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

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 last line to

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

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à g.rod...@gmail.com: On

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

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

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 pramod...@gmail.com 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

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

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 date Messages whose [RFC-822] Date: header is within the specified date. and in RFC822 it is given as, date= 1*2DIGIT month 2DIGIT

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

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

Re: Does everyone keep getting recruiting emails from google?

2010-10-14 Thread Grant Edwards
On 2010-10-14, Daniel Fetchinson fetchin...@googlemail.com 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

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 et...@stoneleaf.us wrote: Ian Kelly wrote: here is an example where the order of assignment actually matters: d['a'] = d = {} Traceback (most recent call last): File stdin, line 1, in module NameError: name 'd' is not defined d =

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

Re: Scheme as a virtual machine?

2010-10-14 Thread namekuseijin
On 14 out, 00:26, Ertugrul Söylemez e...@ertes.de 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

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

Re: Boolean value of generators

2010-10-14 Thread Carl Banks
On Oct 14, 2:16 am, Tony ton...@ximera.net 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: 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 out of

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 inva...@invalid.invalid wrote: On 2010-10-14, Daniel Fetchinson fetchin...@googlemail.com wrote: I keep getting

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

Re: Boolean value of generators

2010-10-14 Thread Paul Rubin
Carl Banks pavlovevide...@gmail.com 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

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

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

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

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() bool(y)

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

Re: Boolean value of generators

2010-10-14 Thread Tim Chase
On 10/14/10 12:53, Paul Rubin wrote: Carl Bankspavlovevide...@gmail.com 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

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

Re: Does everyone keep getting recruiting emails from google?

2010-10-14 Thread Seebs
On 2010-10-14, Daniel Fetchinson fetchin...@googlemail.com 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,

Re: python/c api

2010-10-14 Thread Diez B. Roggisch
Tony tonywinslow1...@gmail.com 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

Re: My first Python program

2010-10-14 Thread Seebs
On 2010-10-14, Hallvard B Furuseth h.b.furus...@usit.uio.no 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

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 kingsley.tur...@openfieldcommunications.com 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

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

2010-10-14 Thread Seebs
On 2010-10-14, Roger Davis r...@hawaii.edu 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

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

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 kingsley.tur...@openfieldcommunications.com 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

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

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\ ... bar 'foobar'

Re: Boolean value of generators

2010-10-14 Thread Cameron Simpson
On 14Oct2010 14:13, Tim Chase python.l...@tim.thechases.com wrote: | On 10/14/10 12:53, Paul Rubin wrote: | Carl Bankspavlovevide...@gmail.com 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 |

Re: Does everyone keep getting recruiting emails from google?

2010-10-14 Thread James Harris
On 14 Oct, 16:49, Daniel Fetchinson fetchin...@googlemail.com 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

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 pramod...@gmail.com 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

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 pramod...@gmail.com 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

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

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

Re: Boolean value of generators

2010-10-14 Thread Carl Banks
On Oct 14, 10:53 am, Paul Rubin no.em...@nospam.invalid wrote: Carl Banks pavlovevide...@gmail.com 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

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

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

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

Re: PyCharm

2010-10-14 Thread alex23
Jeffrey Gaynor jgay...@ncsa.uiuc.edu 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

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 hals...@t-online.de 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

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: Help with sets

2010-10-14 Thread Steve Howell
On Oct 14, 4:09 pm, Gregory Ewing greg.ew...@canterbury.ac.nz 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

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

2010-10-14 Thread Steve Howell
On Oct 13, 8:32 pm, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message d2451907-c0d2-4571-b3e1-1e4d4f66a...@a7g2000prb.googlegroups.com, Steve Howell wrote: Bulk-load strategies usually solve one or more of these problems:  network latency That’s not an issue. This

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 in

Re: Compiling as 32bit on MacOSX

2010-10-14 Thread Ned Deily
In article 8hpgn7fho...@mid.individual.net, Gregory Ewing greg.ew...@canterbury.ac.nz 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

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

Re: Boolean value of generators

2010-10-14 Thread Paul Rubin
Steven D'Aprano st...@remove-this-cybersource.com.au 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

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

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 Steve Howell
On Oct 14, 7:08 pm, Paul Rubin no.em...@nospam.invalid wrote: Steven D'Aprano st...@remove-this-cybersource.com.au 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

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 krishnan.snowboar...@gmail.com

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

Re: toy list processing problem: collect similar terms

2010-10-14 Thread Xah Lee
On Sep 25, 9:05 pm, Xah Lee xah...@gmail.com 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)

Re: extract method with generators

2010-10-14 Thread Cameron Simpson
On 14Oct2010 20:11, Steve Howell showel...@yahoo.com 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

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

2010-10-14 Thread Lawrence D'Oliveiro
In message mailman.1711.1287055174.29448.python-l...@python.org, 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.

  1   2   3   >