Hi. I tried it. It worked. Thank you. On Fri, Sep 5, 2008 at 9:42 AM, Kent Johnson <[EMAIL PROTECTED]> wrote:
> On Thu, Sep 4, 2008 at 9:00 PM, Roy Khristopher Bayot > <[EMAIL PROTECTED]> wrote: > > > class CamHandle(object): > > def __init__(self): > > import os > > w = os.system('gphoto2 --auto-detect > CamHandleLog.txt') > > test = os.system('gphoto2 --capture-image >> CamHandleLog.txt') > > > > def captureImage(self): > > import os > > x = os.system('gphoto2 --capture-image >> CamHandleLog.txt') > > > > Now when I import the file to the interpreter and instantiate the class, > it > > works. Each function works. I havent done any error handling or exception > > handling yet but it works for now. However, I am bothered with the import > > statements in each function. > > The usual method is to put the import statement at the beginning of > the module. Then the imported module has global (module) scope rather > than function scope. > > Kent >
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor