Quote Originally Posted by The Unintelligible View Post
Just import the module in a directory the script can access it from?

Just look at examples of usage. But importing a module is pretty much one of the most trivial aspects of Python. Import, initialize (if required), use. Rinse, repeat.
So do I just put it in the same directory or something?

Here's my code, btw:

Code:
# Importing all the modules
from pprint import pprint
import requests
import json

# Set username and password
username = 'USERNAMEHERE'
password = 'PASSWORDHERE'

# Create dict with username and password
user_pass_dict = {'user': username,
                  'passwd': password,
				  'api_type': 'json'}
				  
# Set the header for all the following requests
headers = {'user-agent': 'SuperFakeHeaders v1.0', }

# Create a requests.session that will handle our cookies for us
client = requests.session()
client.headers=headers

# Make a login request, passing in the user and password as data
r = client.post(r'http://www.reddit.com/api/login', data=user_pass_dict)

# Print to confirm error-free response
pprint(r.content)

# Turns the response's JSON to a native python dict
j = json.loads(r.content)

# Grabs the modhash from the response
client.modhash = j['json']['data']['modhash']

# Prints the user's modhash
print '{USER}\'s modhash is: {mh}'.format(USER=username, mh=client.modhash)