Re: Python backup programs?

2011-05-10 Thread Laurent Claessens
Le 11/05/2011 01:57, James Mills a écrit : > On Wed, May 11, 2011 at 9:00 AM, Dan Stromberg wrote: >> >> What are your favorite backup programs written, in whole or in part, in >> Python? My favorite one is the one I wrote myself for myself ;) The point I like : 1. the backup is a simple co

Merge multiple source directories into one package with distutils?

2011-05-10 Thread Gregory Ewing
Is there a straightforward way to tell distutils to merge .py files from more than one source directory into a single package when installing? PyGUI consists of some generic modules and some platform specific ones, that conceptually all live at the same level within a single package. In the sourc

Re: Non Programming in python

2011-05-10 Thread rusi
On May 11, 12:28 am, Terry Reedy wrote: > On 5/10/2011 12:41 PM, rusi wrote: > > > Sorry for a silly subject change: A better one will be welcome -- cant > > think of a name myself. > > Associated tools. I might separate them into development tools (up to > the production of python.exe) and usage

Re: Overuse of try/except/else?

2011-05-10 Thread James Mills
On Tue, May 10, 2011 at 7:34 PM, Jean-Michel Pichavant wrote: > You can reraise the exception without loosing the stack trace. > > try: > ... > except SomeException, exc: > log(exc) > print 'Hello world' > raise # "raise exc" would loose the original stack trace Valid point :) However I was refer

Re: Overuse of try/except/else?

2011-05-10 Thread Paul Probert
On 05/09/2011 07:40 PM, Kyle T. Jones wrote: It has been hard for me to determine what would constitute overuse. Cheers. Well, for me the power of exceptions is that it lets me write much more concise code. For example, suppose I call a routine I wrote over and over, and I have to check for e

Re: This it is the code of tmb_import.py (to matter of .tmb to blender) I need tmb_exporter.py (to export of blender to .tmb) Thanks.

2011-05-10 Thread Gabriel Genellina
En Tue, 10 May 2011 15:51:03 -0300, Jean Carlos Páez Ramírez escribió: The attached file is script of blender fact in python that .tmb serves to concern archives (secondly attached file), unloadings to blender and uses Por lo que pude entender, tu problema es bastante específico de Blender,

Re: Python backup programs?

2011-05-10 Thread James Mills
On Wed, May 11, 2011 at 9:00 AM, Dan Stromberg wrote: > > What are your favorite backup programs written, in whole or in part, in > Python? > > What do you like about them?  Dislike about them? > > Are there any features you wish your backup program had, whether in Python > or not? Recently I wro

Python backup programs?

2011-05-10 Thread Dan Stromberg
What are your favorite backup programs written, in whole or in part, in Python? What do you like about them? Dislike about them? Are there any features you wish your backup program had, whether in Python or not? Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Non Programming in python

2011-05-10 Thread Steven D'Aprano
On Tue, 10 May 2011 09:41:19 -0700, rusi wrote: > Sorry for a silly subject change: A better one will be welcome -- cant > think of a name myself. > > There is this whole area of python that may be called the non- > programming side of programming: > > Is there some central site where all such i

Re: What other languages use the same data model as Python?

2011-05-10 Thread Gregory Ewing
Chris Angelico wrote: There has to be a way to get from some mythical "home" location (which we know in Python as locals()+globals()+current expression - the "current namespace") to your object. That might involve several names, or none at all, but if there's no such path, the object is unrefere

Re: Non Programming in python

2011-05-10 Thread Terry Reedy
On 5/10/2011 12:41 PM, rusi wrote: Sorry for a silly subject change: A better one will be welcome -- cant think of a name myself. Associated tools. I might separate them into development tools (up to the production of python.exe) and usage tools (everything thereafter). On Windows, this is a

Re: What other languages use the same data model as Python?

2011-05-10 Thread Terry Reedy
On 5/10/2011 3:41 AM, Gregory Ewing wrote: Actually, you're right. What I've presented is a paper-and-pencil implementation of the Python data model. Together with a set of rules for manipulating the diagram under the direction of Python code, you have a complete implementation of Python that yo

This it is the code of tmb_import.py (to matter of .tmb to blender) I need tmb_exporter.py (to export of blender to .tmb) Thanks.

2011-05-10 Thread Jean Carlos Páez Ramírez
I need help. Hello. The attached file is script of blender fact in python that .tmb serves to concern archives (secondly attached file), unloadings to blender and uses script and concerns the second file that you shipment you see so that it. Everything can be published and, but it is not poss

Re: vertical ordering of functions

2011-05-10 Thread Hans Georg Schaathun
On Tue, 3 May 2011 18:08:27 -0400, Jabba Laci wrote: : I'm just reading Robert M. Martin's book entitled "Clean Code". In Ch. : 5 he says that a function that is called should be below a function : that does the calling. This creates a nice flow down from top to : bottom. My advice would be

