1234567891011121314151617181920 |
- #!/usr/bin/env python
- # -*- encoding: utf-8 -*-
- from os import path
- import sys
- from sys import path as spath
- def resource_path(relative_path):
- try:
- base_path = sys._MEIPASS
- except Exception:
- base_path = path.abspath(".")
- return path.join(base_path, relative_path)
- def resource_path_extend(relative_path):
- spath.append(path.abspath(relative_path))
- print(sys.path)
|