Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
Threading problem
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Aleksandar Cikota, post: 1875388"] Thank You, but now it cannot open a file, but it should work... Here the error message:Traceback (most recent call last): File "C:\Program Files\Python\lib\threading.py", line 442, in __bootstrap self.run() File "G:\Robot teleskop\VRT\test\test2.py", line 25, in run Document.OpenFile('F:/Images/VRT/'+name) File "C:\Program Files\Python\Lib\site-packages\win32com\client\dynamic.py", line 496, in __getattr__ raise AttributeError, "%s.%s" % (self._username_, attr) AttributeError: MaxIm.Document.OpenFile And here the Code: import win32com.client import time import os import threading Document = win32com.client.Dispatch('MaxIm.Document') Application = win32com.client.Dispatch('MaxIm.Application') p = win32com.client.dynamic.Dispatch('PinPoint.Plate') class TestThread (threading.Thread): def run (self): path_to_watch = "F:/Images/VRT/" before = dict ([(f, None) for f in os.listdir (path_to_watch)]) while 1: time.sleep(2) after2 = dict ([(f, None) for f in os.listdir (path_to_watch)]) added = [f for f in after2 if not f in before] if added: name= ' ,'.join (added) if str(name[-3:])=='fit': Document.OpenFile('F:/Images/VRT/'+name) Document.SaveFile('F:/Images/VRT/'+ str(name[0:-4])+'.jpg', 6, 1024,2) Application.CloseAll() try: p.AttachFITS('F:/Images/VRT/'+name) p.ArcsecPerPixelHoriz = -1.7 p.ArcsecPerPixelVert = -1.7 p.MaxMatchResidual = 1.0 p.FitOrder = 3 p.CentroidAlgorithm = 0 p.RightAscension = p.TargetRightAscension p.Declination = p.TargetDeclination p.Catalog = 0 # GSC p.CatalogPath = 'F:/' p.ProjectionType = 1 # p.Solve() p.DetachFITS() pRA = p.RightAscension pDec = p.Declination print pRA print pDec except: p.DetachFITS() print 'Error' before = after2 TestThread().start() "raise AttributeError, "%s.%s" % (self._username_, attr)", what does it mean? For your prompt reply, I say thank you in advance. Best regards, Aleksandar [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
Threading problem
Top