2.5で入ったctypesがマイブーム。

import ctypes

def send(path, s):
  dll = ctypes.windll.kernel32
  handle = dll.CreateFileA(
    path,
    0x40000000, # GENERIC_WRITE
    0x00000001, # FILE_SHARE_READ
    None,
    3, # OPEN_EXISTING
    0x00000080, # FILE_ATTRIBUTE_NORMAL
    None)

  if handle == -1:
    raise IOError, "CreateFileA failed: " + path

  try:
    s = s.encode("mbcs")
    while s:
      written = ctypes.c_int()
      if not dll.WriteFile(handle, s, len(s), ctypes.byref(written), None):
        raise IOError, "WriteFile failed: " + path
      s = s[written.value:]
  finally:
    dll.CloseHandle(handle)

Windowsのメールスロットに書き込むのにこういうのがいるんだけど、
Cで拡張ライブラリ書かなくてもできるようになったのはお手軽。