which one should I use: os.sep or os.path.sep?

后端 未结 4 1512
心在旅途
心在旅途 2020-12-13 16:48

They are same, but which one should I use?

http://docs.python.org/library/os.html:

os.sep

The character used by t

4条回答
  •  时光取名叫无心
    2020-12-13 17:44

    I recommend you use os.path.sep for clarity, since it's a path separator, not an OS separator. If you import os.path as path you can call it path.sep, which is even better.

提交回复
热议问题