Re: myths about python 3

2010-01-28 Thread Stefan Behnel
Benjamin Kaplan, 27.01.2010 22:25: > On Wed, Jan 27, 2010 at 3:56 PM, John Nagle wrote: >> 2. Python 3 is supported by multiple Python implementations. >> >>FALSE - Only CPython supports 3.x. Iron Python, Unladen Swallow, >>PyPy, and Jython have all stayed with 2.x versions of Py

Data exchange between Delphi and Python (Win)

2010-01-28 Thread Durumdara
Hi! I have an exotic db, with exotic drivers, and it have buggy ODBC driver. But I have native driver - under Delphi. I need to access this DB under Pylons (or mod_python). I wrote one solution that working with XML. But I search for easier way to transform and move data between apps. I saw P

Re: Library support for Python 3.x

2010-01-28 Thread Ben Finney
David Cournapeau writes: > Unstable may be strong - every minor version of python has a lifespan > of several years. But yes, that's an hindrance for packagers: you need > to package binaries for every minor version of python It's important to note that this is mitigated, ironically enough, by i

Re: myths about python 3

2010-01-28 Thread Stefan Behnel
Ben Finney, 27.01.2010 22:50: > Christian Heimes writes: > >> John Nagle wrote: >>> 1. Python 3 is supported by major Linux distributions. >>> >>> FALSE - most distros are shipping with Python 2.4, or 2.5 at best. >> You are wrong. Modern versions of Debian / Ubuntu are using Python >> 2.6. >

Re: Library support for Python 3.x

2010-01-28 Thread Stefan Behnel
David Cournapeau, 28.01.2010 06:58: > On Thu, Jan 28, 2010 at 7:38 AM, Terry Reedy wrote: > >> For a windows user who depends on pre-built binaries, every new release >> breaks *every* library that is not pure Python and needs to be compiled. > > That's not windows specific - most packages which

Re: python 3's adoption

2010-01-28 Thread Paul Rubin
Jonathan Gardner writes: > If you're going to have statements, you're going to need the null > statement. That's "pass". Why? Expressions are statements, so you could just say "pass" (in quotes, denoting a string literal), or 0, or None, os anything else like that, instead of having a special st

Re: myths about python 3

2010-01-28 Thread Paul Rubin
Stefan Behnel writes: > The amount of work that the Jython project put into catching up from 2.1 to > 2.5/6 (new style classes! generators!) is really humongous compared to the > adaptations that an implementation needs to do to support Python 3 code. I wonder whether Jython could borrow code fro

Re: Library support for Python 3.x

2010-01-28 Thread David Cournapeau
On Thu, Jan 28, 2010 at 5:08 PM, Ben Finney wrote: > > It's important to note that this is mitigated, ironically enough, by > intentionally targeting a minimum Python minor version because the code > base makes use of Python features not available in older versions. > > That is, any minor version

Re: Library support for Python 3.x

2010-01-28 Thread David Cournapeau
On Thu, Jan 28, 2010 at 5:40 PM, Stefan Behnel wrote: > > That doesn't completely match my experience. It's true that there is no > guarantee that the ABI will stay compatible, but when you compile lxml > against Py2.4 on a 32bit machine, it will continue to import in Py2.5 and > (IIRC) Py2.6. It

Re: python 3's adoption

2010-01-28 Thread Alf P. Steinbach
* Steven D'Aprano: On Wed, 27 Jan 2010 18:29:25 +0100, Alf P. Steinbach wrote: The main problem with the incompatibility is for porting code, not for writing code from scratch. Correct. It's a trivial problem, but still a problem. It's also a problem wrt. learning the language. This makes

Re: Library support for Python 3.x

2010-01-28 Thread Stefan Behnel
David Cournapeau, 28.01.2010 09:54: > On Thu, Jan 28, 2010 at 5:40 PM, Stefan Behnel wrote: > >> That doesn't completely match my experience. It's true that there is no >> guarantee that the ABI will stay compatible, but when you compile lxml >> against Py2.4 on a 32bit machine, it will continue t

Re: Library support for Python 3.x

2010-01-28 Thread Paul Rubin
David Cournapeau writes: > So yes, you could say "just try and if it crashes, check that it is > not ABI-related". In practice, this is very poor engineering in my > book... I just looked at PEP 384 and I don't see anything in it about version numbers in the interfaces. I certainly think somethi

Re: Ad hoc lists vs ad hoc tuples

2010-01-28 Thread Duncan Booth
Terry Reedy wrote: > Constant tuples (a tuple whose members are all seen as constants by the > compiler) are now pre-compiled and constructed once and put into the > code object as such rather than re-constructed with each run of the code. Sadly that's not entirely accurate. Tuples whose memb

