Ignore leading '' and ellipsis?

2010-01-14 Thread Reckoner
Hi, I am studying some examples in a tutorial where there are a lot of leading characters and ellipsis in the text. This makes it hard to cut and paste into the IPython interpreter since it doesn't like these strings. Is there another interpreter I could use that will appropriately ignore and

Using logging module for conditional nested logs

2009-11-04 Thread Reckoner
Hi, I am getting started with your logging module and I went through the tutorial and know-how to create a top-level 'root' logger with the appropriate handlers. I have a number of functions,say, def foo1() def foo2() ... foo1() # foo2 calls foo1 and I know how to connect each of these

Re: Using logging module for conditional nested logs

2009-11-04 Thread Reckoner
On Nov 4, 1:30 pm, Vinay Sajip vinay_sa...@yahoo.co.uk wrote: On Nov 4, 7:40 pm, Reckoner recko...@gmail.com wrote: I hope that made some sense. Not especially :-( Sorry I don't understand exactly what you mean, because I find your terminology confusing. For example, logger

initializing with empty list as default causes freaky problems

2009-07-27 Thread Reckoner
Hi, Observe the following: In [202]: class Foo(): .: def __init__(self,h=[]): .: self.h=h .: .: In [203]: f=Foo() In [204]: g=Foo() In [205]: g.h Out[205]: [] In [206]: f.h Out[206]: [] In [207]: f.h.append(10) In [208]: f.h Out[208]: [10] In [209]:

cPickle and subclassing lists?

2009-04-17 Thread Reckoner
I have a large class that is a child of list. I need to pickle it, but it's not working. For example, I have reduced it to the following: class Mylist(list): def __init__(self,x=[]): list.__init__(self,x) and I cannot even get this to pickle right. w=Mylist([1,2,3]) dumps(w)

Re: cPickle and subclassing lists?

2009-04-17 Thread Reckoner
On Apr 17, 10:42 am, Peter Otten __pete...@web.de wrote: Reckoner wrote: I have a large class that is a child of list. I need to pickle it, but it's not working. For example, I have reduced it to the following: class Mylist(list): def __init__(self,x=[]): list.__init__(self,x

Re: cPickle and subclassing lists?

2009-04-17 Thread Reckoner
On Apr 17, 11:16 am, Piet van Oostrum p...@cs.uu.nl wrote: Reckoner recko...@gmail.com (R) wrote: R I have a large class that is a child of list. I need to pickle it, but R it's not working. For example, I have reduced it to the following: R class Mylist(list): R def __init__(self,x

Re: Q: Best book for teaching

2009-04-06 Thread Reckoner
On Apr 6, 7:37 am, grkunt...@gmail.com wrote: I am considering teaching an introduction to programming course for continuing education adults at a local community college. These would people with no programming experience, but I will require a reasonable facility with computers. What would

object knows which object called it?

2009-04-06 Thread Reckoner
hi, I have the following problem: I have two objects, say, A and B, which are both legitimate stand-alone objects with lives of their own. A contains B as a property, so I often do A.B.foo() the problem is that some functions inside of B actually need A (remember I said they were both

Re: self-aware list of objects able to sense constituent member alterations?

2009-01-30 Thread Reckoner
On Jan 28, 9:49 am, koranthala koranth...@gmail.com wrote: On Jan 28, 10:39 pm,Reckonerrecko...@gmail.com wrote: On Jan 28, 9:16 am, koranthala koranth...@gmail.com wrote: On Jan 28, 5:42 pm, koranthala koranth...@gmail.com wrote: On Jan 28, 2:16 am,Reckonerrecko...@gmail.com wrote:

Re: self-aware list of objects able to sense constituent member alterations?

2009-01-29 Thread Reckoner
On Jan 28, 10:17 pm, Peter Wang misterw...@gmail.com wrote: On Jan 27, 3:16 pm,Reckonerrecko...@gmail.com wrote: I'm not sure this is possible, but I would like to have a list of  objects A=[a,b,c,d,...,z] where,  in the midst of a lot of processing I might do something like,

Re: self-aware list of objects able to sense constituent member alterations?

2009-01-28 Thread Reckoner
On Jan 28, 9:16 am, koranthala koranth...@gmail.com wrote: On Jan 28, 5:42 pm, koranthala koranth...@gmail.com wrote: On Jan 28, 2:16 am, Reckoner recko...@gmail.com wrote: I'm not sure this is possible, but I would like to have a list of objects A=[a,b,c,d,...,z] where

Re: self-aware list of objects able to sense constituent member alterations?

2009-01-28 Thread Reckoner
On Jan 27, 9:46 pm, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Tue, 27 Jan 2009 13:16:36 -0800, Reckoner wrote: I'm not sure this is possible, but I would like to have a list of objects A=[a,b,c,d,...,z] where, in the midst of a lot of processing I might do

self-aware list of objects able to sense constituent member alterations?

2009-01-27 Thread Reckoner
I'm not sure this is possible, but I would like to have a list of objects A=[a,b,c,d,...,z] where, in the midst of a lot of processing I might do something like, A[0].do_something_which_changes_the_properties() which alter the properties of the object 'a'. The trick is that I would like A

function argument dependent on another function argument?

2009-01-18 Thread Reckoner
I would like to do: def foo(self,x,y=self.a) where the default value for y=self.a. Since this is not possible, I wind up doing def foo(self,x,y=None) if not y: y=self.a but that seems kind of clumsy. Is there a better way to do this? Thanks in advance --

tricky nested list unpacking problem

2008-12-15 Thread Reckoner
Hi, I have lists of the following type: [1,2,3,[5,6]] and I want to produce the following strings from this as '0-1-2-3-5' '0-1-2-3-6' That was easy enough. The problem is that these can be nested. For example: [1,2,3,[5,6],[7,8,9]] which should produce '0-1-2-3-5-7' '0-1-2-3-5-8'

Re: tricky nested list unpacking problem

2008-12-15 Thread Reckoner
On Dec 15, 1:28 pm, Arnaud Delobelle arno...@googlemail.com wrote: Reckonerrecko...@gmail.com writes: Hi, I have lists of the following type: [1,2,3,[5,6]] and I want to produce the following strings from this as '0-1-2-3-5' '0-1-2-3-6' That was easy enough. The problem is that

from package import * without overwriting similarly named functions?

2008-10-24 Thread Reckoner
I have multiple packages that have many of the same function names. Is it possible to do from package1 import * from package2 import * without overwriting similarly named objects from package1 with material in package2? How about a way to do this that at least gives a warning? Thanks. --

big objects and avoiding deepcopy?

2008-10-24 Thread Reckoner
I am writing an algorithm that takes objects (i.e. graphs with thousands of nodes) into a hypothetical state. I need to keep a history of these hypothetical objects depending on what happens to them later. Note that these hypothetical objects are intimately operated on, changed, and made

access variables from one Python session to another on the same machine?

2008-06-09 Thread Reckoner
Suppose I have two different command windows going on the same machine, each running their own Python interpreters. Is it possible to access the variables in one of the interpreter- sessions from the other? It turns out I have limited control over one of the sessions (i.e. cannot control all the

Re: access variables from one Python session to another on the same machine?

2008-06-09 Thread Reckoner
On Jun 9, 5:23 pm, Daniel Fetchinson [EMAIL PROTECTED] wrote: Suppose I have two different command windows going on the same machine, each running their own Python interpreters. Is it possible to access the variables in one of the interpreter- sessions from the other? It turns out I

use object method without initializing object

2008-04-15 Thread Reckoner
would it be possible to use one of an object's methods without initializing the object? In other words, if I have: class Test: def __init__(self): print 'init' def foo(self): print 'foo' and I want to use the foo function without hitting the initialize constructor function. Is

quick script to read digital terrain elevation data?

2006-02-22 Thread Jose Reckoner
I'm running python 2.3 on Windows XP. Anyone have a quick small script to convert .DT1 and .DEM data to ASCII or some other format? I don't need a viewer. Thanks! -- http://mail.python.org/mailman/listinfo/python-list