python打开文件并获取文件的相关属性,python打开文件,#!/usr/bin/p


#!/usr/bin/python# Open a filefo = open("foo.txt", "wb")print "Name of the file: ", fo.nameprint "Closed or not : ", fo.closedprint "Opening mode : ", fo.modeprint "Softspace flag : ", fo.softspace
                                输出结果
Name of the file:  foo.txtClosed or not :  FalseOpening mode :  wbSoftspace flag :  0

评论关闭