toot_zen(): zen = "".join( [this.d.get(c, c) for c in this.s] ).split("\n") instance = Mastodon( access_token=os.getenv('ACCESS_TOKEN'), api_base_url='https://botsin.space', ) toot = instance.toot( f'The Zen of Python says:\n\n{random.choice(zen)}', ) if __name__ == '__main__': toot_zen()