Depends on the script. Unless you use anything os-specific, you are golden.
In the standard library most of the modules are totally os-agnostic, and for the rest the rule of thumb is - "if it is possible to provide the same functionality across *nix and windows, it has probably been done".
Python actually makes it pretty easy to write portable programs. Even file paths manipulation is pretty portable if you do it right - os.path.sep
instead of '/'
, os.path.join
instead of string concatenation etc.
Notable exceptions are
- sockets - windows sockets are bit different
- multiprocessing - windows does not have
fork()
, that may or may not be a problem.
- Needless to say, things related to username, hostname and such.
os
and sys
are a mixed bag - you should read the compatibility notes in the docs.
- Everything packaging and distribution-related.