Hi,

I have used urllib and urllib2 to post data like the following:

dict = {}
dict['data'] = info
dict['system'] = aname

data = urllib.urlencode(dict)
req = urllib2.Request(url)

And to get the data, I emulated a web page with a submit button:   
    s = "<html><body>"
    s += "<form  action='a_method' method='POST'>"
    s += "<textarea cols='80' rows='200' name='data'></textarea>"
    s += "<input type='text' name='system'>"
    s += "<input type='submit' value='Submit'>"
    s += "</form></body></html>"


I would like to know how to send a file. It's a text file that will be 
gzipped before being posted. I'm using python version 2.2.3.


Thanks,
Patricia


_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to