create a test file with two lines and verify that the file has been created by listing the directory again afterward : Directory : File PYTHON TUTORIALS


PYTHON TUTORIALS » File » Directory »

 

create a test file with two lines and verify that the file has been created by listing the directory again afterward


import os


fobj = open('test', 'w')
fobj.write('foon')
fobj.write('barn')
fobj.close()
print os.listdir('c:\')



Leave a Comment / Note


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


PYTHON TUTORIALS

 Navioo File
» Directory