Discovery of unpickleables in class heirarchies.

2007-06-22 Thread Brian L. Troutwine
I've a need to pickle arbitrary class hierarchies, which, luckily, can be made to conform to the pickle protocol. At the moment, however, I'm having a rather hard time discovering which classes in a heirarchy cannot be pickles. For instance, say class A has class B in it's __dict__ and let class B

Re: Comments appreciated on Erlang inspired Process class.

2007-06-01 Thread Brian L. Troutwine
On Friday 01 June 2007 10:48:10 Paul Boddie wrote: > On 1 Jun, 19:34, "Brian L. Troutwine" <[EMAIL PROTECTED]> > > wrote: > > Lately I've been tinkering around with Erlang and have begun to sorely > > want some of its features in Python, mostly the e

Comments appreciated on Erlang inspired Process class.

2007-06-01 Thread Brian L. Troutwine
Lately I've been tinkering around with Erlang and have begun to sorely want some of its features in Python, mostly the ease at which new processes can be forked off for computation. To that end I've coded up a class I call, boringly enough, Process. It takes a function, its args and keywords and

distutils data file difficulties

2007-01-18 Thread Brian L. Troutwine
I am new to the use of distutils and am having difficulty getting distutils recognize and install data files. Here are the relevant parts of my source directory: ExampleTree/ |-- __init__.py |-- data | |-- Example1.txt | |-- Example2.txt | `-- __init__.py |-- subPackage1 | |-- (...) `-- su

pgen2 use questions.

2007-01-09 Thread Brian L. Troutwine
I happened to stumble upon Guido's announcement of his python2 to python3 refactoring tool earlier today (http://mail.python.org/pipermail/python-3000/2006-December/005102.html), and, after playing with it a bit, I have some use questions as I don't quite understand how the pattern matching languag

pprint: "...thank small children who sleep at night."

2006-09-19 Thread Brian L. Troutwine
The heading comment to pprint reads: # This is a simple little module I wrote to make life easier. I didn't # see anything quite like it in the library, though I may have overlooked # something. I wrote this when I was trying to read some heavily nested # tuples with fairly non-descriptive c

Re: Delete items in nested dictionary based on value.

2006-09-14 Thread Brian L. Troutwine
This is a general reply to all. Thanks for all the suggestions. I hadn't really thought about filtering empty dictionaries because the data I'm processing won't have them, but it does make for a much nicer, more general filter. I did end up using bearophileH's code, but that's mostly because he go

Re: Delete items in nested dictionary based on value.

2006-09-14 Thread Brian L. Troutwine
ight in that if I did indeed need the original dictionary unchanged it would be much, much easier to modify the pretty-printer. Dennis Lee Bieber wrote: > On 13 Sep 2006 16:08:37 -0700, "Brian L. Troutwine" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: >

Delete items in nested dictionary based on value.

2006-09-13 Thread Brian L. Troutwine
I've got a problem that I can't seem to get my head around and hoped somebody might help me out a bit: I've got a dictionary, A, that is arbitarily large and may contains ints, None and more dictionaries which themselves may contain ints, None and more dictionaries. Each of the sub-dictionaries is

Re: Help me use my Dual Core CPU!

2006-09-12 Thread Brian L. Troutwine
John Henry wrote: > I don't know what CPython is but I have developed a Python application > under Windows that utilize the Dure Core CPU when it's present. It's the default python implementation, the one you find at python.org. It happens to be written in C. Other python implementations included

Pylint-like source code reformatter

2006-03-30 Thread Brian L. Troutwine
I've recently developed a need for a python source code re-formatter, ideally conforming to the sort of style that pylint enforces. I don't know of any, and my googling wasn't very productive. Does anyone know of anything? Stand-alone or vim based both work for me, though stand-alone would be prefe

Re: grayscale pixel based graphics with pygame

2006-03-09 Thread Brian L. Troutwine
Geez, I apologize for my post being so vague. I was terribly tired when I wrote that, and should have known better than to post. I was not aware of the pygame mailing list. I will take this question there. -- http://mail.python.org/mailman/listinfo/python-list

Re: grayscale pixel based graphics with pygame

2006-03-09 Thread Brian L. Troutwine
Thank you, but that wasn't quite what I was looking for. I do admit, however, that my post wasn't very clear (writting while exceptionally tired is not a very clever thing to do.) As Terry mentioned below this should be a question for the pygame mailing lists, so I'll take it there. Thanks again t

grayscale pixel based graphics with pygame

2006-03-08 Thread Brian L. Troutwine
I've recently begun to teach myself pygame by making a bunch of small toys. My current toy is cellular automata displayer and I've gotten a bit stuck on the displaying bit. (If automata isn't the plural of automaton please forgive me.) The current automata are only binary and are calculated using 2

Re: recursive function return value problems

2005-12-28 Thread Brian L. Troutwine
[EMAIL PROTECTED] wrote: def reTest(bool): > > ... result = [] > ... if not bool: > ... reTest(True) > ... else: > ... print "YAHHH" > ... result = ["should be the only thing returned"] > ... print "printing result: " > ... print result > ... return re