Reputation: 12619
I am about to start a personal project using python and I will be using it on both Linux(Fedora) and Windows(Vista), Although I might as well make it work on a mac while im at it. I have found an API for the GUI that will work on all 3. The reason I am asking is because I have always heard of small differences that are easily avoided if you know about them before starting. Does anyone have any tips or suggestions that fall along these lines?
Upvotes: 4
Views: 1873
Reputation: 1469
Some filename problems: This.File and this.file are different files on Linux, but point to the same file on Windows. Troublesome if you manage some file repository and access it from both platforms. Less frequent related problem is that of names like NUL or LPT being files on Windows.
Binary distribution code (if any) would likely use py2exe on Win, py2app on Mac and wouldn't be present on Linux.
Upvotes: 0
Reputation: 91615
Some things I've noticed in my cross platform development in Python:
Upvotes: 3
Reputation: 2798
You should take care of the Python version you are developing against. Especially, on a Mac, the default version of Python installed with the OS, is rather old (of course, newer versions can be installed)
Don't use the OS specific libraries
Take special care of 'special' UI elements, like taskbar icons (windows), ...
Use forward slashes when using paths, avoid C:/, /home/..., ... Use os.path to work with paths.
Upvotes: 1
Reputation: 64444
In general:
More specific stuff:
Upvotes: 4