Re: Shared memory python between two separate shell-launched processes

2011-02-11 Thread Charles Fox (Sheffield)
On Feb 10, 6:22 pm, Jean-Paul Calderone wrote: > On Feb 10, 12:21 pm, "Charles Fox (Sheffield)" > wrote: > > > > > On Feb 10, 3:43 pm, Jean-Paul Calderone > > wrote: > > > > On Feb 10, 9:30 am, "Charles Fox (Sheffield)" > > >

Re: Shared memory python between two separate shell-launched processes

2011-02-10 Thread Charles Fox (Sheffield)
On Feb 10, 3:43 pm, Jean-Paul Calderone wrote: > On Feb 10, 9:30 am, "Charles Fox (Sheffield)" > wrote: > > > Hi guys, > > I'm working on debugging a large python simulation which begins by > > preloading a huge cache of data.  I want to step through

Shared memory python between two separate shell-launched processes

2011-02-10 Thread Charles Fox (Sheffield)
Hi guys, I'm working on debugging a large python simulation which begins by preloading a huge cache of data. I want to step through code on many runs to do the debugging. Problem is that it takes 20 seconds to load the cache at each launch. (Cache is a dict in a 200Mb cPickle binary file). So

Re: PDB how to define a global inspection function?

2011-02-10 Thread Charles Fox (Sheffield)
On Feb 8, 11:37 am, Peter Otten <__pete...@web.de> wrote: > CharlesFox(Sheffield) wrote: > > Hi guys, I'm new to this group and have a question about debugging. > > I'm stepping through my code (using emacs pdbtrack and python-mode.el) > > and would like to isnpect objects as I go.  So I've defi

PDB how to define a global inspection function?

2011-02-08 Thread Charles Fox (Sheffield)
ternal libraries). Is there a way to put it in the global scope for pdb to use? Also is there a way to automatically import it whenever pdb starts up (like a matlab startup file)? (I'm not using ipython as it's not happy with pdbtrack in emacs, so am launching from emacs M- x pdb

array.shape() gives TypeError: 'tuple' object is not callable

2007-12-10 Thread Charles Fox
Hi gys -- I am looking at Numpy but getting this error when I try to get array sizes. I'm using Ubuntu Edgy with standard repositories and scipy. Any ideas? Am I doing something wrong or is it my install of scipy? $ python Python 2.4.4c1 (#2, Oct 11 2006, 21:51:02) [GCC 4.1.2 20060928 (prerelea

Hide comments in emacs python mode?

2007-10-30 Thread Charles Fox
Hi guys, I'm playing with Python in emacs, with python mode. I'd like to be able to press a key to toggle the code comments on and off -- to switch between beautiful clean Python code, and the full text that tells me what's going in in English. Is this currently possible? I know there is a hide

Re: newbie: self.member syntax seems /really/ annoying

2007-09-13 Thread Charles Fox
hmm, I guess this is the difference between numerical programming and the rest -- sure, if I was writing a database server or something it would be great to have thisObject.veryLongName to know what everything is -- however when you are implementing a model from a published paper, the variables ten

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread Charles Fox
Thanks guys -- yeah these two stategies (short s.varname; and explicit rescoping, a=self.a etc) are more or less what I was using. That's still kind of annoying though. The s.varname approach still makes numerical code much harder to read. I had a nasty bug with the boilerplate approach when for

newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread Charles Fox
I've just started playing around with Python, as a possible replacement for a mix of C++, Matlab and Lisp. The language looks lovely and clean with one huge exception: I do a lot of numerical modeling, so I deal with objects (like neurons) described mathematically in papers, by equations like