import sys, os _root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # nmea_client/ _gui = os.path.dirname(os.path.abspath(__file__)) # nmea_client/gui/ for _p in [_root, _gui]: if _p not in sys.path: sys.path.insert(0, _p)