import os os.path.basename('/path/file.suffix') # file.suffix. With pathlib we can use the name attribute on a Path object: from pathlib import Path
確定! 回上一頁