How does Dropbox use Python on Windows and OS X? How does Dropbox use Python on Windows and OS X? windows windows

How does Dropbox use Python on Windows and OS X?


Dropbox uses a combination of wxPython and PyObjC on the Mac (less wxPython in the 0.8 series). It looks like they've built a bit of a UI abstraction layer but nothing overwhelming—i.e., they're doing their cross-platform app the right way.

They include their own Python mainly because the versions of Python included on the Mac vary by OS version (and Dropbox supports back to 10.4 IIRC); also, they've customized the Python interpreter a bit to improve threading and I/O behavior.

(I do not work for Dropbox or have any inside knowledge; all I did was read their forums and examine the filenames in site-packages.zip in the Dropbox app bundle.)


For WINDOWS, Dropbox have employed a module similar to py2exe to package all their .py scripts, required libraries, resources etc into the distribution that you have mentioned above (.exe, library.zip, MS C runtime library and python25.dll) so that they can be run without requiring Python installation. Here's a sample code of how you can achieve this with py2exe.

from distutils.core import setupimport py2exeoptions = {'py2exe': {           'compressed':1,             'bundle_files': 2,           'dll_excludes': ['w9xpopen.exe']           }}setup(console=['myapp.py'],options=options)

Please see the tutorial here for more explanation.

PS: the number of files in the distribution can be controlled using the options parameter as shown in the above example.