← 返回列表

Python3 文件File对象属性

Python3 文件File对象属性 #!/usr/bin/python3 # Open a file fo = open("foo.txt", "wb") print ("Name of the file: ", fo.name) print ("Closed or not : ", fo.closed) print ("Opening mode : ", fo.mode) fo.close()

Python3 文件File对象属性

#!/usr/bin/python3

# Open a file
fo = open("foo.txt", "wb")
print ("Name of the file: ", fo.name)
print ("Closed or not : ", fo.closed)
print ("Opening mode : ", fo.mode)
fo.close()

打开资源 ↗

交流与评论