Saturday 2:55 p.m.–3:15 p.m. in Terrace
Supporting Everything - Python2/3, Mac/Linux/Windows
- Audience level:
There comes a time in the life of a library where it must leave your machine and find a home in a far away computer. That computer might even run windows. This talk will show how you can write a library that supports Linux/Mac/Windows and runs on python 2 and 3.
This talk will show you how to write libraries that can run on multiple platforms (Linux/Mac/Windows) as well as multiple python versions (python2/3). We'll look at real world examples that show how existing projects handle these compatibility issues, along with specific tips and design techniques you can use to ensure your library runs on as many platforms as possible.
Why support everything?
- Common 2/3 differences you'll run into
Using a single codebase
- Differing libraries per platform (os, subprocess, mmap, etc.)
- Libraries not available on all platforms
- Detecting your platform
File Handling on Windows
- Classes and factories
- Abstracting at the module level
- CI is your friend (Travis CI/Jenkins)
Real world projects