Using absolute unix paths in windows with python

后端 未结 3 1051
无人共我
无人共我 2020-12-30 21:09

I\'m creating an application that stores blob files into the hard drive, but this script must run in both linux and windows, the issue is that i want to give it an absolute

3条回答
  •  误落风尘
    2020-12-30 21:45

    From Blenders response at Platform-independent file paths?

    >>> import os
    >>> os.path.join('app', 'subdir', 'dir', 'filename.foo')
    'app/subdir/dir/filename.foo'
    

提交回复
热议问题