First of all, try to use the official Python Facebook Client.
The API for publishing to a group is here.
The rough code will look like:
graph = facebook.GraphAPI(oauth_access_token)
groups = graph.get_object("me/groups")
group_id = groups['data'][0]['id'] # we take the ID of the first group
graph.put_object(group_id, "feed", message="from terminal")