python urllib2练习发送简单post
import urllib2
import urllib
url = 'http://localhost/1.php'
while True:
data = raw_input('(ctrl+c exit)cmd>').strip()
post = {}
post['cmd'] = data
content = urllib2.urlopen(url=url,data=urllib.urlencode(post))
print content.read()
浙公网安备 33010602011771号