【发布时间】:2013-01-04 10:48:28
【问题描述】:
我知道我可以使用以下命令从我的 bash 脚本运行 python 脚本:
python python_script.py
但是,如果我想从我的 bash 脚本向我的 python 脚本传递一个变量/参数呢?我该怎么做?
基本上 bash 会计算出一个文件名,然后 python 会上传它,但是我需要在调用它时将文件名从 bash 发送到 python。
【问题讨论】:
-
当您在 Debian 的默认 shell 中执行
python python_script.py时,您已经在使用 bash...所以只需在您的 bash 脚本中执行:python python_script.py arg1 arg2 ... -
@Jimmy Unprepared Question I think,很简单链接:tutorialspoint.com/python/python_command_line_arguments.htm
标签: python linux bash shell debian