![]() If you don’t, you create a so-called resource leak. ![]() If the file was successfully opened, it returns a file object that you can use to read from and write to that file.Īs soon as you open a file with Python, you are using system resources that you need to free once you’re done. ![]() The open() function expects at least one argument: the file name. It’s part of Python’s built-in functions, you don’t need to import anything to use open(). In Python, we open a file with the open() function. ![]()
0 Comments
Leave a Reply. |