Re: Suggested coding style

2011-09-27 Thread DevPlayer
On Sep 25, 11:41 pm, Chris Angelico ros...@gmail.com wrote: On Mon, Sep 26, 2011 at 12:59 PM, Tim Johnson t...@akwebsoft.com wrote: BTW: If you like ranting as a spectator sport, I have found the  Common Lisp newsgroup to be among the most spectacular. But that's  just me. I do, actually,

Re: Suggested coding style

2011-09-27 Thread DevPlayer
By the way OP Passiday the title of the topic is Suggested coding style. Are you suggesting a coding style or asking for a Python coding style or are you asking what IS the Python coding style. If you are asking what is the Python coding style. Google The Zen of Python. It's pretty much the

Re: Race condition deadlock in communicate when threading?

2011-09-27 Thread Carl Banks
There's really not enough information for us to debug this, but one possibility is that your subprocess is using buffered I/O; you're expecting the external task to write a string, but it doesn't actually write that string because it's sitting in a buffer. First thing to try is to see if the

Error 'module' object has no attribute _extension_registry when cPickle is imported from an installed Python 2.7.1

2011-09-27 Thread Wong Wah Meng-R32813
Hello all, I encounter this issue whereby I am not able to load cPickle module into the python I newly built. There is no issue when I load it right from the folder where the python executable and libpython2.7.so is built. However, it gives me this error when I load the same module using the

Error 'No module named _sha256' when importing random in python 2.7.1

2011-09-27 Thread Wong Wah Meng-R32813
I just built python 2.7.1 on my HP Itanium 64-bit platform, using aCC. I encountered following issue when importing the random module. Does anyone know why am I getting this error? Thanks in advance for your reply. $ python Python 2.7.1 (r271:86832, Sep 27 2011, 15:19:26) [C] on hp-ux11 Type

Re: Error 'No module named _sha256' when importing random in python 2.7.1

2011-09-27 Thread Chris Rebert
On Tue, Sep 27, 2011 at 2:28 AM, Wong Wah Meng-R32813 r32...@freescale.com wrote: I just built python 2.7.1 on my HP Itanium 64-bit platform, using aCC. I encountered following issue when importing the random module. Does anyone know why am I getting this error? Thanks in advance for your

RE: Error 'No module named _sha256' when importing random in python 2.7.1

2011-09-27 Thread Wong Wah Meng-R32813
Yes I did. In fact earlier make test failed to execute due to _sha256 not found in one of the module testing. Earlier I ignored these failures from the build and make test as I thought they are not needed by my application. Now I can't use random module in my application. So I need to solve

error when use portable python 2.7.2

2011-09-27 Thread yixuan
Hello, I copy python 2.7.2 folder from other machine to my new installed Windows XP. If I run python.exe it would say side by side error, it is caused by crt environment. I copy msvc90 runtime and manifest into my folder, python.exe seems working now. But when I used 'import FixTk', it would say

Re: error when use portable python 2.7.2

2011-09-27 Thread Alec Taylor
You're looking for this: http://www.portablepython.com/wiki/PortablePython2.7.2.1 On Tue, Sep 27, 2011 at 8:48 PM, yixuan yixuan...@gmail.com wrote: Hello, I copy python 2.7.2 folder from other machine to my new installed Windows XP. If I run python.exe it would say side by side error, it is

atexit handlers - getting the return code

2011-09-27 Thread Mike Hull
Hi, I work in neuroscience modelling and use python for lots of my work. One problem I have is management of scripts and results. To that end, I have written code that make its easier to keep track of scripts, to see which ones have run, or need to be rerun, to see output errors and generally

Re: error when use portable python 2.7.2

2011-09-27 Thread yixuan
On Sep 27, 7:01 pm, Alec Taylor alec.tayl...@gmail.com wrote: You're looking for this:http://www.portablepython.com/wiki/PortablePython2.7.2.1 On Tue, Sep 27, 2011 at 8:48 PM, yixuan yixuan...@gmail.com wrote: Hello, I copy python 2.7.2 folder from other machine to my new installed

