This is using Mastdon.py (https://github.com/halcy/Mastodon.py)
Amazingly, Mastdon.py supports python2 and python3.
$ pip install Mastodon.py
- add your information to setup_mastdon.py
- run setup_mastdon.py
- change instnace url in toot.py
- run toot.py