The macpath module (see Example 13-2) provides os.path functionality on Macintosh platforms. You can also use it to handle Macintosh paths on other platforms.
File: macpath-example-1.py import macpath file = "my:little:pony" print "isabs", "=>", macpath.isabs(file) print "dirname", "=>", macpath.dirname(file) print "basename", "=>", macpath.basename(file) print "normpath", "=>", macpath.normpath(file) print "split", "=>", macpath.split(file) print "join", "=>", macpath.join(file, "zorba") isabs => 1 dirname => my:little basename => pony normpath => my:little:pony split => (my:little, pony) join => my:little:pony:zorba
Core Modules
More Standard Modules
Threads and Processes
Data Representation
File Formats
Mail and News Message Processing
Network Protocols
Internationalization
Multimedia Modules
Data Storage
Tools and Utilities
Platform-Specific Modules
Implementation Support Modules
Other Modules