PRAW is the AWESOME Reddit API Wrapper written in Python.
Download PRAW
pip install praw
Import PRAW
import praw
Get a handler to reddit, passing the user agent (important!)
r = praw.Reddit("sidebar updater by /u/helloworld")
Login
r.login("USERNAME","PASSWORD")
Define the subreddit name for use
sub = "subreddit"
Get the settings of the subreddit
settings = r.get_settings(sub)
Inside the settings
object, there is a description
field. This field will have the contents of the sidebar. Do whatever you want with it
sidebar_contents = settings['description']
sidebar_contents += "\n\nUpdated from script, yo!"
Update the settings
r.update_settings(r.get_subreddit(sub), description=sidebar_contents)
Go to the subreddit and marvel!
That's I thought...
reddit.subreddit(target_subreddit).wiki['config/sidebar'].edit(sidebar_content)