Social Icons

Friday, 24 January 2020

BASIC FUNCTIONS PYTHON

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))

No comments:

Post a Comment

 

Sample Text

Sample text

 
Just Programming Cse DriveReputation Management