Re: Python 3 dict question

2011-05-10 Thread Raymond Hettinger
On May 6, 12:40 pm, dmitrey wrote: > hi all, > suppose I have Python dict myDict and I know it's not empty. > I have to get any (key, value) pair from the dict (no matter which > one) and perform some operation. > In Python 2 I used mere > key, val = myDict.items()[0] > but in Python 3 myDict.item

Re: string formatting

2011-05-10 Thread Raymond Hettinger
> Which is the preferred way of string formatting? > > (1) "the %s is %s" % ('sky', 'blue') > > (2) "the {0} is {1}".format('sky', 'blue') > > (3) "the {} is {}".format('sky', 'blue') > > As I know (1) is old style. (2) and (3) are new but (3) is only > supported from Python 2.7+. > > Which one sho

Re: Dictionary Views -- good examples? [was Re: Python 3 dict question]

2011-05-10 Thread Ethan Furman
Ian Kelly wrote: On Fri, May 6, 2011 at 4:49 PM, Ethan Furman wrote: Anybody care to chime in with their usage of this construct? You should start with PEP 3106. The main idea is that dict.keys() and dict.items() can be treated as frozensets, while still being more lightweight than lists. Th

Python-URL! - weekly Python news and links (May 10)

2011-05-10 Thread Cameron Laird
[This content provided by Gabriel Genellina, despite what the "From:" line says.] QOTW: "Often, the cleverness of people is inversely proportional to the amount of CPU power and RAM that they have in their computer. Unfortunately, the difficulty in debugging and maintaining code is often directl

Non Programming in python

2011-05-10 Thread rusi
Sorry for a silly subject change: A better one will be welcome -- cant think of a name myself. There is this whole area of python that may be called the non- programming side of programming: Is there some central site where all such is put up? What if any should such a bundle of things be called?

Re: scipy

2011-05-10 Thread Hans Georg Schaathun
On Sun, 8 May 2011 03:44:06 -0700 (PDT), pb wrote: : I', having trouble with scipy. I have followed the instructions at : scipy website and have installed the following on my mac osx 10.6.6 : (...) : I'm assuming I have the wrong version of something, would that be : right? : Does anyone k

Re: What other languages use the same data model as Python?

2011-05-10 Thread Chris Angelico
On Wed, May 11, 2011 at 1:40 AM, Hans Georg Schaathun wrote: > On Wed, 11 May 2011 01:27:36 +1000, Chris Angelico >   wrote: > :  Language is for communication. If we're not using the same meanings > :  for words, we will have problems. > > So if you adopt the word class to mean a type (or compos

Re: What other languages use the same data model as Python?

2011-05-10 Thread Hans Georg Schaathun
On Wed, 11 May 2011 01:27:36 +1000, Chris Angelico wrote: : Language is for communication. If we're not using the same meanings : for words, we will have problems. So if you adopt the word class to mean a type (or composite type), as in python, what word would you use for a class of types (as

Re: What other languages use the same data model as Python?

2011-05-10 Thread Chris Angelico
On Wed, May 11, 2011 at 1:16 AM, Grant Edwards wrote: > And what do we mean by "agree"? > > What do we mean by "mean"? > > It's turtles all they down... When I use a word, it means just what I choose it to mean - neither more nor less. -- Humpty Dumpty. Language is for communication. If we're no

Re: What other languages use the same data model as Python?

2011-05-10 Thread Grant Edwards
On 2011-05-10, Hans Georg Schaathun wrote: > On Tue, 10 May 2011 14:05:34 + (UTC), Grant Edwards > wrote: >: Because it's easier to communicate if everybody agrees on what a word >: means. > > Why should we agree on that particular word? Are there any other words > we agree about? Other

Re: What other languages use the same data model as Python?

2011-05-10 Thread Hans Georg Schaathun
On Tue, 10 May 2011 14:05:34 + (UTC), Grant Edwards wrote: : Because it's easier to communicate if everybody agrees on what a word : means. Why should we agree on that particular word? Are there any other words we agree about? Other key words, such as class, object, or function don't ha

Re: string formatting

2011-05-10 Thread Chris Angelico
On Wed, May 11, 2011 at 12:15 AM, Web Dreamer wrote: > I was unsure of the difference between deprecated and obsolete. > > So now, if I understand well, obsolete comes before deprecated, such that if > a feature is obsolete it will be deprecated in an unknown future, after > which it will be remov

Re: What other languages use the same data model as Python?

2011-05-10 Thread Grant Edwards
On 2011-05-10, Gregory Ewing wrote: > Steven D'Aprano wrote: > >> It's just that the term "variable" is so useful and so familiar that it's >> easy to use it even for languages that don't have variables in the C/ >> Pascal/Fortran/etc sense. > > Who says it has to have the Pascal/Fortran/etc sens

