Compile
pyinstaller --onefile --add-data "file1.txt;." --add-data "file2.txt;." script.py
If reading a file:
instead of:
with open('foo/bar', 'r') as f:
...
use:
path = 'foo/bar'
if getattr(sys, 'frozen', False):
path = os.path.join(sys._MEIPASS, path)
with open(path, 'r') as f:
...