Re: how to acces the block inside of a context manager as sourcecode

2008-11-20 Thread Daniel
Hi Aaron, the dataStore combines both the printing and analysis (it will create a report). Unfortunately the end of the block already needs to be known in __enter__, as the report starts to print during the measurement. I decided to do it the following way: __enter__ gets the start line number us

Re: how to acces the block inside of a context manager as sourcecode

2008-11-19 Thread Aaron Brady
See below. On Nov 19, 8:02 am, Daniel <[EMAIL PROTECTED]> wrote: > Hi Aaron, > > let me give you the reason for the context manager: > I am driving handware with a python script, basically a data acquisition > program which looks like this: > > with dataStore('measurement1.dat') as d: >         ma

Re: how to acces the block inside of a context manager as sourcecode

2008-11-19 Thread Daniel
Hi Aaron, let me give you the reason for the context manager: I am driving handware with a python script, basically a data acquisition program which looks like this: with dataStore('measurement1.dat') as d: magnet.setField(0) r1=doExperiment(voltage=0.345, current=0.346, temperat

Re: how to acces the block inside of a context manager as sourcecode

2008-11-18 Thread Aaron Brady
On Nov 18, 3:59 pm, Daniel <[EMAIL PROTECTED]> wrote: > Hello, > > I need to access the code inside of a context manager, i.e. the call to > > with myManager(v=5) as x: >         a=b >         c=sin(x) > > should cause the following output (minus the first line, if that's easier): > > with myManage

how to acces the block inside of a context manager as sourcecode

2008-11-18 Thread Daniel
Hello, I need to access the code inside of a context manager, i.e. the call to with myManager(v=5) as x: a=b c=sin(x) should cause the following output (minus the first line, if that's easier): with myManager(v=5) as x: # I could live without this line a=b c=si