Module Attributes to Aid in Multi-platform Development : Path : File PYTHON TUTORIALS


PYTHON TUTORIALS » File » Path »

 

Module Attributes to Aid in Multi-platform Development


import os

print os.linesep      # String used to separate lines in a file
print os.sep        # String used to separate file pathname components
print os.pathsep    # String used to delimit a set of file pathnames
print os.curdir        # String name for current working directory
print os.pardir        # String name for parent (of current working directory)

path = "c:/"
print path
print os.path.isfile(path)
print os.path.isdir(path)
print os.path.split(path)
print os.path.splitext(os.path.basename(path))



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo File
» Path