18 os -- predefined module

 '''

1. The OS module in python provides functions for 

interacting with the operating system. 

'''

import os


print(dir(os))


# To create a directory

#os.mkdir('TODAY')


# To remove directory

#os.rmdir("TODAY")


# To create a file

#open("my_file.py", 'w')

 

# To rename a file use os module

#os.rename('my_file.py', 'RRR.py')


# To check file is exist or not return True is exist or False

#status = os.path.isfile('RRR.py')

#print(' Status :', status)


# To run system commands

#print(os.system('dir'))

#os.system('python today.py')


Comments

Popular posts from this blog

1 PYTHON PROGRAMMING

16 file handling in python

4 Tuple data types