Re: Why should __prepare__ be explicitly decorated as a @classmethod?

2014-05-18 Thread Chris Angelico
On Sun, May 18, 2014 at 4:26 PM, Shriramana Sharma wrote: > https://docs.python.org/3/reference/datamodel.html#basic-customization > documents that __new__ is special-cased so that while it is actually a static > method, it need not be decorated as such. I have a similar question. IIUC > __prep

Re: using a new computer and bringing needed libraries to it

2014-05-18 Thread Ben Finney
Rustom Mody writes: > On Sunday, May 18, 2014 5:47:05 AM UTC+5:30, Ned Batchelder wrote: > > Make a list of the [Python-specific] packages you need. Put it in a > > file called requirements.txt. […] > > What about things installed at a lower level than pip, eg apt-get? That's an important issue.

Re: Python and Math

2014-05-18 Thread Roy Smith
In article <53783c5f$0$29977$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > You may find that the IPython interactive interface to Python is useful. > It presents an interface which should be familiar to anyone with > experience with Mathematica. I second the IPython suggestio

Re: Python and Math

2014-05-18 Thread Wolfgang Keller
> Does Python have good mathematical capabilities? SAGE: http://www.sagemath.org/ Sincerely, Wolfgang -- https://mail.python.org/mailman/listinfo/python-list

Re: Python and Math

2014-05-18 Thread Mark Lawrence
On 18/05/2014 14:25, Roy Smith wrote: In article <53783c5f$0$29977$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: You may find that the IPython interactive interface to Python is useful. It presents an interface which should be familiar to anyone with experience with Mathematica

Re: Python and Math

2014-05-18 Thread Grant Edwards
On 2014-05-18, Bill Cunningham wrote: > Does Python have good mathematical capabilities? No. It has very good numerical computation capabilities, but it does not really do "math" (at least not what a mathemetician would consider "math"). > I am interested in learning a second language for

Re: Python and Math

2014-05-18 Thread Bill Cunningham
"Grant Edwards" wrote in message news:llak9u$8rs$1...@reader1.panix.com... > On 2014-05-18, Bill Cunningham wrote: > >> Does Python have good mathematical capabilities? > > No. > > It has very good numerical computation capabilities, but it does not > really do "math" (at least not what a m

Re: Python and Math

2014-05-18 Thread Robert Kern
On 2014-05-18 16:40, Grant Edwards wrote: On 2014-05-18, Bill Cunningham wrote: Does Python have good mathematical capabilities? No. It has very good numerical computation capabilities, but it does not really do "math" (at least not what a mathemetician would consider "math"). Many m

Re: Can't figure out 'instance has no attribute' error

2014-05-18 Thread varun7rs
On Sunday, 18 May 2014 01:56:42 UTC+2, varu...@gmail.com wrote: > Hello Friends, > > > > I am working on this code but I kind of get the same error over and over > again. Could any of you help me fix this part of the error? > > > > File RW1: > > class PHY_NETWORK: > > def __init__(sel

Re: Can't figure out 'instance has no attribute' error

2014-05-18 Thread Chris Angelico
On Mon, May 19, 2014 at 5:02 AM, wrote: > Thank you very much Ned, Rodri and Gary. I changed the settings of gedit text > editor as mentioned in the Zed Shaw tutorial. I think this is causing me the > problem. I'll follow your advice. > I find that there are better editors than gedit. My perso

Re: Loading modules from files through C++

2014-05-18 Thread Roland Plüss
On 05/17/2014 07:05 PM, Stefan Behnel wrote: > Roland Plüss, 17.05.2014 18:28: >> On 05/17/2014 05:49 PM, Stefan Behnel wrote: >>> Roland Plüss, 17.05.2014 17:28: On 05/17/2014 04:01 PM, Stefan Behnel wrote: > Roland Plüss, 17.05.2014 15:49: >> On 05/17/2014 03:26 PM, Stefan Behnel wr

[RELEASED] Python 2.7.7 release candidate 1

2014-05-18 Thread Benjamin Peterson
Greetings Python users, Python 2.7.7 release candidate 1 is now available for download. Python 2.7.7 is a regularly scheduled bugfix release for the Python 2.7 series. The 2.7.7 release contains fixes for two severe, if arcane, potential security vulnerabilities. The first was the possibility of re

Re: Loading modules from files through C++

2014-05-18 Thread Chris Angelico
On Mon, May 19, 2014 at 5:41 AM, Roland Plüss wrote: > This exec source_code in module.__dict__ , should this not also be doable > with PyEval_EvalCode? General principle: The more code you write in Python and the less in C/C++, the happier and more productive you will be. Drop into Python as so

bz2.decompress as file handle

2014-05-18 Thread Vincent Davis
I have a file compressed with bz2 and a function that expects a file handle. When I decompress the bz2 file I get a string (binary) not a file handle. Here is what I have that does not work. There is no error (thats a seperate issue) CelFile.read just fails to read the data(string). from Bio.Affy

Re: bz2.decompress as file handle

2014-05-18 Thread Tim Chase
On 2014-05-18 19:53, Vincent Davis wrote: > I have a file compressed with bz2 and a function that expects a > file handle. When I decompress the bz2 file I get a string (binary) > not a file handle. > from bz2 import decompress, > > with open('Tests/Affy/affy_v3_ex.CEL.bz2', 'rb') as handle: >

Re: bz2.decompress as file handle

2014-05-18 Thread Vincent Davis
Well after posting, I think I figured it out. The key is to use StringIO to get a file handle on the string. The fact that it is binary just complicates it a little. with open('Tests/Affy/affy_v3_ex.CEL.bz2', 'rb') as handle: cel_data = StringIO(decompress(handle.read()).decode('ascii')) Vinc

Re: bz2.decompress as file handle

2014-05-18 Thread Ian Kelly
On Sun, May 18, 2014 at 8:38 PM, Vincent Davis wrote: > Well after posting, I think I figured it out. > The key is to use StringIO to get a file handle on the string. The fact that > it is binary just complicates it a little. > > with open('Tests/Affy/affy_v3_ex.CEL.bz2', 'rb') as handle: > ce

Re: bz2.decompress as file handle

2014-05-18 Thread Vincent Davis
On Sun, May 18, 2014 at 9:44 PM, Ian Kelly wrote: > You can just use bz2.open: > > >>> with bz2.open('test.txt.bz2', 'rt', encoding='ascii') as f: > ... print(f.read()) > ​Thanks I like that better then my solution. ​ Vincent Davis 720-301-3003 -- https://mail.python.org/mailman/listinfo/

Copying files from sub folders under source directories into sub folders with same names as source directory sub folders in destination directories without overwriting already existing files of same n

2014-05-18 Thread satishmlwizpro
Hi, Consider /src/alias/a.c /src/alias/b.c /src/xml/p.xml /src/xml/c.xml /src/h.c as source directory and /dest/alias /dest/xml /dest as destination directory. These are given in a csv file like /src/alias/a.c, /dest/alias /src/alias/b.c, /dest/alias /src/xml/p.xml, /dest/xml /src/xml/c.xml, /de