This is not exactly what you asked for, but what I do is I write a
make.py script for every PyInstaller project I build. The file make.py
might look something like this:
# File make.py
import subprocess
import os
PYI_PATH = "/Users/zakf/Downloads/pyinstaller-2.0/"
OUT_PATH = "/Users/zakf/progs/pyi_builds/"
PYI_EXE = os.path.join(PYI_PATH, "pyinstaller.py")
MAKESPEC_EXE = os.path.join(PYI_PATH, "utils", "Makespec.py")
if __name__ == '__main__':
base_py_file = "my_app.py"
name_arg = "--name=my_app"
deploy_type = '--onefile'
# deploy_type = '--onedir'
# The .spec file and all build files will go in this directory:
out_dir_path = os.path.join(OUT_PATH, "my_app")
out_dir = "--out=%s" % out_dir_path
windowed = '--windowed'
# windowed = '--nowindowed'
makespec_args = ["python", MAKESPEC_EXE, deploy_type, windowed,
out_dir, name_arg, base_py_file]
subprocess.call(makespec_args)
spec_path = os.path.join(out_dir_path, 'my_app.spec')
pyi_args = ["python", pyi_exe, deploy_type, windowed, out_dir,
name_arg, spec_path]
subprocess.call(pyi_args)
I can customize the behavior by switching which lines are commented out.
Then, each time I want to run a PyInstaller build, I just call "python
make.py" and I don't have to remember any of the options. The options
are all baked into the make.py script. As an added bonus, I don't have
to modify the .spec file by hand. What you requested would require you
to modify the .spec file by hand, but that would be a hassle if you had
to run Makespec.py again, because it would wipe out the options you had
included in the .spec file.
Hope that helps,
Zak F.
--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.