Hi; I'm trying to fill in a Zope form automatically. I have this script, which works great for creating the page...but how do I write to it?
import urllib2 theurl = 'example.com' protocol = 'http://' my_id = "test" text = "Hello, world!" realm_dir = '/a_dir/' realm1 = 'manage_addProduct/PageTemplates/manage_addPageTemplate?id=' + my_id realm2 = my_id realm3 = my_id + '?content_type=text/html&title=testing' username = 'name' password = 'pass' passman = urllib2.HTTPPasswordMgrWithDefaultRealm() passman.add_password(None, theurl, username, password) authhandler = urllib2.HTTPBasicAuthHandler(passman) opener = urllib2.build_opener(authhandler) urllib2.install_opener(opener) pagehandle = urllib2.urlopen(protocol + theurl + realm_dir + realm1) pagehandle.close() pagehandle = urllib2.urlopen(protocol + theurl + realm_dir + realm2) # data = pagehandle.write() pagehandle.close() TIA, Victor
-- http://mail.python.org/mailman/listinfo/python-list