搞定,只支持你的那种调用方法
def PathMethod(path_str):
s = inspect.stack()
this_frame_info = s[1]
line_called_this_method = s[1].code_context[0]
start_idx = line_called_this_method.index("PathMethod(")
trim_front = line_called_this_method[start_idx + len("PathMethod("):]
end_idx = trim_front[1:].index(trim_front[0]) + 1
trimmed_str = trim_front[1:end_idx]
return trimmed_str.replace("\\", "/")