Hi,
I apologize if you are receiving this message in duplicate as I wrote to the
irc as well.
I think maybe I'm reading the documentation wrong, but it seems to me that to
change from a one_directory to one file only requires that you put the data
files in the exe object instead of the collection object.
I'm using this nice little recipe found here. for including a simple text file
that shows up in a Tkinter frame.
Just in case, the code looks like this:
readme_text = Tkinter.Text(readme_frame)
self._directory_name = os.path.dirname(os.path.abspath(sys.argv[0]))
for line in open(self._directory_name + '/README_gui.txt').readlines():
readme_text.insert(END, line)
readme_text.see(END)
Now in my spec file, I can open up the .exe just fine if its bundled in a one
directory.
…code from recipe
docfiles = Datafiles(r'README_gui.txt',strip_path=True)
a = Analysis(['PyIg_gui.py'],
pathex=['C:\\Users\\public\\pyigblast\\src'],
hiddenimports=[],
hookspath=None,
runtime_hooks=None)
pyz = PYZ(a.pure)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='test.exe',
debug=False,
strip=None,
upx=True,
console=False , icon='splashes\\full_antibody.ico')
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
docfiles,
strip=None,
upx=True,
name='test’)
However, if I add docfiles to the exe, it doesn’t seem to work.
..code from recipe
docfiles = Datafiles(r'README_gui.txt',strip_path=True)
a = Analysis(['PyIg_gui.py'],
pathex=['C:\\Users\\crowelab\\pyigblast\\src'],
hiddenimports=[],n
hookspath=None,
runtime_hooks=None)
pyz = PYZ(a.pure)
exe = EXE(pyz,
a.scripts,
a.binaries + docfiles,
a.zipfiles,
a.datas,
name='test_exec.exe',
debug=False,
strip=None,
upx=True,
console=False , icon='splashes\\full_antibody.ico’)
Did I overly simplify the complex way to get a datafile into a one file
executable? On mac its nice because clicking on the name.app links to
name.app/contents/MacOS/name binary. Then if readme is also in the contents
folder under the app, it will just always execute.
I wish there was something comparable in windows where the .exe file would just
“link” to a directory structure within it.
Thank you very much,
Jordan
--
You received this message because you are subscribed to the Google Groups
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/groups/opt_out.