![](https://secure.gravatar.com/avatar/01aa7d6d4db83982a2f6dd363d0ee0f3.jpg?s=120&d=mm&r=g)
On Feb 24, 2015, at 08:20 PM, Paul Moore wrote:
(side note: --python/-p or --interpreter/-i?) and set the entry point,
Both virtualenv and (I think) pex use --python/-p so that seems to be the overwhelming trend <wink>.
To modify an archive could be done using
python -m zipapp old.pyz new.pyz [-p interpreter]
Default is to strip the shebang (no -p option). There's no option to omit the target and do an inplace update because I feel the default action (strip the shebang from the existing file with no backup) is too dangerous.
You have to be careful about the case where old.pyz == new.pyz (e.g. either handling this case safely or complaining loudly) , but also you could handle it by using a .tmp file and renaming. E.g. old.pyz -> old.pyz.bak and old.pyz.tmp -> old.pyz.
3. What to call the "show the shebang line" option
I don't know how useful this is, given that (on *nix at least) you can effectively do the same with head(1). Cheers, -Barry