eis/py/comlib/file/PathUtil.py

34 lines
709 B
Python
Raw Permalink Normal View History

# -*- coding: utf-8 -*-
'''
* @Author : zoufuzhou
* @Date : 2024-07-05 16:34:37
* @Description : read system environment variables
* @LastEditTime : 2024-07-05 16:34:37
'''
import os
class PathUtil:
path = '/users/dsc/code/'
def __init__(self):
self.path = os.getenv('CRGS')
# print(self.path)
if self.path is None:
self.path = '/users/dsc/code/'
# print(self.path)
def getPath(self):
return self.path
def getEnv(self, env):
return os.getenv(env)
def getPathConfig(self):
return self.path + '/config/'
# path = PathUtil().getPathConfig()
# print(path)
# a = PathUtil().getEnv("path")
# print(a)