import pywikibot
site = pywikibot.Site('test', 'wikipedia')
site
APISite("test", "wikipedia")
page = Pywikibot.Page(site, 'test')
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-6-d329f7c118e2> in <module>()
----> 1 page = Pywikibot.Page(site, 'test')

NameError: name 'Pywikibot' is not defined
page = pywikibot.Page(site, 'test')
page.exists()
True
page.text
'Hello world!'
page.text = 'Hello world'
page.save()
Page [[Test]] saved