import os
import fnmatch
print("=============================================")
print(" PERFORMING BASIC FUNCTIONS OF OS MODULE ")
z=os.getcwd()
"""
os.mkdir(os.path.join(z,"NEW"))
os.rmdir('/home/jitender/PYTHON_SCRIPTS/BLOG/NEW')
"""
for i,j,k in os.walk('/home/jitender/PYTHON_SCRIPTS/'):
for n in k:
if fnmatch.fnmatch(n,'*.gz'):
print("Removing %s" %n)
os.remove(os.path.join(i,n))
import fnmatch
print("=============================================")
print(" PERFORMING BASIC FUNCTIONS OF OS MODULE ")
z=os.getcwd()
"""
os.mkdir(os.path.join(z,"NEW"))
os.rmdir('/home/jitender/PYTHON_SCRIPTS/BLOG/NEW')
"""
for i,j,k in os.walk('/home/jitender/PYTHON_SCRIPTS/'):
for n in k:
if fnmatch.fnmatch(n,'*.gz'):
print("Removing %s" %n)
os.remove(os.path.join(i,n))
No comments:
Post a Comment