import os os.path.split("c:\music\ap\m.mp3") (filepath, filename) = os.path.split("c:\music\ap\m.mp3") print filepath print filename (shortname, extension) = os.path.splitext(filename) print shortname print extension # The split function splits a full pathname and returns a tuple containing the path # and filename. # os.path also contains a function splitext, which splits a filename and returns a # tuple containing the filename and the file extension.
Name (required)
email (will not be published) (required)
Website