Re: install packages with pip to older Python versions

2011-09-27 Thread David Robinow
On Mon, Sep 26, 2011 at 4:39 PM, Jabba Laci jabba.l...@gmail.com wrote: Hi, I have Python 2.7 on my system. Today I wanted to try Google App Engine but it runs on Python 2.5 at Google so I installed this version on my machine next to v2.7 to avoid compatibility problems. However, when I

Re: error when use portable python 2.7.2

2011-09-27 Thread Nizamov Shawkat
I bet that the difference is in the environment settings (PYTHONPATH). Look here for details how to set it manually: http://docs.python.org/using/windows.html Hope it helps, S.Nizamov -- http://mail.python.org/mailman/listinfo/python-list

Re: atexit handlers - getting the return code

2011-09-27 Thread Giampaolo Rodolà
You mean the registered function return value or the process return code? In the first case you can do something such as: import atexit @atexit.register def cleanup(): def actual_function(): ... return something ret = actual_function() # do something with ret

Re: atexit handlers - getting the return code

2011-09-27 Thread Mike Hull
Hi Giampaolo, Sorry, I didn't explain very clearly. I have a python file, 'simulation_logger.py', (given below). Then, in my scripts, I add the following lines to the top, #simulation1.py: ### from simulation_logger import SimulationDecorator SimulationDecorator.Init() # Rest

Re: ANN: Intro+Intermediate Python course, SF, Oct 18-20

2011-09-27 Thread wesley chun
** FINAL CALL ** http://sfbay.craigslist.org/sfc/cls/2495963854.html -- Forwarded message -- From: wesley chun wes...@gmail.com Date: Mon, Jul 25, 2011 at 12:32 PM Subject: ANN: Intro+Intermediate Python course, SF, Oct 18-20 Need to get up-to-speed with Python as quickly and

Re: Wrote a new library - Comments and suggestions please!

2011-09-27 Thread Tal Einat
I don't work with SAS so I have no reason to invest any time developing for it. Also, as far as I can tell, SAS is far from free or open-source, meaning I definitely am not interested in developing for it. My library solves a problem for which there is no existing solution in the world of

Re: Wrote a new library - Comments and suggestions please!

2011-09-27 Thread Robert Kern
On 9/27/11 10:24 AM, Tal Einat wrote: I don't work with SAS so I have no reason to invest any time developing for it. Also, as far as I can tell, SAS is far from free or open-source, meaning I definitely am not interested in developing for it. I don't think he's suggesting that you drop what

Re: QA Engineering/ Python/ Contract/ Austin, TX

2011-09-27 Thread Robert Kern
On 9/26/11 5:03 PM, Chris Rebert wrote: On Mon, Sep 26, 2011 at 1:56 PM, TOMtgug...@bex.net wrote: Tom Gugger Independent Recruiter tgug...@bex.net US Citizens or Greencard On Site QA Engineering/ Python/ Contract/ Austin, TX This is an immediate start, such as next week. I need three

Re: atexit handlers - getting the return code

2011-09-27 Thread Robert Kern
On 9/27/11 9:37 AM, Mike Hull wrote: Hi Giampaolo, Sorry, I didn't explain very clearly. I have a python file, 'simulation_logger.py', (given below). Then, in my scripts, I add the following lines to the top, #simulation1.py: ### from simulation_logger import

Multiplication error in python

2011-09-27 Thread sakthi
In the following code, l=[1,2,3,4,5] i=0 for a in l: ... p=2*a ... t=p+i ... i=t ... t 45 Python gives an answer as 45. But i am getting 30 when i execute manually. Is there any different multiplication pattern in python? Thank yu. --

Re: Wrote a new library - Comments and suggestions please!

