mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-01 20:12:07 +08:00
Improve Python code for importing modules.
This commit is contained in:
@ -4,10 +4,11 @@ Created Time: 2023-06-15
|
||||
Author: Krahets (krahets@163.com)
|
||||
"""
|
||||
|
||||
import sys, os.path as osp
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
sys.path.append(osp.dirname(osp.dirname(osp.abspath(__file__))))
|
||||
from modules import *
|
||||
sys.path.append(str(Path(__file__).parent.parent))
|
||||
from modules import ListNode
|
||||
|
||||
"""Driver Code"""
|
||||
if __name__ == "__main__":
|
||||
|
||||
@ -4,10 +4,11 @@ Created Time: 2022-12-14
|
||||
Author: msk397 (machangxinq@gmail.com)
|
||||
"""
|
||||
|
||||
import sys, os.path as osp
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
sys.path.append(osp.dirname(osp.dirname(osp.abspath(__file__))))
|
||||
from modules import *
|
||||
sys.path.append(str(Path(__file__).parent.parent))
|
||||
from modules import print_dict
|
||||
|
||||
"""Driver Code"""
|
||||
if __name__ == "__main__":
|
||||
|
||||
@ -4,9 +4,10 @@ Created Time: 2023-06-13
|
||||
Author: Krahets (krahets@163.com)
|
||||
"""
|
||||
|
||||
import sys, os.path as osp
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
sys.path.append(osp.dirname(osp.dirname(osp.abspath(__file__))))
|
||||
sys.path.append(str(Path(__file__).parent.parent))
|
||||
from chapter_hashing.array_hash_map import Pair
|
||||
|
||||
|
||||
|
||||
@ -4,9 +4,10 @@ Created Time: 2023-06-13
|
||||
Author: Krahets (krahets@163.com)
|
||||
"""
|
||||
|
||||
import sys, os.path as osp
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
sys.path.append(osp.dirname(osp.dirname(osp.abspath(__file__))))
|
||||
sys.path.append(str(Path(__file__).parent.parent))
|
||||
from chapter_hashing.array_hash_map import Pair
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user