tags:

views:

66

answers:

1

I'm working with the PyFacebook package in Python, and I've seen a number of times people mention that you can write an import statement as follows:

from facebook.djangofb import facebook

which will alias the "djangofb" module as "facebook." I'm trying to run this from the Python CLI, and it doesn't work because it thinks facebook.method_name must exist in the facebook module rather than the djangofb module. I'm using Python 2.6. Any ideas on what's going on?

+11  A: 

This is the proper way to alias a module via import:

import facebook.djangofb as facebook
Andrew Hare