File Attributes in Python | File Properties in Python | Python tutorials for beginners

Publicado el: 04 mayo 2020
en el canal de: Saivlogs
1,197
14

#FileAttributesinPython #FilePropertiesinPython #PythonTutorials

file attributes in python or file properties in python:
The file attributes are:
1. name....it returns the name of the file
2. mode....it returns the mode of the file.
3. writable()...it returns either True or False.
if it returns True, then the file is opened
writing mode.
otherwise it returns False.

4. readable()...it returns either True or False.
if it returns True, then the file is opened
reading mode.
otherwise it returns False.
5. closed...it returns either True or False.
if it returns ,the file is already closed.
otherwise returns False.
ex: to demonstrate the file properties:
fp=open('sample.txt','w+')
print('file name =',fp.name)
print('file mode=',fp.mode)
print('writeable =',fp.writable())
print('readable=',fp.readable())
print('closed=',fp.closed)
fp.close()
print('closed =',fp.closed)
---------------------------------------
Python tutorial for beginners| python programming language tutorial
Python basics | python tutorial for beginners | learn python programming from scratch
Python tutorial for beginners - learn python for machine learning and web development.
Python tutorial for beginners | python programming | learn python | great learning.
Python tutorial for beginners [full course] learn python for web development.


En esta página del sitio puede ver el video en línea File Attributes in Python | File Properties in Python | Python tutorials for beginners de Duración hora minuto segunda en buena calidad , que subió el usuario Saivlogs 04 mayo 2020, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 1,197 veces y le gustó 14 a los espectadores. Disfruta viendo!