>>> import os.path >>> filename = "hoge.txt" >>> filename 'hoge.txt' >>> name, ext = os.path.splitext(filename) >>> name 'hoge' >>> ext '.txt'
牌語備忘録 -pygo
>>> import os.path >>> filename = "hoge.txt" >>> filename 'hoge.txt' >>> name, ext = os.path.splitext(filename) >>> name 'hoge' >>> ext '.txt'