関数がコードを読み取る方法を変更して、より簡単に管理された変数を使用してクラスをインポートできるようにしたいと考えています。
編集したいライブラリはすべてインポート済みです。
class http_request(object):
def __init__(self, website_address, valuedictionary):
self.website_address = website_address
self.valuedictionary = valuedictionary
def get(self):
return requests.get(website_address, params=valuedictionary)
def post(self):
return requests.post(website_address, data=valuedictionary)
def postContext(self):
return requests.post(website_address, data=valuedictionary).context
def getContext(self):
return requests.get(website_address, params=valuedictionary).context
htay = http_request(web_add, payload)
print str(htay.postContext)
私はこれを私の応答として取得しています:「バインドされたメソッド http_request.get of < main .http_request object at 0x8735cec>>」
何か案は?