实现代码如下:

#获取文件的绝对路径
import os
class GetPath:
def get_path(self,path):
r=os.path.abspath(path)
return r
if __name__ == '__main__':
a=GetPath().get_path('./get_GetPath.py')
print(a)

 

相关文章:

  • 2021-07-23
  • 2021-06-18
  • 2022-12-23
  • 2021-09-25
  • 2021-08-29
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2022-02-15
  • 2023-03-17
相关资源
相似解决方案