もっと詳しく

連載目次 from os.path import splitext # os.path.splitext関数はパスを拡張子とそれ以外に分割する w_file = ‘C:\\tmp\\pytips\\foo.txt’ u_file = ‘/tmp/pytips/foo.txt’ result = splitext(w_file) print(result) # (‘C:\\tmp\\pytips\\ …