On Mon, Apr 21, 2008 at 4:47 PM, John Machin <[EMAIL PROTECTED]> wrote:
> > > saved = sys.path
> > > sys.path = data['cwd']
> > > module = __import__(data['module'])
> > > sys.path = saved
> > >
> > > > > import os
> > > > > os.chdir('/home/mark/work/proj1')
> > > > > import sys
> > > > > sys.path.append('/home/mark/work/proj1')
> > > > > module = __import__('app')
> > > > > function = getattr(module, 'new')
> > > > > function(1)
> > > > >
> > > >
> > >
> > 1
> >
>
> It's not at all obvious that the "works in shell" code is the same as the
> code in your script.
>
> Consider the possibility that as a result of frantic experimentation you
> have multiple copies of app.* with varying contents lying around.
thanks a lot!
there was a file app.pyc lying around in the dir from which i was
running the script...
--
http://mail.python.org/mailman/listinfo/python-list