gerpopular.blogg.se

Pyinstaller linux
Pyinstaller linux












Python pyinstaller.py -windowed your_main_file.py Mac OS X: (You want an App bundle with windowed output, hence -windowed).Python pyinstaller.py -onefile your_main_file.py Windows: (You want a single EXE file with your data in it, hence -onefile).Instead, use something like font = Font(resource_path(os.path.join('data', 'freesansbold.ttf')), 14). In other words, don’t use font = Font(None, 26).

pyinstaller linux

  • Specify exactly where your fonts are (and include them in the data directory).
  • This is mostly for convenience – it allows you to access your resources while developing, but then it’ll add the right prefix when it’s in the deployment environment. Myfontfile = resource_path(os.path.join(data_dir, filename) Return os.path.join(sys._MEIPASS, relative)Īn example of usage would be filename = 'freesansbold.ttf'
  • Modify your code so that whenever you refer to your data directory, you wrap it using the following function:.
  • To install the Command Line tools, first install XCode from the App Store, then go to Preferences – Downloads and there is an option to download them there.
  • On Mac OS X, you will need XCode’s command line tools.
  • pyinstaller linux

  • On Windows, you might also need pywin32 (and possibly MinGW if you don’t have Visual Studio).
  • Here’s how you use PyInstaller and PyGame to create a single-file executable from a project that has a data directory that contains resources like images, fonts, and music.

    pyinstaller linux

    How to Create a Single Windows Executable from a Python and PyGame Project (Summary)














    Pyinstaller linux