Hi all,
Does a async sleep exist?
How to check this every 10 sec, but that the CPU is free?
Code:
import win32com.client
import time
import os
Document = win32com.client .Dispatch('MaxI m.Document')
Application = win32com.client .dynamic.Dispat ch('MaxIm.Appli cation')
path_to_watch = "F:/Images/VRT/"
before = dict ([(f, None) for f in os.listdir (path_to_watch)])
##check this every 10 sec
after = dict ([(f, None) for f in os.listdir (path_to_watch)])
added = [f for f in after if not f in before]
if added:
name= ' ,'.join (added)
print name
if str(name[-3:])=='fit':
Document.OpenFi le('F:/Images/VRT/'+name)
Document.SaveFi le('F:/Images/VRT/'+ str(name[0:-4])+'.jpeg',
6, False)
Application.Clo seAll()
before = after
Tkank You!
Regards,
Aleksandar
Does a async sleep exist?
How to check this every 10 sec, but that the CPU is free?
Code:
import win32com.client
import time
import os
Document = win32com.client .Dispatch('MaxI m.Document')
Application = win32com.client .dynamic.Dispat ch('MaxIm.Appli cation')
path_to_watch = "F:/Images/VRT/"
before = dict ([(f, None) for f in os.listdir (path_to_watch)])
##check this every 10 sec
after = dict ([(f, None) for f in os.listdir (path_to_watch)])
added = [f for f in after if not f in before]
if added:
name= ' ,'.join (added)
print name
if str(name[-3:])=='fit':
Document.OpenFi le('F:/Images/VRT/'+name)
Document.SaveFi le('F:/Images/VRT/'+ str(name[0:-4])+'.jpeg',
6, False)
Application.Clo seAll()
before = after
Tkank You!
Regards,
Aleksandar
Comment