2011-09-27 Thread Steven D'Aprano
Robert Kern wrote: On 9/27/11 10:24 AM, Tal Einat wrote: I don't work with SAS so I have no reason to invest any time developing for it. Also, as far as I can tell, SAS is far from free or open-source, meaning I definitely am not interested in developing for it. I don't think he's

Re: Multiplication error in python

2011-09-27 Thread Chris Rebert
On Tue, Sep 27, 2011 at 10:21 AM, sakthi sakth...@gmail.com wrote: In the following code, l=[1,2,3,4,5] i=0 for a in l: ...     p=2*a ...     t=p+i ...     i=t ... t 45 Python gives an answer as 45. But i am getting 30 when i execute manually. Is there any different multiplication

Re: Multiplication error in python

2011-09-27 Thread nn
On Sep 27, 1:21 pm, sakthi sakth...@gmail.com wrote: In the following code, l=[1,2,3,4,5] i=0 for a in l: ...     p=2*a ...     t=p+i ...     i=t ... t 45 Python gives an answer as 45. But i am getting 30 when i execute manually. Is there any different multiplication pattern in

Re: Multiplication error in python

2011-09-27 Thread becky_lewis
I tried running your code in ipython: In [1]: l = [1,2,3,4,5] In [2]: i = 0 In [3]: for a in l: ...: p = 2 * a ...: t = p + i ...: i = t ...: In [4]: In [4]: t Out[4]: 30 The output from Python was 30, not 45. What Python version are you running? On Sep 27, 6:21 pm,

Re: Multiplication error in python

2011-09-27 Thread Gary Herron
On 09/27/2011 10:21 AM, sakthi wrote: In the following code, l=[1,2,3,4,5] i=0 for a in l: ... p=2*a ... t=p+i ... i=t ... t 45 Python gives an answer as 45. But i am getting 30 when i execute manually. Is there any different multiplication pattern in python? Thank yu. I think

Re: Multiplication error in python

2011-09-27 Thread sakthi
On Sep 27, 1:43 pm, Chris Rebert c...@rebertia.com wrote: On Tue, Sep 27, 2011 at 10:21 AM, sakthi sakth...@gmail.com wrote: In the following code, l=[1,2,3,4,5] i=0 for a in l: ...     p=2*a ...     t=p+i ...     i=t ... t 45 Python gives an answer as 45. But i am getting

Re: Multiplication error in python

2011-09-27 Thread Alysson Bruno (WebSite)
In my python 3.2, no problem: l=[1,2,3,4,5] i=0 for a in l: ... p=2*a ... t=p+i ... i=t ... print(p={}, t={}, i={}.format(p,t,i)) ... p=2, t=2, i=2 p=4, t=6, i=6 p=6, t=12, i=12 p=8, t=20, i=20 p=10, t=30, i=30 t 30 paz e amor (love and peace), Alysson Bruno Palmas(TO) Brasil

Re: Multiplication error in python

2011-09-27 Thread becky_lewis
I think you may be doing something wrong. If I run: l = [1, 2, 3, 4, 5] i = 0 for a in l: ...i += 2 * a ... i 30 The result is 30 as expected. Nowhere near the 155 that you are getting. :/ Again, could you state which version of python are you using (and what OS) so that we

Re: Wrote a new library - Comments and suggestions please!

2011-09-27 Thread Mel
Steven D'Aprano wrote: I googled on SAS PROC FREQ and found this: http://support.sas.com/documentation/cdl/en/procstat/63104/HTML/default/procstat_freq_sect006.htm All the words are in English, but I have no idea what the function does, how you would call it, and what it returns. Would it

Re: atexit handlers - getting the return code

2011-09-27 Thread Mike Hull
On Sep 27, 4:59 pm, Robert Kern robert.k...@gmail.com wrote: On 9/27/11 9:37 AM, Mike Hull wrote: Hi Giampaolo, Sorry, I didn't explain very clearly. I have a python file, 'simulation_logger.py', (given below). Then, in my scripts, I add the following lines to the top,

