nixbang:在 nix-shell 中运行脚本的特殊 shebang

时间:2021-06-10 23:53:32
【文件属性】:
文件名称:nixbang:在 nix-shell 中运行脚本的特殊 shebang
文件大小:2KB
文件格式:ZIP
更新时间:2021-06-10 23:53:32
Python 尼克邦 Nixbang 允许您在脚本本身内指定脚本的依赖项。 然后它将使用 nix-shell 运行带有依赖项的脚本。 这有两个优点: 依赖项不会使系统混乱(感谢 nix 的魔力); 该脚本可以在任何系统上执行,而无需设置 nixbang(和 nix)以外的任何内容。 例子 执行以下脚本 #!/usr/bin/env nixbang # command = python3 # packages = python34 python34Packages.requests tree import requests print(requests) import subprocess subprocess.call(['tree']) 使其可执行并运行它获取包行上指定的所有依赖项,并在具有所有这些依赖项的环境中运行脚本,并使用 command 中指定的命令。 请注意,依赖项可以是任何 nixp
【文件预览】:
nixbang-master
----setup.py(653B)
----README.rst(2KB)
----nixbang(1KB)

网友评论