更新时间:2022-12-25 14:43:36
一个方便的解决方案是移动"一个基本路径,即 basepath = "/home/user123/" 到一个变量中并将路径地址为
A handy solution would be to "move" a basepath, i.e. basepath = "/home/user123/" into a variable and address the path as
sys.path.append('{}/my_project/utilities'.format(basepath))
sys.path.append('{}/my_project/utilities'.format(basepath))
那会使相对符号变得丑陋,并为您提供灵活性.
That would ugly relative notation and give you flexibility.