Skip to content

Instantly share code, notes, and snippets.

View ZhigangPu's full-sized avatar

Ayron ZhigangPu

  • Hongkong university of science and techonology
  • Hongkong
View GitHub Profile
# check exsitence of file
import os
if not os.path.exists(file): raise ValueError('The given requirements file does not exist.')
# get absolute path and set it as default path prefix
import os
from functools import partial
here = os.path.abspath(os.path.dirname(__file__))
get_path = partial(os.path.join, here)