python中的os.path.realpath(__file__),取的是脚本的完整路径

[root@leexl ~]# cat tst.py


import os
Root = (os.path.realpath(__file__))
print Root


[root@leexl ~]# python tst.py
/root/tst.py


相关文章:

  • 2022-12-23
  • 2022-01-03
  • 2021-08-03
  • 2022-01-24
  • 2021-05-30
  • 2022-12-23
  • 2021-06-10
猜你喜欢
  • 2021-09-15
  • 2022-12-23
  • 2021-10-29
  • 2021-08-15
  • 2021-09-09
  • 2021-09-12
相关资源
相似解决方案