A
Aleksandar Cikota
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('MaxIm.Document')
Application = win32com.client.dynamic.Dispatch('MaxIm.Application')
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.OpenFile('F:/Images/VRT/'+name)
Document.SaveFile('F:/Images/VRT/'+ str(name[0:-4])+'.jpeg',
6, False)
Application.CloseAll()
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('MaxIm.Document')
Application = win32com.client.dynamic.Dispatch('MaxIm.Application')
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.OpenFile('F:/Images/VRT/'+name)
Document.SaveFile('F:/Images/VRT/'+ str(name[0:-4])+'.jpeg',
6, False)
Application.CloseAll()
before = after
Tkank You!
Regards,
Aleksandar