Re: Multiplication error in python

2011-09-27 Thread Tim Daneliuk
On 9/27/2011 12:50 PM, sakthi said this: On Sep 27, 1:43 pm, Chris Rebert c...@rebertia.com wrote: On Tue, Sep 27, 2011 at 10:21 AM, sakthi sakth...@gmail.com wrote: In the following code, l=[1,2,3,4,5] i=0 for a in l: ... p=2*a ... t=p+i ... i=t ... t 45 Python gives an

Re: Wrote a new library - Comments and suggestions please!

2011-09-27 Thread Jon Clements
On Sep 27, 6:33 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: Robert Kern wrote: On 9/27/11 10:24 AM, Tal Einat wrote: I don't work with SAS so I have no reason to invest any time developing for it. Also, as far as I can tell, SAS is far from free or open-source,

Re: Suggested coding style

2011-09-27 Thread rantingrick
On Sep 27, 1:51 am, DevPlayer devpla...@gmail.com wrote: By the way OP Passiday the title of the topic is Suggested coding style. Are you suggesting a coding style or asking for a Python coding style or are you asking what IS the Python coding style. If you are asking what is the Python

Installing Python 2.6.7 on Windows

2011-09-27 Thread Wanderer
How do I install Python 2.6.7 on Windows? The Python 2.6.6 page says Python 2.6.6 has been replaced by a newer security-fix only source release of Python. Please download Python 2.6.7 instead. But there is no windows installer on the 2.6.7 page. Do I install 2.6.6 first and then update to 2.6.7?

Re: Installing Python 2.6.7 on Windows

2011-09-27 Thread Arnaud Delobelle
On 27 September 2011 21:54, Wanderer wande...@dialup4less.com wrote: How do I install Python 2.6.7 on Windows? The Python 2.6.6 page says Python 2.6.6 has been replaced by a newer security-fix only source release of Python. Please download Python 2.6.7 instead. But there is no windows

Re: Installing Python 2.6.7 on Windows

2011-09-27 Thread Brian Curtin
On Tue, Sep 27, 2011 at 15:54, Wanderer wande...@dialup4less.com wrote: How do I install Python 2.6.7 on Windows? The Python 2.6.6 page says Python 2.6.6 has been replaced by a newer security-fix only source release of Python. Please download Python 2.6.7 instead. But there is no windows

Re: Installing Python 2.6.7 on Windows

2011-09-27 Thread becky_lewis
On Sep 27, 9:54 pm, Wanderer wande...@dialup4less.com wrote: How do I install Python 2.6.7 on Windows? The Python 2.6.6 page says Python 2.6.6 has been replaced by a newer security-fix only source release of Python. Please download Python 2.6.7 instead. But there is no windows installer on

Re: Installing Python 2.6.7 on Windows

2011-09-27 Thread Wanderer
On Sep 27, 5:19 pm, becky_lewis bex.le...@gmail.com wrote: On Sep 27, 9:54 pm, Wanderer wande...@dialup4less.com wrote: How do I install Python 2.6.7 on Windows? The Python 2.6.6 page says Python 2.6.6 has been replaced by a newer security-fix only source release of Python. Please

PyCon 2012 Proposals Due October 12

2011-09-27 Thread Brian Curtin
The deadline for PyCon 2012 tutorial, talk, and poster proposals is under 15 days away, so be sure to get your submissions in by October 12, 2011. Whether you’re a first-timer or an experienced veteran, PyCon is depends on you, the community, coming together to build the best conference schedule

oauth2 server implementation

2011-09-27 Thread Aljosa Mohorovic
i'm looking for oauth2 server implementation but other than https://github.com/simplegeo/python-oauth2 (oauth v1 implementation) it doesn't seem that people are using v2 implementations. anybody using some oauth2 implementation and can share some info? Aljosa Mohorovic --

