Ga naar inhoud
Sat4all gemigreerd! LEES HIER VERDER! ×

Aanbevolen berichten

Geplaatst:

op een windows xp pc wil ik dit script laten draaien zodat ik vanaf een linux pc kan printen op een printer zonder print driver er zit alleen een syntax error in die ik er niet uit krijg zouden julie mij willen helpen het gaat om line 56

 

(code)

path_to_watch,

 

FILE_LIST_DIRECTORY,

 

win32con.FILE_SHARE_READ | win32con.FILE_SHARE_WRITE,

 

None,

 

win32con.OPEN_EXISTING,

 

win32con.FILE_FLAG_BACKUP_SEMANTICS,

 

None

 

)

 

while 1:

 

#

 

# ReadDirectoryChangesW takes a previously-created

 

# handle to a directory, a buffer size for results,

 

# a flag to indicate whether to watch subtrees and

 

# a filter of what changes to notify.

 

#

 

# NB Tim Juchcinski reports that he needed to up

 

# the buffer size to be sure of picking up all

 

# events when a large number of files were

 

# deleted at once.

 

#

 

results = win32file.ReadDirectoryChangesW (

 

hDir,

 

1024,

 

True,

 

win32con.FILE_NOTIFY_CHANGE_FILE_NAME |

 

win32con.FILE_NOTIFY_CHANGE_DIR_NAME |

 

win32con.FILE_NOTIFY_CHANGE_ATTRIBUTES |

 

win32con.FILE_NOTIFY_CHANGE_SIZE |

 

win32con.FILE_NOTIFY_CHANGE_LAST_WRITE |

 

win32con.FILE_NOTIFY_CHANGE_SECURITY,

 

None,

 

None

 

)

 

for action, file in results:

 

full_filename = os.path.join (path_to_watch, file)

 

#print full_filename, ACTIONS.get (action, "Unknown")

 

if (action == 5):

 

print full_filename

 

cmd = '''"C:\\Program Files\\Ghostgum\\gsview\\gsprint.exe" -color ''' + full_filename

 

#cmd = '''gdputil.exe -runkill 30 "C:\\Program Files\\Adobe\\Acrobat 6.0\\Reader\\AcroRd32.exe" /p /h ''' + full_filename

 

prog = win32pipe.popen(cmd)

 

print prog.readlines()

 

print cmd

 

prog.close()

 

time.sleep(30)

 

os.remove(full_filename)

(/code>)

 

  • Wie is er online   0 leden

    • Er zijn geen geregistreerde gebruikers deze pagina aan het bekijken
×
×
  • Nieuwe aanmaken...