How to remove bad path characters in Python?

后端 未结 4 1800
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-05 17:16

What is the most cross platform way of removing bad path characters (e.g. \"\\\" or \":\" on Windows) in Python?

Solution

Because there seems to be no idea

4条回答
  •  执念已碎
    2020-12-05 17:47

    That character is in os.sep, it'll be "\" or ":", depending on which system you're on.

提交回复
热议问题