Re: Error 'module' object has no attribute _extension_registry when cPickle is imported from an installed Python 2.7.1

2011-09-27 Thread Gabriel Genellina
En Tue, 27 Sep 2011 06:08:54 -0300, Wong Wah Meng-R32813 r32...@freescale.com escribió: Hello all, I encounter this issue whereby I am not able to load cPickle module into the python I newly built. There is no issue when I load it right from the folder where the python executable and

Re: oauth2 server implementation

2011-09-27 Thread Roy Smith
In article 4c93ff75-1d85-48ec-b6d1-b71f216c6...@g33g2000yqc.googlegroups.com, Aljosa Mohorovic aljosa.mohoro...@gmail.com wrote: i'm looking for oauth2 server implementation but other than https://github.com/simplegeo/python-oauth2 (oauth v1 implementation) it doesn't seem that people are

Re: Installing Python 2.6.7 on Windows

2011-09-27 Thread Brian Curtin
On Tue, Sep 27, 2011 at 16:32, Wanderer wande...@dialup4less.com wrote: I think it is strange to release a security update but not really expect people to use it. We expect that people who need 2.6 but won't move to 2.7, and at the same time are vulnerable to the security issue(s), would be

Re: Installing Python 2.6.7 on Windows

2011-09-27 Thread Terry Reedy
On 9/27/2011 5:32 PM, Wanderer wrote: I need to stay in sink with the rest of the company which is still using 2.6 flavors. There was some investigation into going to Python 3 but not enough of the libraries we use were available. I'll install 2.6.6. I don't think the security stuff really

Re: Wrote a new library - Comments and suggestions please!

2011-09-27 Thread alex23
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: I googled on SAS PROC FREQ and found this: http://support.sas.com/documentation/cdl/en/procstat/63104/HTML/defau... All the words are in English, but I have no idea what the function does, how you would call it, and what it returns.

Re: Suggested coding style

2011-09-27 Thread alex23
rantingrick rantingr...@gmail.com wrote: Since, like the bible the zen is self contradicting, any argument utilizing the zen can be defeated utilizing the zen. And like the Bible, the Zen was created by humans as a joke. If you're taking it too seriously, that's your problem. If however you

Re: Installing Python 2.6.7 on Windows

2011-09-27 Thread Steven D'Aprano
On Tue, 27 Sep 2011 14:32:43 -0700, Wanderer wrote: I need to stay in sink with the rest of the company which is still using 2.6 flavors. There was some investigation into going to Python 3 but not enough of the libraries we use were available. I'll install 2.6.6. I don't think the security

[issue1625] bz2.BZ2File doesn't support multiple streams

2011-09-27 Thread Crispin Wellington
Crispin Wellington retrogradeor...@gmail.com added the comment: This is all fine and well, but this is clearly a bug and not a feature. Can we please see this bug fix go into 2.7 at some point? -- nosy: +Crispin.Wellington ___ Python tracker

[issue1625] bz2.BZ2File doesn't support multiple streams

2011-09-27 Thread Gökçen Eraslan
Gökçen Eraslan gok...@pardus.org.tr added the comment: +1. If we think this as a bug, python 2.x users will never be able to extract multiple-stream bz2 files. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1625

[issue1625] bz2.BZ2File doesn't support multiple streams

2011-09-27 Thread Gökçen Eraslan
Gökçen Eraslan gok...@pardus.org.tr added the comment: I mean as a feature. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1625 ___ ___

[issue13049] distutils2 should not allow a distribution to install under another dist's directory

2011-09-27 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Fixed title ;) This is still under discussion. -- title: distutils2 should not allow packages - distutils2 should not allow a distribution to install under another dist's directory versions: +3rd party, Python 3.3

[issue13030] Be more generic when identifying the Windows main dir in installation doc

2011-09-27 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Terry, are you saying that the report is not a bug or that some part of the message is valid and some other part not? I can’t see clearly what I should do. Sandro: You can nosy me to all bugs for distutils docs: Doc/distutils, Doc/install,

