Folder structure:
__init__.py
is a blank file.
├── RandInit_HMM_Py
│ ├── __init__.py
│ ├── demoRunPkg.py
│ ├── demoRunIn.py
|.. ├── helper.py
├── demoRun.py
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import os | |
from RandInit_HMM_Py.demoRunPkg import * |
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
try: | |
from .helper import * | |
except SystemError as e: | |
from helper import * | |
print_logger("Manage to import file inside") |
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
from .helper import * | |
print_logger("manage to import module in sub-dir") |
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
@contact: Yun Yan ([email protected]) | |
""" | |
import os | |
import time | |
import shutil | |
import subprocess | |
import yaml | |
def join_path(*args): | |
x = map(str, args) | |
return(os.path.join(*x)) | |
def paste(*args, sept=" "): | |
x = map(str, args) | |
return(sept.join(x)) | |
def paste0(*args): | |
return(paste(*args, sept="")) | |
def print_logger(msg): | |
localtime = time.asctime(time.localtime(time.time())) | |
print(paste(">>" + "[" + localtime + "]" + msg)) | |
return None |