Re: python 3's adoption

2010-01-28 Thread Luis M . González
> Please don't post more noise and ad hominem attacks to the group, Steve. "Ad hominem"? Please, operor non utor lingua non notus per vulgaris populus. Gratias ago vos... -- http://mail.python.org/mailman/listinfo/python-list

Re: python 3's adoption

2010-01-28 Thread Gib Bogle
Luis M. González wrote: Please don't post more noise and ad hominem attacks to the group, Steve. "Ad hominem"? Please, operor non utor lingua non notus per vulgaris populus. Gratias ago vos... "ad hominem" is "lingua notus per vulgaris populus", the vulgar pop of these parts, anyway. -- ht

Re: Total maximal size of data

2010-01-28 Thread denis
On Jan 25, 8:05 pm, Alexander Moibenko wrote: > I have a simple question to which I could not find an answer. > What is the [total maximal] size of list including size of its elements? Beware, sys.getsizeof(alist) is 4*len(alist) + a bit, regardless of alists's contents ?! See http://stackoverfl

Re: List weirdness - what the heck is going on here?

2010-01-28 Thread Rotwang
Owen Jacobson wrote: On 2010-01-27 21:06:28 -0500, Rotwang said: Hi all, I've been trying to make a class with which to manipulate sound data, and have run into some behaviour I don't understand which I hope somebody here can explain. The class has an attribute called data, which is a list w

interaction of mode 'r+', file.write(), and file.tell(): a bug or undefined behavior?

