Re: leftover pyc files

2011-11-03 Thread Steven D'Aprano
On Thu, 03 Nov 2011 17:54:52 +, Andrea Crotti wrote: > All these ideas (shell and git hooks) are nice, but unfortunately - it's > svn not git > - it's windows not *nix > - we have to remove only the ones without the corresponding *py... Does it matter? The other .pyc files will be recreated w

Re: Database access benchmarks for use in web-frameworks - How does Python compare?

2011-11-03 Thread 88888 Dihedral
I suggest that the use of dynamical page forwarding to different severs which run the same software package. This can be done in python! -- http://mail.python.org/mailman/listinfo/python-list

Re: match, concatenate based on filename

2011-11-03 Thread John Gordon
In <31568428.553.1320375329695.JavaMail.geo-discussion-forums@prgt40> Matt writes: > But I can't figure out how to iterate this process over Q-numbers 1-1223 for i in xrange(1, 1224): Q = "Q%d" % i file1 = "%s.HOMOblast.fasta" % Q file2 = "%s.mus.blast.fasta" % Q file3 = "%s.query.fasta

Re: match, concatenate based on filename

2011-11-03 Thread Patrick Maupin
On Nov 3, 9:55 pm, Matt wrote: > Hi All, > > I am trying to concatenate several hundred files based on their filename..   > Filenames are like this: > > Q1.HOMOblast.fasta > Q1.mus.blast.fasta > Q1.query.fasta > Q2.HOMOblast.fasta > Q2.mus.blast.fasta > Q2.query.fasta > ... > Q1223.HOMOblast.fasta

match, concatenate based on filename

2011-11-03 Thread Matt
Hi All, I am trying to concatenate several hundred files based on their filename.. Filenames are like this: Q1.HOMOblast.fasta Q1.mus.blast.fasta Q1.query.fasta Q2.HOMOblast.fasta Q2.mus.blast.fasta Q2.query.fasta ... Q1223.HOMOblast.fasta Q1223.mus.blast.fasta Q1223.query.fasta

Re: Design Pattern and Python: Any book recommendation? Your view?

2011-11-03 Thread Chris Rebert
On Thu, Nov 3, 2011 at 5:33 PM, Anthony Kong wrote: > Sorry to resurrect this topic. By google search the last discussion was in > 2003. > > I would like to find out what is the current prevailing view or consensus (if > any) on the use of Design Pattern in python? I can only speak for myself,

Re: Design Pattern and Python: Any book recommendation? Your view?

2011-11-03 Thread Roy Smith
In article <6097694.446.1320366784098.JavaMail.geo-discussion-forums@prap37>, Anthony Kong wrote: > Sorry to resurrect this topic. By google search the last discussion was in > 2003. What? We're bring it up again, SO SOON!? > I would like to find out what is the current prevailing view or

Design Pattern and Python: Any book recommendation? Your view?

2011-11-03 Thread Anthony Kong
Sorry to resurrect this topic. By google search the last discussion was in 2003. I would like to find out what is the current prevailing view or consensus (if any) on the use of Design Pattern in python? I am doing some 'fact-finding' in this area on request of my colleagues. Some of them want

Re: leftover pyc files

2011-11-03 Thread David Robinow
On Thu, Nov 3, 2011 at 1:54 PM, Andrea Crotti wrote: > All these ideas (shell and git hooks) are nice, but unfortunately > - it's svn not git > - it's windows not *nix > - we have to remove only the ones without the corresponding *py... > -- > http://mail.python.org/mailman/listinfo/python-list >

Re: Dictionary sorting

2011-11-03 Thread Ben Finney
Tim Chase writes: > On 11/03/11 16:36, Terry Reedy wrote: > > CPython iterates (and prints) dict items in their arbitrary internal > > hash table order, which depends on the number and entry order of the > > items. It is a bug to depend on that arbitrary order in any way. > > Does this "never tru

Re: Dictionary sorting

2011-11-03 Thread Chris Angelico
On Fri, Nov 4, 2011 at 10:01 AM, Tim Chase wrote: > list1 = list(d.iterkeys()) >  list2 = list(d.iterkeys()) >  assert list1 == list2 > There is such a guarantee in Python 2. From http://docs.python.org/library/stdtypes.html: "If items(), keys(), values(), iteritems(), iterkeys(), and itervalues

Re: SystemError when defining

2011-11-03 Thread Chris Angelico
On Fri, Nov 4, 2011 at 9:24 AM, Joshua Landau wrote: > Non-lambdas work as expected, but a lambda inside a non-lambda still > exhibits this behaviour. > Conclusion: > When setting defaults to keyword-only arguments in lambdas which are inside > non-global scopes, cPython is unable to access the gl

Re: Dictionary sorting

2011-11-03 Thread Tim Chase
On 11/03/11 16:36, Terry Reedy wrote: > Is there a way to not sort them and leave the order as is? CPython iterates (and prints) dict items in their arbitrary internal hash table order, which depends on the number and entry order of the items. It is a bug to depend on that arbitrary order in

SystemError when defining

