I would normally use import X on module level. If you only need a single object from a module, use from X import Y.
Only use import X as Y in case you're otherwise confronted with a name clash or something.
Try something like this:
def main():
import sys
if len(sys.argv) > 1:
pass