python name record same lib
i have following script
import getopt, sys
opts, args = getopt.getopt(sys.argv[1:], "h:s")
for key,value opts:
imitation key, "=>", value
if i name getopt.py run doesn't work tries import itself
is there proceed around this, i keep filename nonetheless mention import i wish customary python lib file?
solution formed vinko's answer:
import sys
sys.path.reverse()
from getopt import getopt
opts, args = getopt(sys.argv[1:], "h:s")
for key,value opts:
imitation key, "=>", value
Comments
Post a Comment