cgi脚本未能调用另一个python脚本

2024-05-13 09:28:03 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个cgi脚本,它正在调用另一个python脚本,但在通过浏览器运行时,第二个脚本不起作用。你知道吗

subprocess.Popen([python, 'symantec.py', '-k', "test3.example.com.com.key", '-c', 
                  "test3.example.com.com.csr", '-n', "test3.example.com.com", 
                  '-o', "'IT'", '-p', "war.eagle", '-t', "Server", '-s', "F5", 
                  '-y', "1", '-f', "test3.example.com.com.crt", '-g', "johny", '-l', 
                  "mon", '-e', "johny.mon@example.com.com", '-b', "test3.example.com.com"], 
                  shell=True)

有人能帮我确认身份吗?你知道吗

第二个脚本的路径赛门铁克.py
https://github.com/ericjmcalvin/verisign_purchase_ssl_certificate


Tags: keypy脚本comexample浏览器itsubprocess
1条回答
网友
1楼 · 发布于 2024-05-13 09:28:03

您应该首先测试命令。你知道吗

python symantec.py -k test3.example.com.com.key -c test3.example.com.com.csr -n test3.example.com.com -o 'IT' -p war.eagle -t Server -s F5 -y 1 -f test3.example.com.com.crt -g johny -l mon -e johny.mon@example.com.com -b test3.example.com.com`

脚本要求绝对路径作为-k-c参数的参数。帮助指定:

-h, help show this help message and exit

-k KEY_FILE, key-file=KEY_FILE Full location to save key file. REQUIRED.

一旦你确定它是工作的,从你的脚本调用它:

command = "python symantec.py -k test3.example.com.com.key -c test3.example.com.com.csr -n test3.example.com.com -o 'IT' -p war.eagle -t Server -s F5 -y 1 -f test3.example.com.com.crt -g johny -l mon -e johny.mon@example.com.com -b test3.example.com.com"
subprocess.Popen(command.split(), shell=False)

另一种方法是导入Symantec脚本并调用其主函数,自然地提供预期的参数。你知道吗

相关问题 更多 >