[ANN] pyKook 0.7.0 - task automation tool for Python, similar to Rake or Ant

2011-11-04 Thread Makoto Kuwata
Hi, I have released pyKook 0.7.0. http://pypi.python.org/pypi/Kook/ http://www.kuwata-lab.com/kook/ http://www.kuwata-lab.com/kook/pykook-users-guide.html In this release, you can run commands on remote machines using ssh. This is very useful to deploy your application. pyKook Overview

Can I fully replace GNU Bash with Python?

2011-11-04 Thread Jason Hsu, Mr. Swift Linux
This question concerns my process of creating Swift Linux from the base distro (antiX Linux in the past, Linux Mint Debian Edition now). (NOTE: The process I'm describing here is an oversimplification.) All of my development work takes place in the ~/develop directory. This is the directory where

Re: SystemError when defining

2011-11-04 Thread Joshua Landau
> > Joshua found bugs.python.org and, 2 hours later, a fix was applied. > http://bugs.python.org/**issue13343 > It was impressively fast. Those python devs are like a hawk. Although I wasn't expecting a three-line patch (plus a three line test). -- http://mail.

Re: SystemError when defining

2011-11-04 Thread Terry Reedy
On 11/4/2011 3:10 PM, Joshua Landau wrote: > >> def x(nonlocal_var): ... def y(): ... z = lambda *, keyword_only=nonlocal_var: None ... return y ... >>> x(None)() ... SystemError: no locals when loading 'nonlocal_var' ... Now - where shall I re

Re: leftover pyc files

2011-11-04 Thread Steven D'Aprano
On Fri, 04 Nov 2011 16:01:14 -0400, Terry Reedy wrote: > For those not aware, the compiled file caching and import system was > changed for 3.2. Given test.py, the compiled file is no longer test.pyc, > in the same directory, but (for cpython32) > __pycache__/test.cpython-32.pyc. Given the stateme

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

2011-11-04 Thread Ned Deily
Search for presentations and videos by Alex Martelli. He's the goto (so to speak) person on Python design patterns. Here, for instance: http://code.google.com/edu/languages/#_python_patterns -- Ned Deily, n...@acm.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Line continuation issue\

2011-11-04 Thread Terry Reedy
On 11/4/2011 11:10 AM, Steven Lehar wrote: Is this the right place to propose language extensions? Yes, especially for beginners not familiar with previous discussions. My Python code keeps expanding rightwards, it is difficult to keep it contained within reasonable limits. But the standard l

Re: leftover pyc files

2011-11-04 Thread Terry Reedy
For those not aware, the compiled file caching and import system was changed for 3.2. Given test.py, the compiled file is no longer test.pyc, in the same directory, but (for cpython32) __pycache__/test.cpython-32.pyc. Given the statement 'import test', the __pycache__ directory is only searched

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

2011-11-04 Thread Terry Reedy
On 11/4/2011 8:46 AM, Andrea Crotti wrote: Well this book is work in progress Though not touched since May 2009 https://bitbucket.org/BruceEckel/python-3-patterns-idioms/src but it actually looks very interesting The slightly older .pdf version is a bit bizarre as parts of both text and

Re: SystemError when defining

2011-11-04 Thread Joshua Landau
> > >>> def x(nonlocal_var): ... def y(): ... z = lambda *, keyword_only=nonlocal_var: None ... return y ... >>> x(None)() Traceback (most recent call last): File "", line 1, in File "", line 3, in y SystemError: no locals when loading 'nonlocal_var' >>> dis.dis(x

short reading materials about anthropological, universal themes for students with no reading habit ...

2011-11-04 Thread lbrt
> A few things to note: > * Not all sites necessarily send the Content-Length header. > * RTMP URLs would have to be treated differently ~ No some don't, but at least for the ones that do (like youtube) it would be a useful feature. The Content-Length header is used in the code anyway ~ > * Se

Re: Line continuation issue\

2011-11-04 Thread Chris Angelico
On Sat, Nov 5, 2011 at 2:53 AM, Steven Lehar wrote: > > > > How's it anti-Pythonic for invisible whitespace differences to be significant? > A central idea of Python was to replace {curly;braces{and;parentheses;}}, > which are easily overlooked by the programmer, and use WHITESPACE instead, > so

Re: Line continuation issue\

2011-11-04 Thread Steven Lehar
> How's it anti-Pythonic for invisible whitespace differences to be significant? A central idea of Python was to replace {curly;braces{and;parentheses;}}, which are easily overlooked by the programmer, and use WHITESPACE instead, something that is clearly visible to the programmer, as the defining

Re: Line continuation issue\

2011-11-04 Thread Chris Angelico
On Sat, Nov 5, 2011 at 2:10 AM, Steven Lehar wrote: > But the standard line continuation \ > is positively anti-Pythonic because an *invisible* white space between \ and > [CR] will render it useless. How's it anti-Pythonic for invisible whitespace differences to be significant? ChrisA *grinni

Re: Line continuation issue\

2011-11-04 Thread Peter Otten
Steven Lehar wrote: > Is this the right place to propose language extensions? > > My Python code keeps expanding rightwards, it is difficult to keep it > contained within reasonable limits. You should attack this by breaking large expressions into smaller ones and factoring out some of your co

Line continuation issue\

2011-11-04 Thread Steven Lehar
Is this the right place to propose language extensions? My Python code keeps expanding rightwards, it is difficult to keep it contained within reasonable limits. But the standard line continuation \ is positively anti-Pythonic because an *invisible* white space between \ and [CR] will render it us

Re: Python advanced course (preferably in NA)

2011-11-04 Thread Behnam
This was great. Thank you all! /Behnam On Nov 3, 5:18 pm, Catherine Moroney wrote: > I've taken twoPythonclasses from David Beazley and can second > Eric's recommendation.  The "advanced" class is reallyadvanced > and goes into some pretty mind-blowing stuff.  The class comes with > lots of prob

Re: leftover pyc files

2011-11-04 Thread 88888 Dihedral
Uhn, thanks for the easy way Just delete all *.pyc recursively. spend another 5-20 minutes to recompile all to get everything sync.. That is trivial! -- http://mail.python.org/mailman/listinfo/python-list

Re: python-based downloader (youtube-dl) missing critical feature ...

2011-11-04 Thread Jean-Michel Pichavant
Steven D'Aprano wrote: On Fri, 04 Nov 2011 11:48:02 +, lbrt chx _ gemale wrote: python-based youtube-dl ~ http://rg3.github.com/youtube-dl/ ~ is sorely missing a flag in order to indicate the maximum file length of the data feed it would download (well, unless, for some reason, it is

Re: python-based downloader (youtube-dl) missing critical feature ...

2011-11-04 Thread Philipp Hagemeister
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 As already said, you should file your request at https://github.com/rg3/youtube-dl/issue , not here. A few things to note: * Not all sites necessarily send the Content-Length header. * RTMP URLs would have to be treated differently * Sending a Rang

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

2011-11-04 Thread Andrea Crotti
On 11/04/2011 12:33 AM, 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 am doing some 'fact-finding' in this area on

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

2011-11-04 Thread Joe Riopel
On Fri, Nov 4, 2011 at 8:28 AM, John Roth wrote: > The first is that if you use TDD (Test Driven Development) and > refactor relentlessly to remove duplication, most of the basic design > patterns will emerge naturally from the code as you work. I agree, and there is a pretty good series of artic

Re: python-based downloader (youtube-dl) missing critical feature ...

2011-11-04 Thread Steven D'Aprano
On Fri, 04 Nov 2011 11:48:02 +, lbrt chx _ gemale wrote: > python-based youtube-dl > ~ > http://rg3.github.com/youtube-dl/ > ~ > is sorely missing a flag in order to indicate the maximum file length > of the data feed it would download (well, unless, for some reason, it > is considered a "

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

2011-11-04 Thread John Roth
On Nov 3, 6: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 am doing some 'fact-finding' in this

Re: Dictionary sorting

2011-11-04 Thread Ben Finney
Hrvoje Niksic writes: > Ben Finney writes: > > > Tim Chase writes: > >> Does this "never trust it" hold even for two consecutive iterations > >> over an unchanged dict? I didn't see anything in the docs[1] to make > >> such a claim, > > > > Exactly. > > This is false. The docs say: > > If

python-based downloader (youtube-dl) missing critical feature ...

2011-11-04 Thread lbrt
python-based youtube-dl ~ http://rg3.github.com/youtube-dl/ ~ is sorely missing a flag in order to indicate the maximum file length of the data feed it would download (well, unless, for some reason, it is considered a "feature"). ~ I wonder what developers were thinking about when they cam

Re: leftover pyc files

2011-11-04 Thread Andrea Crotti
On 11/04/2011 10:39 AM, Chris Angelico wrote: If you're removing them all, you don't need to use a powerful shell. Much much easier! Just recursively del *.pyc and you're done. ChrisA Discussing with the guy that did it I think it's actually a good idea instead, because removing them *all* me

Re: SystemError when defining

2011-11-04 Thread Joshua Landau
On 11/3/11, Chris Angelico wrote: > Fascinating! Awesome to know! > I did some introspection with this: > *snip* > > Variations on the theme show that during compilation of foo, the name > is normally cemented as either a global or a local - but if it's > keyword-only, then a LOAD_NAME opcode is

Re: leftover pyc files

2011-11-04 Thread Chris Angelico
On Fri, Nov 4, 2011 at 9:34 PM, Andrea Crotti wrote: > Uhm yes it makes sense also to just remove all of them, I don't know why it > was done like this but > probably for "performance" reasons. > > I will try both ways, but I would definitively avoid the shell scripting, > because it's mainly wind

Re: leftover pyc files

2011-11-04 Thread Andrea Crotti
On 11/04/2011 09:27 AM, Jonathan Hartley wrote: I like to install a Bash shell of some kind on windows boxes I work on, specifically so I can use shell commands like this, just like on any other operating system. Cywin works just fine for this. svn also has hooks, but sadly not a checkout hook

Re: Dictionary sorting

2011-11-04 Thread Hrvoje Niksic
Ben Finney writes: > 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 w

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

2011-11-04 Thread Ulrich Eckhardt
Am 04.11.2011 01:33, schrieb Anthony Kong: I would like to find out what is the current prevailing view or consensus (if any) on the use of Design Pattern in python? My consensus with myself is that design patterns are language-agnostic. If I write "class Foo serves as view and controller for

Re: leftover pyc files

2011-11-04 Thread Jonathan Hartley
Apologies for all my messasges appearing twice. I'm using google groups web ui and have no idea why it's doing that. I'll stop using it. -- http://mail.python.org/mailman/listinfo/python-list

Re: leftover pyc files

2011-11-04 Thread Jonathan Hartley
I like to install a Bash shell of some kind on windows boxes I work on, specifically so I can use shell commands like this, just like on any other operating system. Cywin works just fine for this. svn also has hooks, but sadly not a checkout hook: http://svnbook.red-bean.com/en/1.1/ch05s02.html

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

2011-11-04 Thread Stefan Behnel
Alec Taylor, 03.11.2011 11:19: 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 Those are pretty broad requirements. If a framework can satisfy them or not depends more on how y

Re: ctypes: catch system exit from C library

2011-11-04 Thread Nobody
On Thu, 03 Nov 2011 14:16:50 +, Grant Edwards wrote: >>> 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? I'm reasonably sure that he's talking about t