import pywikibot

site = pywikibot.Site('test', 'wikipedia')
page = pywikibot.Page(site, 'test')

page.text = 'Hello world!'
page.save()
Sleeping for 9.4 seconds, 2017-08-04 17:46:36
Page [[test:Test]] saved