Here's a class using Fredrik's suggestions to provide generic, cross-platform file locking (only tested on *nix however, with the two test files listed [i.e., run test1.py in one terminal then test2.py in another]):
http://pastie.caboo.se/15851 Ps. The lockfile should also always be cleaned up (even when your program excepts) because of the magic __del__ method, but I don't guarentee it will be (nor depend on it: I used the pid + hostname in the lockfile approach). Regards, Jordan -- http://mail.python.org/mailman/listinfo/python-list