I\'m using Python 2.6.1 on Mac OS X.
I have two simple Python files (below), but when I run
python update_url.py
I get on
Importing the namespace is somewhat cleaner. Imagine you have two different modules you import, both of them with the same method/class. Some bad stuff might happen. I'd dare say it is usually good practice to use:
import module
over
from module import function/class
try
from sqlitedbx import SqliteDBzz
You need to do:
import sqlitedbx
def main():
db = sqlitedbx.SqliteDBzz()
db.connect()
if __name__ == "__main__":
main()
That's How Python works. Try this :
from sqlitedbx import SqliteDBzz
Such that you can directly use the name without the enclosing module.Or just import the module and prepend 'sqlitedbx.' to your function,class etc