2010-01-28 Thread Lie Ryan
In the code: """ f = open('input.txt', 'r+') for line in f: s = line.replace('python', 'PYTHON') # f.tell() f.write(s) """ When f.tell() is commented, 'input.txt' does not change; but when uncommented, the f.write() succeeded writing into the 'input.txt' (surprisingly, but not entirel

is there any alternative to savefig?

2010-01-28 Thread kiwanuka
Hi all, I wonder if anyone knows any alternative function in pylab (or otherwise) that could be used to save an image. My problem is as follows: --- from pylab import * ... figure(1) fig1 = gca() figure(2) fig2 = gca() figure(3) fig3 = gca() for i,data_file in enumerate(data_file_li

Re: Library support for Python 3.x

2010-01-28 Thread Daniel Fetchinson
>> I'm going to be starting some new Python projects in Python 2.6, but am >> concerned that at least three of the libraries I will be >> using--pycrypto, paramiko and feedparser--are not currently supported in >> Python 3.x. The authors of these programs have not given any indication >> that work

Re: Generic proxy (that proxies methods like __iter__)

2010-01-28 Thread D HANNEY
On Jan 27, 3:07 pm, Arnaud Delobelle wrote: > On 27 Jan, 14:41, D HANNEY wrote: > [...] > > See [1] for an explanation.  Here is an idea: you could get round that > by generating a class on the fly, if you don't mind changing the class > of the object (untested): > > def noguardproxy(obj): >    

Re: Stuck on a three word street name regex

2010-01-28 Thread Brian D
> > [snip] > > Regex doesn't gain you much. I'd split the string and then fix the parts > > as necessary: > > >  >>> def parse_address(address): > > ...     parts = address.split() > > ...     if parts[-2] == "S": > > ...         parts[1 : -1] = [parts[-2]] + parts[1 : -2] > > ...     parts[1 : -1]

Re: Stuck on a three word street name regex

2010-01-28 Thread Brian D
On Jan 28, 7:40 am, Brian D wrote: > > > [snip] > > > Regex doesn't gain you much. I'd split the string and then fix the parts > > > as necessary: > > > >  >>> def parse_address(address): > > > ...     parts = address.split() > > > ...     if parts[-2] == "S": > > > ...         parts[1 : -1] = [pa

Re: Generic proxy (that proxies methods like __iter__)

2010-01-28 Thread D HANNEY
On Jan 28, 1:31 pm, D HANNEY wrote: > > Your solution works if I change "type(obj)" to say "obj.__class__". > If I don't make this change Python complains "TypeError: Error when > calling the metaclass bases type 'instance' is not an acceptable base > type". > So, I've got something that works but

Re: Portable way to tell if a process is still alive

2010-01-28 Thread Laszlo Nagy
Suppose we have a program that writes its process id into a pid file. Usually the program deletes the pid file when it exists... But in some cases (for example, killed with kill -9 or TerminateProcess) pid file is left there. I would like to know if a process (given with its process id) is st

Re: Stuck on a three word street name regex

2010-01-28 Thread Lie Ryan
On 01/28/10 11:28, Brian D wrote: > I've tackled this kind of problem before by looping through a patterns > dictionary, but there must be a smarter approach. > > Two addresses. Note that the first has incorrectly transposed the > direction and street name. The second has an extra space in it befo

Re: Portable way to tell if a process is still alive

2010-01-28 Thread exarkun
On 10:50 am, gand...@shopzeus.com wrote: Suppose we have a program that writes its process id into a pid file. Usually the program deletes the pid file when it exists... But in some cases (for example, killed with kill -9 or TerminateProcess) pid file is left there. I would like to know if a

Re: interaction of mode 'r+', file.write(), and file.tell(): a bug or undefined behavior?

2010-01-28 Thread Anthony Tolle
On Jan 28, 7:12 am, Lie Ryan wrote: > In the code: > > """ > f = open('input.txt', 'r+') > for line in f: >     s = line.replace('python', 'PYTHON') >     # f.tell() >     f.write(s) > """ > [snip] My guess is that there are a few possible problems: 1) In this case, writing to file opened with '

Re: interaction of mode 'r+', file.write(), and file.tell(): a bug or undefined behavior?

2010-01-28 Thread Alf P. Steinbach
* Anthony Tolle: On Jan 28, 7:12 am, Lie Ryan wrote: In the code: """ f = open('input.txt', 'r+') for line in f: s = line.replace('python', 'PYTHON') # f.tell() f.write(s) """ [snip] My guess is that there are a few possible problems: 1) In this case, writing to file opened with

Need help with a program

2010-01-28 Thread evilweasel
Hi folks, I am a newbie to python, and I would be grateful if someone could point out the mistake in my program. Basically, I have a huge text file similar to the format below: AGACTCGAGTGCGCGGA 0 AGATAAGCTAATTAAGCTACTGG 0 AGATAAGCTAATTAAGCTACTGGGTT 1 AGCTCACAA

Re: Need help with a program

2010-01-28 Thread Alf P. Steinbach
* evilweasel: Hi folks, I am a newbie to python, and I would be grateful if someone could point out the mistake in my program. Basically, I have a huge text file similar to the format below: AGACTCGAGTGCGCGGA 0 AGATAAGCTAATTAAGCTACTGG 0 AGATAAGCTAATTAAGCTACTGGGTT 1 A

Re: Need help with a program

2010-01-28 Thread Mark Dickinson
On Jan 28, 3:07 pm, evilweasel wrote: > Hi folks, > > I am a newbie to python, and I would be grateful if someone could > point out the mistake in my program. > for j in range(0, b): >     if lister[j] == 0: At a guess, this line should be: if lister[j] == '0': ... -- Mark -- ht

Re: Need help with a program

2010-01-28 Thread Krister Svanlund
On Thu, Jan 28, 2010 at 4:07 PM, evilweasel wrote: > Hi folks, > > I am a newbie to python, and I would be grateful if someone could > point out the mistake in my program. Basically, I have a huge text > file similar to the format below: > > AGACTCGAGTGCGCGGA   0 > AGATAAGCTAATTAAGCTACTGG

Re: Need help with a program

2010-01-28 Thread Krister Svanlund
On Thu, Jan 28, 2010 at 4:28 PM, Krister Svanlund wrote: > On Thu, Jan 28, 2010 at 4:07 PM, evilweasel > wrote: >> Hi folks, >> >> I am a newbie to python, and I would be grateful if someone could >> point out the mistake in my program. Basically, I have a huge text >> file similar to the format

Re: Need help with a program

2010-01-28 Thread D'Arcy J.M. Cain
On Thu, 28 Jan 2010 07:07:04 -0800 (PST) evilweasel wrote: > I am a newbie to python, and I would be grateful if someone could Welcome. > point out the mistake in my program. Basically, I have a huge text > file similar to the format below: You don't say how it isn't working. As a first step y

Re: Need help with a program

2010-01-28 Thread Krister Svanlund
On Thu, Jan 28, 2010 at 4:31 PM, Krister Svanlund wrote: > On Thu, Jan 28, 2010 at 4:28 PM, Krister Svanlund > wrote: >> On Thu, Jan 28, 2010 at 4:07 PM, evilweasel >> wrote: >>> Hi folks, >>> >>> I am a newbie to python, and I would be grateful if someone could >>> point out the mistake in my p

Re: is there any alternative to savefig?

2010-01-28 Thread kiwanuka
On Jan 28, 12:29 pm, kiwanuka wrote: > Hi all, > > I wonder if anyone knows any alternative function in pylab (or > otherwise) that could be used to save an image. My problem is as > follows: > > --- > from pylab import * > ... > > figure(1) > fig1 = gca() > figure(2) > fig2 = gca() >

Re: is there any alternative to savefig?

2010-01-28 Thread Alf P. Steinbach
* kiwanuka: On Jan 28, 12:29 pm, kiwanuka wrote: Hi all, I wonder if anyone knows any alternative function in pylab (or otherwise) that could be used to save an image. My problem is as follows: --- from pylab import * ... figure(1) fig1 = gca() figure(2) fig2 = gca() figure(3) fi

Re: Need help with a program

2010-01-28 Thread evilweasel
I will make my question a little more clearer. I have close to 60,000 lines of the data similar to the one I posted. There are various numbers next to the sequence (this is basically the number of times the sequence has been found in a particular sample). So, I would need to ignore the ones contain

Re: Symbols as parameters?

2010-01-28 Thread Roald de Vries
On Jan 22, 2010, at 11:56 AM, Roald de Vries wrote: Hi Martin, On Jan 21, 2010, at 8:43 AM, Martin Drautzburg wrote: Hello all, When passing parameters to a function, you sometimes need a paramter which can only assume certain values, e.g. def move (direction): ... If direct

Re: python 3's adoption

2010-01-28 Thread Mitchell L Model
I have been working with Python 3 for over a year. I used it in writing my book "Bioinformatics Programming Using Python" (http://oreilly.com/catalog/9780596154509 ). I didn't see any point in teaching an incompatible earlier version of a language in transition. In preparing the book and its e

Re: myths about python 3

2010-01-28 Thread Aahz
In article , Steven D'Aprano wrote: >On Wed, 27 Jan 2010 16:25:46 -0500, Benjamin Kaplan wrote: >> >> When Python 2.6 came out, Jython was still on 2.2. The difference >> between 2.2 and 2.6 is almost as big of a difference as between 2.6 and >> 3.0. In that time, you had the introduction of the

Good Book

2010-01-28 Thread talal awadh
Many people who want to learn Islam or are new converts find it hard to have a simplified guide that explains to them the basics of Islam in a nutshell; so I decided to collect the basic guidelines and gather them in an e-book I named it "Basic Islam" for Introducing Islam http://www.saaid.net/bo

Re: python 3's adoption

2010-01-28 Thread Roy Smith
In article , Mitchell L Model wrote: > I use the sep and end keywords all the time. What are 'sep' and 'end'? I'm looking in http://docs.python.org/3.1/genindex-all.html and don't see those mentioned at all. Am I just looking in the wrong place? -- http://mail.python.org/mailman/listinfo/p

Re: myths about python 3

2010-01-28 Thread Aahz
In article , Neil Hodgson wrote: >Carl Banks: >> >> There is also no hope someone will fork Python 2.x and continue it in >> perpetuity. Well, someone might try to fork it, but they won't be >> able to call it Python. > > Over time there may be more desire from those unable or unwilling to >up

Re: Need help with a program

2010-01-28 Thread nn
On Jan 28, 10:50 am, evilweasel wrote: > I will make my question a little more clearer. I have close to 60,000 > lines of the data similar to the one I posted. There are various > numbers next to the sequence (this is basically the number of times > the sequence has been found in a particular samp

Re: python 3's adoption

2010-01-28 Thread Alf P. Steinbach
* Roy Smith: In article , Mitchell L Model wrote: I use the sep and end keywords all the time. What are 'sep' and 'end'? I'm looking in http://docs.python.org/3.1/genindex-all.html and don't see those mentioned at all. Am I just looking in the wrong place? >>> print( print.__doc__ )

Re: Good Book

2010-01-28 Thread J
On Thu, Jan 28, 2010 at 11:09, talal awadh wrote: > Many people who want to learn Islam or are new converts find it hard I just wanted to thank you for reminding me that I needed to write a mail filter to delete this kind of drivel. I appreciate the reminder! Cheers, Jeff -- http://mail.pytho

Re: python 3's adoption

2010-01-28 Thread Lie Ryan
On 01/28/10 19:37, Paul Rubin wrote: > Jonathan Gardner writes: >> If you're going to have statements, you're going to need the null >> statement. That's "pass". > > Why? Expressions are statements, so you could just say "pass" (in > quotes, denoting a string literal), or 0, or None, os anything

RE: myths about python 3

2010-01-28 Thread Dino Viehland
Stefan wrote: > >From an implementors point of view, it's actually quite the opposite. Most > syntax features of Python 3 can be easily implemented on top of an existing > Py2 Implementation (we have most of them in Cython already, and I really > found them fun to write), and the shifting-around in

Re: myths about python 3

2010-01-28 Thread Antoine Pitrou
Le Thu, 28 Jan 2010 00:19:24 +, Steven D'Aprano a écrit : > 4. Python 3 will make you irresistible to women. > > FALSE - Python 3 coders are no more likely to get a date than any > other programmer. They spend less time coding, so they /can/ get more "dates" (what a strange English w

Re: python 3's adoption

2010-01-28 Thread Lie Ryan
On 01/28/10 20:12, Alf P. Steinbach wrote: > * Steven D'Aprano: >> On Wed, 27 Jan 2010 18:29:25 +0100, Alf P. Steinbach wrote:> >> Instead of: >> >> print >>fileObj, x, y, z >> >> you use regular function syntax with a meaningful keyword: >> >> print(x, y, z, file=fileObj) >> >> If you want suppres

Re: myths about python 3

2010-01-28 Thread Antoine Pitrou
Le Wed, 27 Jan 2010 17:36:29 -0800, alex23 a écrit : > > I've been a big supporter of Py3 from the beginning, but this repeated > claim of US becoming the mainline interpreter for 3.x pretty much kills > dead a lot of my interest. As long as the U-S JIT can be disabled at compile-time (and also a

Re: Need help with a program

2010-01-28 Thread Arnaud Delobelle
nn writes: > On Jan 28, 10:50 am, evilweasel wrote: >> I will make my question a little more clearer. I have close to 60,000 >> lines of the data similar to the one I posted. There are various >> numbers next to the sequence (this is basically the number of times >> the sequence has been found i

Re: Need help with a program

2010-01-28 Thread John Posner
On 1/28/2010 10:50 AM, evilweasel wrote: I will make my question a little more clearer. I have close to 60,000 lines of the data similar to the one I posted. There are various numbers next to the sequence (this is basically the number of times the sequence has been found in a particular sample).

Re: Stuck on a three word street name regex

2010-01-28 Thread Brian D
> Correction: > > [snip] the expression "parts[1 : -1]" means gather list items from the > second element in the list (index value 1) to one index position > before the end of the list. [snip] MRAB's solution was deserving of a more complete solution: >>> def parse_address(address): # Ha

Re: python 3's adoption

2010-01-28 Thread Alf P. Steinbach
* Lie Ryan: On 01/28/10 20:12, Alf P. Steinbach wrote: >>> import builtins >>> >>> org_print = print >>> builtins.print = 666 >>> >>> print( "trallala" ) Traceback (most recent call last): File "", line 1, in TypeError: 'int' object is not callable >>> org_print( "but is t

Re: Stuck on a three word street name regex

2010-01-28 Thread Brian D
On Jan 28, 8:27 am, Lie Ryan wrote: > On 01/28/10 11:28, Brian D wrote: > > > > > I've tackled this kind of problem before by looping through a patterns > > dictionary, but there must be a smarter approach. > > > Two addresses. Note that the first has incorrectly transposed the > > direction and s

Re: Need help with a program

2010-01-28 Thread D'Arcy J.M. Cain
On Thu, 28 Jan 2010 18:49:02 +0100 Jean-Michel Pichavant wrote: > Using regexp may increase readability (if you are familiar with it). If you have a problem and you think that regular expressions are the solution then now you have two problems. Regex is really overkill for the OP's problem and

Re: Library support for Python 3.x

2010-01-28 Thread Terry Reedy
On 1/28/2010 1:37 AM, Paul Rubin wrote: David Cournapeau writes: That's not windows specific - most packages which distribute binary packages need to package binaries for every minor version (2.4, 2.5, etc...) I doubt that's what Paul was referring to, though - he seemed more concern with A

Re: Need help with a program

2010-01-28 Thread Jean-Michel Pichavant
evilweasel wrote: I will make my question a little more clearer. I have close to 60,000 lines of the data similar to the one I posted. There are various numbers next to the sequence (this is basically the number of times the sequence has been found in a particular sample). So, I would need to ign

Re: python 3's adoption

2010-01-28 Thread Terry Reedy
On 1/28/2010 3:37 AM, Paul Rubin wrote: Jonathan Gardner writes: If you're going to have statements, you're going to need the null statement. That's "pass". Why? Expressions are statements, so you could just say "pass" (in quotes, denoting a string literal), or 0, or None, os anything else l

Re: Need help with a program

2010-01-28 Thread Jean-Michel Pichavant
D'Arcy J.M. Cain wrote: On Thu, 28 Jan 2010 18:49:02 +0100 Jean-Michel Pichavant wrote: Using regexp may increase readability (if you are familiar with it). If you have a problem and you think that regular expressions are the solution then now you have two problems. Regex is really o

Wrap a function

2010-01-28 Thread Joan Miller
I've to call to many functions with the format: >>> run("cmd") were "cmd" is a command with its arguments to pass them to the shell and run it, i.e. >>> run("pwd") or >>> run("ls /home") Does anybody knows any library to help me to avoid the use of the main quotes, and brackets? I would to us

Re: myths about python 3

2010-01-28 Thread Carl Banks
On Jan 28, 8:10 am, a...@pythoncraft.com (Aahz) wrote: > In article , > Neil Hodgson   wrote: > > >Carl Banks: > > >> There is also no hope someone will fork Python 2.x and continue it in > >> perpetuity.  Well, someone might try to fork it, but they won't be > >> able to call it Python. > > >   Ov

Why doesn't "filterwarnings" suppress this message?

2010-01-28 Thread John Nagle
Feedparser isn't supported for Python 3.0, so in Python 2.6, many warning messages appear. I'm trying, in Python 2.6, to suppress the warning message: ./feedparser\feedparser.py:69: DeprecationWarning: the sgmllib module has been removed in Python 3.0 import sgmllib, r

Re: Need help with a program

2010-01-28 Thread Steven Howe
On 01/28/2010 09:49 AM, Jean-Michel Pichavant wrote: evilweasel wrote: I will make my question a little more clearer. I have close to 60,000 lines of the data similar to the one I posted. There are various numbers next to the sequence (this is basically the number of times the sequence has been

Re: python 3's adoption

2010-01-28 Thread Terry Reedy
On 1/28/2010 11:03 AM, Mitchell L Model wrote: I have been working with Python 3 for over a year. I used it in writing my book "Bioinformatics Programming Using Python" (http://oreilly.com/catalog/9780596154509). I didn't see any point in teaching an incompatible earlier version of a language in

Re: Need help with a program

2010-01-28 Thread Mensanator
On Jan 28, 12:28 pm, Steven Howe wrote: > On 01/28/2010 09:49 AM, Jean-Michel Pichavant wrote: > > > > > > > evilweasel wrote: > >> I will make my question a little more clearer. I have close to 60,000 > >> lines of the data similar to the one I posted. There are various > >> numbers next to the s

Re: Why doesn't "filterwarnings" suppress this message?

2010-01-28 Thread Peter Otten
John Nagle wrote: > Feedparser isn't supported for Python 3.0, so in Python 2.6, many > warning > messages appear. I'm trying, in Python 2.6, to suppress the warning > message: > > ./feedparser\feedparser.py:69: DeprecationWarning: > the sgmllib module has been removed in Python 3.0 > im

Re: Wrap a function

2010-01-28 Thread Josh Holland
On 2010-01-28, Joan Miller wrote: > I've to call to many functions with the format: > run("cmd") Check the docs on os.system(). -- Josh "dutchie" Holland http://www.joshh.co.uk/ http://twitter.com/jshholland http://identi.ca/jshholland -- http://mail.python.org/mailman/listinfo/python-l

Great example of a python module/package following up to date conventions.

2010-01-28 Thread Big Stu
I'm hoping someone on here can point me to an example of a python package that is a great example of how to put it all together. I'm hoping for example code that demonstrates: -Strict adherence to PEP 8 -thorough use of Docstrings -Conventional directory structure/package layout -Appropriate use

Re: Wrap a function

2010-01-28 Thread Joan Miller
On 28 ene, 19:16, Josh Holland wrote: > On 2010-01-28, Joan Miller wrote: > > > I've to call to many functions with the format: > > run("cmd") > > Check the docs on os.system(). No. I've a function that uses subprocess to run commands on the same shell and so substitute to bash scrips. But a

Re: Great example of a python module/package following up to date conventions.

2010-01-28 Thread Josh Holland
On 2010-01-28, Big Stu wrote: > I'm hoping someone on here can point me to an example of a python > package that is a great example of how to put it all together. I'm > hoping for example code that demonstrates: Surely most of the Standard Library should satisfy all your requirements? -- Josh

Re: python 3's adoption

2010-01-28 Thread Fencer
On 2010-01-28 17:03, Mitchell L Model wrote: I have been working with Python 3 for over a year. I used it in writing my book "Bioinformatics Programming Using Python" (http://oreilly.com/catalog/9780596154509). That book sounds very interesting, even though I am more interested in the bioinfor

Re: Great example of a python module/package following up to date conventions.

2010-01-28 Thread exarkun
On 07:28 pm, j...@joshh.co.uk wrote: On 2010-01-28, Big Stu wrote: I'm hoping someone on here can point me to an example of a python package that is a great example of how to put it all together. I'm hoping for example code that demonstrates: Surely most of the Standard Library should satisf

Re: Great example of a python module/package following up to date conventions.

2010-01-28 Thread Big Stu
On Jan 28, 2:28 pm, Josh Holland wrote: > On 2010-01-28, Big Stu wrote: > > > I'm hoping someone on here can point me to an example of a python > > package that is a great example of how to put it all together.  I'm > > hoping for example code that demonstrates: > > Surely most of the Standard Li

Re: Great example of a python module/package following up to date conventions.

2010-01-28 Thread Joan Miller
On 28 ene, 19:17, Big Stu wrote: > I'm hoping someone on here can point me to an example of a python > package that is a great example of how to put it all together.  I'm > hoping for example code that demonstrates: > > -Strict adherence to PEP 8 > -thorough use of Docstrings > -Conventional direc

Re: Great example of a python module/package following up to date conventions.

2010-01-28 Thread Josh Holland
On 2010-01-28, exar...@twistedmatrix.com wrote: > Have you actually looked at any of the standard library? Not recently or in depth, no. I would have thought that it would be of high quality. I must have been mistaken. -- Josh "dutchie" Holland http://www.joshh.co.uk/ http://twitter.com/jshholl

Re: Great example of a python module/package following up to date conventions.

2010-01-28 Thread Big Stu
> Have you actually looked at any of the standard library? > > Jean-Paul I'm looking at urllib2 right now and it is covering a bunch of the bases I'm looking for. And grepping in the /usr/lib/python2.5/ folder for import statements on various things I'm interested in is bringing up some good exa

Re: myths about python 3

2010-01-28 Thread Steve Holden
Carl Banks wrote: > On Jan 28, 8:10 am, a...@pythoncraft.com (Aahz) wrote: >> In article , >> Neil Hodgson wrote: >> >>> Carl Banks: There is also no hope someone will fork Python 2.x and continue it in perpetuity. Well, someone might try to fork it, but they won't be able to call

Re: Wrap a function

2010-01-28 Thread Steve Holden
Joan Miller wrote: > On 28 ene, 19:16, Josh Holland wrote: >> On 2010-01-28, Joan Miller wrote: >> >>> I've to call to many functions with the format: >> run("cmd") >> Check the docs on os.system(). > No. I've a function that uses subprocess to run commands on the same > shell and so substitu

Why am I getting this Error message

2010-01-28 Thread Ray Holt
Why am I getting the following error message. Area has been declared as an attribute of Circle. Thanks, Ray class Circle: def __init__(self): self.radius = 1 def area(self): return self.radius * self.radius * 3.14159 c = Circle() c.radius = 3 print c.area() Traceback (most rece

Re: Need help with a program

2010-01-28 Thread MRAB
Steven Howe wrote: On 01/28/2010 09:49 AM, Jean-Michel Pichavant wrote: evilweasel wrote: I will make my question a little more clearer. I have close to 60,000 lines of the data similar to the one I posted. There are various numbers next to the sequence (this is basically the number of times th

Re: Wrap a function

2010-01-28 Thread John Posner
On 1/28/2010 2:24 PM, Joan Miller wrote: On 28 ene, 19:16, Josh Holland wrote: On 2010-01-28, Joan Miller wrote: I've to call to many functions with the format: run("cmd") Check the docs on os.system(). No. I've a function that uses subprocess to run commands on the same shell and so s

Re: Wrap a function

2010-01-28 Thread Joan Miller
On 28 ene, 19:54, Steve Holden wrote: > Joan Miller wrote: > > On 28 ene, 19:16, Josh Holland wrote: > >> On 2010-01-28, Joan Miller wrote: > > >>> I've to call to many functions with the format: > >> run("cmd") > >> Check the docs on os.system(). > > No. I've a function that uses subprocess

Re: Great example of a python module/package following up to date conventions.

2010-01-28 Thread exarkun
On 07:49 pm, stu.dohe...@gmail.com wrote: Have you actually looked at any of the standard library? Jean-Paul I'm looking at urllib2 right now and it is covering a bunch of the bases I'm looking for. And grepping in the /usr/lib/python2.5/ folder for import statements on various things I'm i

Re: Wrap a function

2010-01-28 Thread Joan Miller
On 28 ene, 19:58, John Posner wrote: > On 1/28/2010 2:24 PM, Joan Miller wrote: > > > On 28 ene, 19:16, Josh Holland  wrote: > >> On 2010-01-28, Joan Miller  wrote: > > >>> I've to call to many functions with the format: > > >> run("cmd") > > >> Check the docs on os.system(). > > No. I've a fu

Re: Why am I getting this Error message

2010-01-28 Thread Chris Rebert
On Thu, Jan 28, 2010 at 11:57 AM, Ray Holt wrote: > Why am I getting the following error message. Area has been declared as an > attribute of Circle. Thanks, Ray > > class Circle: >  def __init__(self): > self.radius = 1 >  def area(self): > return self.radius * self.radius * 3.14159 >  

Re: Wrap a function

2010-01-28 Thread Sean DiZazzo
On Jan 28, 12:13 pm, Joan Miller wrote: > On 28 ene, 19:58, John Posner wrote: > > > > > On 1/28/2010 2:24 PM, Joan Miller wrote: > > > > On 28 ene, 19:16, Josh Holland  wrote: > > >> On 2010-01-28, Joan Miller  wrote: > > > >>> I've to call to many functions with the format: > > > >> run("cm

Re: Wrap a function

2010-01-28 Thread Peter
On Jan 29, 6:58 am, John Posner wrote: > On 1/28/2010 2:24 PM, Joan Miller wrote: > > > On 28 ene, 19:16, Josh Holland  wrote: > >> On 2010-01-28, Joan Miller  wrote: > > >>> I've to call to many functions with the format: > > >> run("cmd") > > >> Check the docs on os.system(). > > No. I've a

Re: Why am I getting this Error message

2010-01-28 Thread Steve Holden
Ray Holt wrote: > Why am I getting the following error message. Area has been declared as > an attribute of Circle. Thanks, Ray > > > class Circle: > def __init__(self): > self.radius = 1 > def area(self): > return self.radius * self.radius * 3.14159 > c = Circle() > c.radius = 3 >

Re: Why am I getting this Error message

2010-01-28 Thread MRAB
Ray Holt wrote: Why am I getting the following error message. Area has been declared as an attribute of Circle. Thanks, Ray class Circle: def __init__(self): self.radius = 1 def area(self): return self.radius * self.radius * 3.14159 c = Circle() c.radius = 3 print c.area()

Re: Wrap a function

2010-01-28 Thread Joan Miller
On 28 ene, 20:20, Peter wrote: > On Jan 29, 6:58 am, John Posner wrote: > > > > > On 1/28/2010 2:24 PM, Joan Miller wrote: > > > > On 28 ene, 19:16, Josh Holland  wrote: > > >> On 2010-01-28, Joan Miller  wrote: > > > >>> I've to call to many functions with the format: > > > >> run("cmd") > >

Re: Wrap a function

2010-01-28 Thread Joan Miller
On 28 ene, 20:34, Joan Miller wrote: > On 28 ene, 20:20, Peter wrote: > > > On Jan 29, 6:58 am, John Posner wrote: > > > > On 1/28/2010 2:24 PM, Joan Miller wrote: > > > > > On 28 ene, 19:16, Josh Holland  wrote: > > > >> On 2010-01-28, Joan Miller  wrote: > > > > >>> I've to call to many functi

mix statically typed with dynamically typed

2010-01-28 Thread Yingjie Lan
We all know that Python is dynamically typed, and dynamically typed languages are generally slower than statically typed ones. I wonder if it is possible at all for Python to mix statically-typed-ness with dynamically-typed-ness to boost up its speed a little bit, especially when speed is needed

Re: myths about python 3

2010-01-28 Thread Terry Reedy
On 1/28/2010 2:51 PM, Steve Holden wrote: Carl Banks wrote: Regardless of how magnaminous the people of PSF are, the unfortunate reality is that trademark owners are forced by the law to be "particularly petty". PSF's IP lawyer will advise not to allow unsanctioned fork of Python 2.7 to call

Re: Need help with a program

2010-01-28 Thread nn
Arnaud Delobelle wrote: > nn writes: > > > On Jan 28, 10:50 am, evilweasel wrote: > >> I will make my question a little more clearer. I have close to 60,000 > >> lines of the data similar to the one I posted. There are various > >> numbers next to the sequence (this is basically the number of t

Re: myths about python 3

2010-01-28 Thread Ethan Furman
Steven D'Aprano wrote: 4. Python 3 will make you irresistible to women. FALSE What?!? Drat!!! Guess I'll have to learn Lisp... ;) ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: mix statically typed with dynamically typed

2010-01-28 Thread Diez B. Roggisch
Am 28.01.10 22:12, schrieb Yingjie Lan: We all know that Python is dynamically typed, and dynamically typed languages are generally slower than statically typed ones. I wonder if it is possible at all for Python to mix statically-typed-ness with dynamically-typed-ness to boost up its speed a l

  1   2   >