Re: print >> to a derived file

2008-01-15 Thread Ben Fisher
This might have something to do with the class being derived from file. I've written it so that it doesn't derive from file, and it works. class File_and_console(): def __init__(self, *args): self.fileobj = open(*args) def write(self, s): self.fileo

Re: Another dumb scope question for a closure.

2008-01-09 Thread Ben Fisher
One way to get this to work is: def inc(jj): def dummy(jj = jj): jj = jj + 1 return jj return dummy h = inc(33) print h() It's not very pretty though, especially when you have many variables you want to have in the inner scope. -Ben On 1/9/08, Mi

Structure of packages

2008-01-09 Thread Ben Fisher
I am trying to learn the best way to do intra-package references. My package looks like this: PackageName __init__.py /a __init__.py a.py ... /b __init__.py ... /c __init__.py ... /d __init__.py ... I have l