Python - File Management

os

Posted by Rico's Nerd Cluster on January 18, 2019

File Path Processing

  • os.path.basename("/home/foo/Downloads/000000.pcd") gives the string after the last “/”. So here we get: 000000.pcd
  • os.path.splitext("/home/foo/Downloads/000000.pcd") gives '/home/foo/Downloads/000000', '.pcd'