我的服务器上有 2 个 Python 脚本。我想运行第二个,SendMail.py, from MainScript.py,我需要向它传递 2 个参数。
我想调用send_mail函数MainScript.py:
def send_mail(subject, body):
# call SendMail.py with and pass the subject & body arguments
所以它会运行SendMail.py。
如何在传递参数时运行其他脚本?是否可以不从SendMail.pyinto导入主要功能MainScript.py?我如何抓住论点SendMail.py?