python路径描述方式

python在描述路径时可以有多种方式,现列举常见的三种

方式一:转义的方式

'd:\\a.txt'

方式二:显式声明字符串不用转义

'd:r\a.txt'

方式三:使用Linux的路径/

'd:/a.txt'
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11


猜你喜欢

转载自blog.csdn.net/songruibb/article/details/80008495