May 2019
Intermediate to advanced
542 pages
13h 37m
English
Our program runs, but we're back to the old problem of the 'X' and 'O' images not showing up. There are two problems here: first, our PNG files aren't being made part of the distribution and, second, the program can't find them even when they are.
To deal with the first problem, we have to tell PyInstaller to include our files in the datas table during the Analysis phase of the build. We can do that in the command line, like so:
# On Linux and macOS:$ pyinstaller --name qtictactoe --add-data qtictactoe/images:images run.py# On Windows:$ pyinstaller --name qtictactoe --add-data qtictactoe\images;images run.py
The --add-data argument takes a source path and a destination path separated by either a colon (on macOS ...
Read now
Unlock full access