Mwclient: Upload a file

From Glitchdata
Jump to navigation Jump to search
print('Uploading image')
site.upload(open('test-image.png', 'rb'), prefix + '-test-image.png', 'desc', ignore=True)
print('Uploading image for the second time')
site.upload(open('test-image.png', 'rb'), prefix + '-test-image.png', 'desc', ignore=True)
image = site.Images[prefix + '-test-image.png']
print('Imageinfo:', image.imageinfo)
history = list(image.imagehistory())
print('History:', history)



Links