2011-11-03 Thread Joshua Landau
Try this out (Python 3.2.2 (default, Sep 5 2011, 04:52:19)): global_variable = None > (lambda *, keyword_only=global_variable: None) # Works, as > expected > (lambda: (lambda argument=global_variable: None))()# Works, as > expected > (lambda: (lambda *, keyword_only=global_var

Re: Python advanced course (preferably in NA)

2011-11-03 Thread Catherine Moroney
I've taken two Python classes from David Beazley and can second Eric's recommendation. The "advanced" class is really advanced and goes into some pretty mind-blowing stuff. The class comes with lots of problems and solutions, and a book of all the slides which are a great reference. Well worth

Re: Python advanced course (preferably in NA)

2011-11-03 Thread Catherine Moroney
I've taken two Python classes from David Beazley and can second Eric's recommendation. The "advanced" class is really advanced and goes into some pretty mind-blowing stuff. The class comes with lots of problems and solutions, and a book of all the slides which are a great reference. Well worth

Re: Python advanced course (preferably in NA)

2011-11-03 Thread Len Conrad
http://www.dabeaz.com/pythonmaster.html -- Original Message -- From: Emile van Sebille Date: Thu, 03 Nov 2011 14:25:03 -0700 >On 11/3/2011 11:13 AM Behnam said... >> Anybody is aware of any advanced course in Python preferably in north >> america? >> >>

Re: Dictionary sorting

2011-11-03 Thread Terry Reedy
On 11/3/2011 2:46 PM, Scott Ware wrote: Python newbie here. So, when creating dictionaries, I am noticing that each time I print it out, that its not in the same order as when I typed it in. They seem to be getting sorted somehow. No, the entries are not being sorted at all. > Is there a way t

Re: leftover pyc files

2011-11-03 Thread Chris Angelico
On Fri, Nov 4, 2011 at 4:54 AM, Andrea Crotti wrote: > All these ideas (shell and git hooks) are nice, but unfortunately > - it's svn not git > - it's windows not *nix > - we have to remove only the ones without the corresponding *py... Windows? Well, Windows shell scripting isn't quite as rich a

Re: Python advanced course (preferably in NA)

2011-11-03 Thread Emile van Sebille
On 11/3/2011 11:13 AM Behnam said... Anybody is aware of any advanced course in Python preferably in north america? I've been partly coding in Python for couple of years now and have used PyQt. What I'd like to learn more is a kind of advance OOP in python. Any idea? This list works well for t

Re: Dictionary sorting

2011-11-03 Thread insomnia
Moreover, for on-the-fly ordering you can consider to use sorted() on yourdict.keys(), like: for k in sorted(yourdict.keys()): print k, yourdict[k] I think it has no side effects, except that the orderering can be slow on huge data sets, and that you need to call it every time after updatin

Re: Dictionary sorting

