import xmlrpc.client
server = xmlrpc.client.ServerProxy(
    'http://athomas:password@localhost:8080/trunk/login/xmlrpc')
server.wiki.putAttachment('WikiStart/t.py', xmlrpc.client.Binary(open('t.py').
    read()))
How to base64 encode a PDF file in Python