[issue13050] RLock support the context manager protocol but this is not documented

2011-09-27 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- assignee: docs@python components: Documentation nosy: docs@python, r.david.murray priority: normal severity: normal status: open title: RLock support the context manager protocol but this is not documented

[issue13030] Be more generic when identifying the Windows main dir in installation doc

2011-09-27 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: I said exactly what I said ;-). Upon looking further (following the links), I see that 'install' refers to the disutils setup program install command option. What you should do is make the doc accurate and clear. What 'accurate' means is for

[issue12424] distutils2: extension section uses bad environment marker separator

2011-09-27 Thread Eli Collins
Changes by Eli Collins e...@assurancetechnologies.com: Added file: http://bugs.python.org/file23247/9170231ebf14.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12424 ___

[issue12424] distutils2: extension section uses bad environment marker separator

2011-09-27 Thread Eli Collins
Changes by Eli Collins e...@assurancetechnologies.com: -- hgrepos: +70 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12424 ___ ___

[issue12424] distutils2: extension section uses bad environment marker separator

2011-09-27 Thread Eli Collins
Eli Collins e...@assurancetechnologies.com added the comment: I've attached a second revision of my patch to fix this issue (9170231ebf14.diff). Per Eric Araujo's advice, this patch changes _pop_values() to use ;; as the environment marker separator for all fields in setupcfg's extension

[issue12242] distutils2 environment marker for current compiler

2011-09-27 Thread Eli Collins
Changes by Eli Collins e...@assurancetechnologies.com: -- hgrepos: +71 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12242 ___ ___

[issue12242] distutils2 environment marker for current compiler

2011-09-27 Thread Eli Collins
Changes by Eli Collins e...@assurancetechnologies.com: Added file: http://bugs.python.org/file23248/04610583238f.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12242 ___

[issue12242] distutils2 environment marker for current compiler

2011-09-27 Thread Eli Collins
Eli Collins e...@assurancetechnologies.com added the comment: Attached is a diff (04610583238f.diff) containing a second revision of my implementation of this feature. It incorporates suggestions made during code review, as well as adds unittests and documentation of the new features. This

[issue13051] Infinite recursion in curses.textpad.Textbox

2011-09-27 Thread Tycho Andersen
New submission from Tycho Andersen ty...@tycho.ws: The attached patch fixes two bugs which manifest as infinite recursion in _insert_printable_char() of Textbox. First, the previous implementation of _insert_printable_char() used recursion to move characters when inserting a character. Thus,

[issue13013] _ctypes.c: refleak

2011-09-27 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 1fb5b0cc6367 by Meador Inge in branch '2.7': Issue #13013: ctypes: Fix a reference leak in PyCArrayType_from_ctype. http://hg.python.org/cpython/rev/1fb5b0cc6367 New changeset 58a75eeb5c8e by Meador Inge in branch

[issue13013] _ctypes.c: refleak

2011-09-27 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- resolution: - fixed stage: test needed - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13013 ___

[issue13039] IDLE3 editor: shell-like behaviour on line starting with

2011-09-27 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: Yes, it is a real nuisance when pasting code that has ''. You have to select and delete to get rid of each. This is related to #1178, but this bug should be fixed if possible even if that were implemented. -- nosy: +terry.reedy stage:

[issue12881] ctypes: segfault with large structure field names

2011-09-27 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- assignee: - meador.inge versions: +Python 2.7, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12881 ___

[issue13052] IDLE: replace ending with '\' causes crash

2011-09-27 Thread Terry J. Reedy
New submission from Terry J. Reedy tjre...@udel.edu: As reported by R.S.Kachanovsky on the IDLE-sig list, and comfirmed by me with 3.2.2 on Win 7, entering a replace term ending with '\', like 'test\', in the find/replace dialog box causes IDLE to crash, as in do nothing for a couple of