1
私は変数を置き換えようとしているif文を持っています。 変数を置き換えた後、どのようにすればdef parse_againを呼び出すのですか 以下は自分のコードです。Pythonでの応答を読み込んでdefを呼び出す方法
match4があまりにも
REP1変数はグローバル変数
if results == "":
url = 'myapiIP'
postdata = {regex:match4}
req = urllib2.Request(url)
req.add_header('Content-Type','application/json')
data = json.dumps(postdata)
response = urllib2.urlopen(req,data)
rep1 = response.content <<<trying out (read the response not working)
parse_again() <<<<trying out (trying to call my def parse)
私のデフ解析で文字列とREP1です:
APIは私がどのように右の応答を与えると仮定するとdef parse_again(self, response):
.........
それを読んで、変数rep1をそれに置き換えます。そして、私はparse_againを実行するためにdef構文解析を実行します(私のdef解析はうまく動作します)
私はフレージングの質問で悪いだとしてuは理解していないどの部分を教えてください