Skip to content

技巧-Python #45

@ghost

Description

import os
if os.path.isdir(path):
    print "it's a directory"
elif os.path.isfile(path):
    print "it's a normal file"
else:
    print "it's a special file(socket,FIFO,device file)"

>>> os.path.exists('d:/assist')
 True
>>> os.path.exists('d:/assist/getTeacherList.py')
 True

os.path.getsize(path)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions