I have been trying to package a python program I have developed with pyinstaller but the main problem is that my program needs to read some data from a directory and I don't know how to adapt the .spec file to read it. In this question is explained how to do it, but for me it doesn't work. The fact is that inside of the folder there are different notepad documents and my program needs to read data from them. I have tried to put the relative path to the folder to add all the documents but it doesn't work. Nowadays my .spec file is:
# -*- mode: python -*-
block_cipher = None
a = Analysis(['run.py'],
pathex=['C:\\Users\\Desktop'],
binaries=[],
datas=[ ('instances\\datA1', '.') ], #datA1 is the name of the document I want to integrate, either in the root of the program in one folder
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name='run',
debug=False,
strip=False,
upx=True,
runtime_tmpdir=None,
console=True )
How I can integrate all the elements of the folder (not py documents, txt for example) inside the package and later read information from them?