Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python sys.argv接受HTML输入_Python_Python 2.7 - Fatal编程技术网

Python sys.argv接受HTML输入

Python sys.argv接受HTML输入,python,python-2.7,Python,Python 2.7,因此,目前我正在使用applescript将原始消息从邮件传递到python。 我调用shell来使用applescript执行python,但是sys.argv在接受输入时似乎有问题,我认为这是因为原始消息很复杂,因为它是HTML格式的。任何想法或建议我可以使用sys.arv或任何其他替代方案来接受html数据吗?它必须是sys.argv 您可以更改python脚本,使其改为读取html文件 如果没有,还可以在参数上添加引号以转义html标记 例如: $python3 test.py“foo”

因此,目前我正在使用applescript将原始消息从邮件传递到python。
我调用shell来使用applescript执行python,但是sys.argv在接受输入时似乎有问题,我认为这是因为原始消息很复杂,因为它是HTML格式的。任何想法或建议我可以使用sys.arv或任何其他替代方案来接受html数据吗?

它必须是
sys.argv

您可以更改python脚本,使其改为读取html文件

如果没有,还可以在参数上添加引号以转义html标记

例如:

$python3 test.py“foo

” ['test.py','foo

'
其中,test.py的内容为:

导入系统 如果名称=“\uuuuu main\uuuuuuuu”: 打印(sys.argv)