On Thu, 13 Apr 2006 23:21:26 +0200, "Aleksandar Cikota" <[EMAIL PROTECTED]> wrote:
>I'm beginner in Python and need help. I'm writing software for a robotic >telescope. For CCD camera control we use MaxIm DL (Diffraction Limited). I >have a problem with CCDCamera.SaveImage. > >Here is the code (Python): > >import win32com.client, time >CCDCamera = win32com.client.Dispatch('MaxIm.CCDCamera') >CCDCamera.LinkEnabled = True >if CCDCamera.LinkEnabled == False: > print 'Failed to start camera.' >exp = int(raw_input('Exposition[sec]: ')) >CCDCamera.Expose(exp, 1, 0) >while CCDCamera.ImageReady == False: > time.sleep >print 'Done' >time.sleep(3) >CCDCamera.SaveImage('C:/1.fit') > > >Error message: > > >>> File "S:MaxImmaxim.py", line 19, in ? >>> CCDCamera.SaveImage('C:/1.fit') >>> File "C:ProgrammePython24Libsite- >>> packageswin32comclientdynamic.py", line 491, in __getattr__ >>> raise pythoncom.com_error, details >>> com_error: (-2147352567, 'Ausnahmefehler aufgetreten.', >>> (65535, 'MaxIm DL 4', 'Invalid Input', None, 0, 0), None) >> >> Putting on my "wild guess" hat, have you tried backslashes in the file name instead of forward? CCDCamera.SaveImage('C:\\1.fit') or CCDCamera.SaveImage(r'C:\1.fit') It's possible that their file name validation is a bit too strict. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. _______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32