Async File I/O

Darrell news at dorb.com
Fri Feb 18 21:58:23 EST 2000


Windows is loaded with async/event/callback stuff.
I'm no expert for sure but here's some code that worked well.
It wakes up when a file is modified.
http://www.dorb.com/darrell/win32WorkSvr/makeThumbsDG.py

Look for this snippet.
    hnd=win32file.FindFirstChangeNotification
(......FILE_NOTIFY_CHANGE_LAST_WRITE )

    int = win32event.WaitForSingleObject( hnd, -1)

--
--Darrell
> Randall Hopper  wrote:
>  |Is there a way to perform asynchronous file I/O in Python which is
>  |compatible with Tkinter?
>  |
>  |I believe Tk's fileevent might be it, but I don't see any wrapper in
>  |the Tkinter module.  Anyone have a code snippet they could share?
>
> Never mind.  I found the code bite I needed buried in Dejanews.  The
answer
> for Tkinter (on UNIX) is "createfilehandler".
>
> UNIX is sufficient for my needs.  But what do Tkinter folks do with this
> situation on MSWindows?  Sleep and poll?  Or is there another API that's
> used?
>






More information about the Python-list mailing list