2011-11-03 Thread Chris Kaynor
Note that there are a number of recipes available for free online, and if you are using a newer version of Python (2.7 or higher), the collections module includes an OrderedDict class (http://docs.python.org/library/collections.html#collections.OrderedDict - this also include a library for Python 2

Re: Dictionary sorting

2011-11-03 Thread Scott Ware
Great! Thanks, John for the quick response! -- http://mail.python.org/mailman/listinfo/python-list

Re: Dictionary sorting

2011-11-03 Thread John Gordon
In <16245908.783.1320346014867.JavaMail.geo-discussion-forums@yqhd1> Scott Ware writes: > Python newbie here. So, when creating dictionaries, I am noticing that > each time I print it out, that its not in the same order as when I typed > it in. They seem to be getting sorted somehow. Is there a

Dictionary sorting

2011-11-03 Thread Scott Ware
Python newbie here. So, when creating dictionaries, I am noticing that each time I print it out, that its not in the same order as when I typed it in. They seem to be getting sorted somehow. Is there a way to not sort them and leave the order as is? Thanks! -- http://mail.python.org/mailman/li

Re: Python advanced course (preferably in NA)

2011-11-03 Thread Eric Snow
On Thu, Nov 3, 2011 at 12:13 PM, Behnam wrote: > Anybody is aware of any advanced course in Python preferably in north > america? > > I've been partly coding in Python for couple of years now and have > used PyQt. What I'd like to learn more is a kind of advance OOP in > python. Any idea? While I

Python advanced course (preferably in NA)

2011-11-03 Thread Behnam
Anybody is aware of any advanced course in Python preferably in north america? I've been partly coding in Python for couple of years now and have used PyQt. What I'd like to learn more is a kind of advance OOP in python. Any idea? BTW, I'm not a computer engineer and have mechanical background.

Re: leftover pyc files

2011-11-03 Thread Andrea Crotti
All these ideas (shell and git hooks) are nice, but unfortunately - it's svn not git - it's windows not *nix - we have to remove only the ones without the corresponding *py... -- http://mail.python.org/mailman/listinfo/python-list

Re: AIX installation can't find zlib

2011-11-03 Thread davidj411
we using RPM to install python 2.7.x and same issue there, can't import gzip b/c zlib is missing. we used RPM to install zlib, but did not effect python. you mentioned modules and uncommenting something. could you be more specific? also , we are not compiling. would that be required for python af

Re: Paramiko Question

2011-11-03 Thread MRAB
On 03/11/2011 09:22, Jacob Abraham wrote: Hi All, I need help with the below mentioned script. The second time I call a.execute, self.transport.open_session() fails with an EOF error. Is this a paramiko bug or am I doing something wrong? import paramiko class Connection(object): d

Re: Python Pickling Issue

2011-11-03 Thread Brandon Harris
After digging around a while I discovered I was attempting to pickle a third party class that can't be pickled. Initially I was removing it before pickling and everything was kosher, but at some point it got back onto the class. Apologies. Brandon L. Harris On 11/03/2011 09:42 AM, Brandon Ha

Python Pickling Issue

2011-11-03 Thread Brandon Harris
I have written a fairly large DAG with python and I've run into an issue when attempting to pickle the data to disk. It will pickle fine the first time, but if I call pickle again, it throws this error. /usr/lib64/python2.6/copy_reg.py in _reduce_ex(self, proto) 68 else: 69

Re: ctypes: catch system exit from C library

2011-11-03 Thread Grant Edwards
On 2011-11-03, Ulrich Eckhardt wrote: > Am 03.11.2011 11:07, schrieb Martin Landa: >> in my python application I am calling functions from a C library via >> `ctypes` interface. Some fns from that C library calls `exit()` on >> error. > > Just curious, which library is that? And who should we hav

Re: ctypes: catch system exit from C library

2011-11-03 Thread Ulrich Eckhardt
Am 03.11.2011 11:07, schrieb Martin Landa: in my python application I am calling functions from a C library via `ctypes` interface. Some fns from that C library calls `exit()` on error. Just curious, which library is that? Uli -- http://mail.python.org/mailman/listinfo/python-list

Re: ctypes: catch system exit from C library

2011-11-03 Thread Duncan Booth
Martin Landa wrote: > Hi all, > > in my python application I am calling functions from a C library via > `ctypes` interface. Some fns from that C library calls `exit()` on > error. It causes that the python application crashes even without any > notification. Is it possible to catch library syst

Re: leftover pyc files

2011-11-03 Thread Peter Otten
Jonathan Hartley wrote: > A task like this is more suited to bash than Python: > > find . -name '*.pyc' -exec rm '{}' ';' You forgot to exclude the .svn directory from the search and didn't limit the deletion to pyc-files whose corresponding py-file doesn't exist. How would your line look with

ctypes: catch system exit from C library

2011-11-03 Thread Martin Landa
Hi all, in my python application I am calling functions from a C library via `ctypes` interface. Some fns from that C library calls `exit()` on error. It causes that the python application crashes even without any notification. Is it possible to catch library system exit calls from such python app

Database access benchmarks for use in web-frameworks - How does Python compare?

2011-11-03 Thread Alec Taylor
Good afternoon, I'm building a large e-commerce site, and it is very important that what I write can: - Handle larger server load - Deliver pages quickly - Make transactions quickly as well as have a small development time (i.e. pre-built modules for e-commerce are available, and extendible). Ar

Re: Chaco for real-time plot of PySerial data

2011-11-03 Thread Robert Kern
On 11/1/11 10:27 PM, Jack Keegan wrote: Hi there, I asked this question on the enthought chaco mailing list some time last by have yet to receive a reply. Thought I'd ask here to see if anyone could shed some light on things for me. I have been considering using chaco / traits for close to a yea

Paramiko Question

2011-11-03 Thread Jacob Abraham
Hi All, I need help with the below mentioned script. The second time I call a.execute, self.transport.open_session() fails with an EOF error. Is this a paramiko bug or am I doing something wrong? import paramiko class Connection(object): def __init__(self, host, username = None, passw

Re: leftover pyc files

2011-11-03 Thread Jonathan Hartley
This can be added to your project's .git/hooks/post-checkout: #!/usr/bin/env bash cd ./$(git rev-parse --show-cdup) find . -name '*.pyc' -exec rm '{}' ';' -- http://mail.python.org/mailman/listinfo/python-list

Re: leftover pyc files

2011-11-03 Thread Jonathan Hartley
This can be added to git as a post-checkout hook: In your project's .git/hooks/post-checkout: #!/usr/bin/env bash cd ./$(git rev-parse --show-cdup) find . -name '*.pyc' -exec rm '{}' ';' -- http://mail.python.org/mailman/listinfo/python-list

Re: leftover pyc files

2011-11-03 Thread Jonathan Hartley
A task like this is more suited to bash than Python: find . -name '*.pyc' -exec rm '{}' ';' -- http://mail.python.org/mailman/listinfo/python-list

Re: Full time Job opening -Python lead in washington area.

2011-11-03 Thread Stefan Behnel
Radhika Bauerle, 03.11.2011 01:05: Hello eveyone: Well, and here's the problem already: "everyone". Note that it's commonly considered inappropriate to post job offers on this list. Please use the Python job board instead: http://python.org/community/jobs/ (easy to find by clicking on "pyt