Closing Files : File Close : File PYTHON examples


PYTHON examples » File » File Close »

 

Closing Files





# Open files consume system resources, and depending on the file mode, 
# other programs may not be able to access them. 

# It's important to close files as soon as you're finished with them, as shown in 


f = open("/music/_singles/kairo.mp3""rb")        

print f.closed                                     

f.close()                                          
print f 

print f.closed                                     

# The closed attribute of a file object indicates whether the object has 
# a file open or not. In this case, the file is still open (closed is False).

           
       



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo File
» File Close


Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0