Re: Overuse of try/except/else?

2011-05-10 Thread Hans Georg Schaathun
On Tue, 10 May 2011 07:36:42 -0400, Adam Tauno Williams wrote: : On Mon, 2011-05-09 at 19:40 -0500, Kyle T. Jones wrote: : > It has been hard for me to determine what would constitute overuse. : : The chronic problem is under use; so I wouldn't worry much about it. : : try/except should occ

Re: Testing tools classification

2011-05-10 Thread rusi
On May 10, 8:55 am, "Gabriel Genellina" wrote: > En Sat, 07 May 2011 02:21:02 -0300, rusi escribió: > > > There is this nice page of testing tools taxonomy: > >http://pycheesecake.org/wiki/PythonTestingToolsTaxonomy > > > But it does not list staf:http://staf.sourceforge.net/index.php. > > The go

Re: Overuse of try/except/else?

2011-05-10 Thread Adam Tauno Williams
On Mon, 2011-05-09 at 19:40 -0500, Kyle T. Jones wrote: > It has been hard for me to determine what would constitute overuse. The chronic problem is under use; so I wouldn't worry much about it. try/except should occur as often as is required for the application to either deal gracefully with the

Re: How to access elemenst in a list of lists?

2011-05-10 Thread Algis Kabaila
On Tuesday 10 May 2011 17:44:44 Terry Reedy wrote: > On 5/10/2011 3:22 AM, Algis Kabaila wrote: > > On Tuesday 10 May 2011 11:25:59 Terry Reedy wrote: > > > class listwrap: > > > def __init__(self, lis): > > > self._list = lis > > > > > > def __getitem__(self, dex): > > > i,j = dex >

Re: can't get urllib2 or httplib to work with tor & privoxy

2011-05-10 Thread Chris Angelico
On Tue, May 10, 2011 at 4:20 AM, Bob Fnord wrote: > Both methods give me a 503 error... As a networking geek, my first thought would be to fire up a tiny little "snoop server" and see what, exactly, the two methods are doing. (Ignore the HTTPS options as they're more complicated to snoop on; you'

Re: A suggestion for an easy logger

2011-05-10 Thread TheSaint
Vinay Sajip wrote: > No, you can pass keyword arguments in any order - that's what makes > them keyword, as opposed to positional, arguments. I getting puzzled :) ==code== myself@laptop-~> python Python 3.2 (r32:88445, Apr 15 2011, 1

Re: What other languages use the same data model as Python?

2011-05-10 Thread Chris Angelico
On Tue, May 10, 2011 at 12:29 AM, Steven D'Aprano wrote: > If objects can be in two places at once, why can't names? Just because. Because then you'd need some way to identify which object you wanted to refer to - something like name[0] and name[1]. A tuple is one effective way to do this (sort o

Re: Overuse of try/except/else?

2011-05-10 Thread Jean-Michel Pichavant
James Mills wrote: On Tue, May 10, 2011 at 10:40 AM, Kyle T. Jones wrote: It has been hard for me to determine what would constitute overuse. A rule of thumb I always follow and practice is: "Let the error lie where it occurred." or "Don't hide errors.". It's good practice to foll

Re: What other languages use the same data model as Python?

2011-05-10 Thread Gregory Ewing
Steven D'Aprano wrote: All very good, but that's not what takes place at the level of Python code. It's all implementation. Actually, you're right. What I've presented is a paper-and-pencil implementation of the Python data model. Together with a set of rules for manipulating the diagram under

Re: How to access elemenst in a list of lists?

2011-05-10 Thread Terry Reedy
On 5/10/2011 3:22 AM, Algis Kabaila wrote: On Tuesday 10 May 2011 11:25:59 Terry Reedy wrote: > class listwrap: > def __init__(self, lis): > self._list = lis > def __getitem__(self, dex): > i,j = dex > return self._list[i][j] > # __setitem__: exercise for reader > l = listw

Re: How to access elemenst in a list of lists?

2011-05-10 Thread Algis Kabaila
On Tuesday 10 May 2011 17:22:42 Algis Kabaila wrote: > On Tuesday 10 May 2011 11:25:59 Terry Reedy wrote: > > On 5/9/2011 8:44 PM, Algis Kabaila wrote: > > > The method of double indexing in the manner > > > a[i][j] > > > for the (i, j) -th element of multi-dimensional array is > > > well known and

Re: How to access elemenst in a list of lists?

2011-05-10 Thread Algis Kabaila
On Tuesday 10 May 2011 11:25:59 Terry Reedy wrote: > On 5/9/2011 8:44 PM, Algis Kabaila wrote: > > The method of double indexing in the manner > > a[i][j] > > for the (i, j) -th element of multi-dimensional array is > > well known and widely used. But how to enable the > > "standard" matrix notatio