0
我有这样的功能:呼叫python脚本的功能,然后检查是否状态
def ContentFunc():
storage = StringIO()
c = pycurl.Curl()
c.setopt(c.URL, url)
c.setopt(c.WRITEFUNCTION, storage.write)
c.perform()
c.close()
content = storage.getvalue()
while True:
ContentFunc()
if "word" in content:
out = open('/tmp/test', 'a+')
我想从content = storage.getvalue()
追加content
。但不起作用。
的错误:
NameError: name 'content' is not defined
你能帮助我吗?
'返回content'? – vaultah
是的..并将其附加到测试文件.... – MLSC
如何从ContentFunc中返回一些内容? – vaultah