34 lines
709 B
Python
34 lines
709 B
Python
# -*- 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)
|