We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 43bc11c commit 0663d19Copy full SHA for 0663d19
binary_search/binary_search.py
@@ -1,17 +1,14 @@
1
#!/usr/bin/env python
2
# -*- coding: utf-8 -*-
3
# Created by imoyao at 2019/5/13 18:33
4
-import os
+
5
+import pathlib
6
import sys
7
-try:
8
- from ..util import utils
9
-except ValueError:
10
- currpath = os.path.join(os.getcwd(), os.path.dirname(__file__))
11
- relative_fp = os.path.dirname(currpath)
12
- print(relative_fp)
13
- sys.path.append(relative_fp)
14
- from util import utils
+util_p = pathlib.Path('..').resolve()
+sys.path.append(str(util_p))
+from util import utils
15
16
17
@utils.show_time
0 commit comments