How python closes a file
Today, I would like to share with you the relevant knowledge points about how python closes a file. The content is detailed and the logic is clear. I believe most people still know too much about this, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.
The details are as follows:
Close () syntax
File.close () # file refers to a file object
Examples of use:
#! / usr/bin/python
#-*-coding: UTF-8-*-
# www.xieniao.com
# Open the file
Fo = open ("yisu.txt", "wb")
The print "file name is:", fo.name
# close the file
Fo.close ()
These are all the contents of the article "how to close a File by python". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.