import pywikibot

site = pywikibot.Site('en', 'wikiversity')
page = pywikibot.Page(site, "Wikiversity:Sandbox")

title = page.title()
text = page.text

text += "\n\nHello from Pywikibot!"

try:
    if page.text != text:
        print(title)
        page.text = text
        page.save(summary='Testing Pywikibot', minor=True, botflag=True)
except Exception as exception:
    print(exception)
Wikiversity:Sandbox
Sleeping for 8.9 seconds, 2018-06-06 19:33:49
Page [[wikiversity:en:Wikiversity:Sandbox]] saved