Skip to content

Instantly share code, notes, and snippets.

@debuti
Created September 18, 2020 15:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save debuti/2cde7f4b40751fa6cee8b45ea0a31342 to your computer and use it in GitHub Desktop.
Save debuti/2cde7f4b40751fa6cee8b45ea0a31342 to your computer and use it in GitHub Desktop.
Arguments printout
#!/usr/bin/env python
import os
import sys
import datetime
fname="{}.{}.cli".format(os.path.basename(sys.argv[0]), datetime.datetime.today().strftime('%Y-%m-%d_%H-%M-%S'))
path=os.path.join(os.path.expanduser("~"), "Desktop", fname)
with open(path, "w") as f:
f.write(" ".join(sys.argv))
print("Wrote \"{}\" with \"{}\"".format(path," ".join(sys.argv)))
# python setup.py build
from cx_Freeze import setup, Executable
base = None
executables = [Executable("print-args.py", base=base)]
packages = ["idna", "os", "sys", "datetime"]
options = {
'build_exe': {
'packages':packages,
},
}
setup(
name = "<any name>",
options = options,
version = "0.0.0",
description = '<any description>',
executables = executables
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment