I am trying to create a page in https://dev.wikidebates.org/wiki/Wikidébats:Accueil, it is similar ti wikipedia, so Pywikibot should work the same way. I would like to make a page using Pywikibot. I checked option scripts in Pywikibot https://www.mediawiki.org/wiki/Manual:Pywikibot/Scripts. The script pagefromfile.py is responsible for it. However, I don't see in the code where I should write link on new page of wiki. Also function inter in class Pagefromfile returns page. How can I check that the page was made?
The code which I try now is the following. Everything works ok, except last line.(Page is not created)
site = pywikibot.Site('dev', 'wikidebates') # The site we want to run our bot on
page = pywikibot.Page(site, "Faut-il légaliser le cannabis ?")
text = page.get() #get the code of the page
wb = open("pages1.txt", "w", encoding="utf-8")
wb.write(str(txt)) #write text to the file, in order to download it then to the wiki
wb.close()
main_page('-file:pages1.txt') #use main function from scrip pagefromfile.py - I renamed it