如何将 运行 一个 python 脚本作为从命令提示符获取不同参数的后台进程?

How to run a python script as a background process that takes different parameters from the command prompt?

我想 运行 一个 python 程序 运行 在后台运行。它以文件夹目录和大小作为参数,并压缩文件夹中大于提供大小的文件。如果给定参数

,它还会显示 helpInfo() 方法中程序的描述

-h

I have written the program normally here

现在如何 运行 这个程序作为后台进程使用 pathsize 信息作为参数给出,如果给定参数 -h[= 将显示帮助信息18=]

来自 documentation of argparse

import argparse
parser = argparse.ArgumentParser()
parser.add_argument("echo")
args = parser.parse_args()

然后使用python3 prog.py --help