Make a folder making system using python
Hey guys once again welcome to the Decoders blog, I hope you all are doing well and today I'm present with a folder making system which will basically help you in making new folder/directories in preferred location on your OS. The given code will help you to built it, so just follow the codes and make your notifier easily, and enjoy it with your friends
#os module in python is basically used beacause it gives us a way to interact
with our os in the system by helping in creating new directory and variouse
files and later on we can also rename those files and also delete or remove
the files as per our requirements
import os
def pretify():
location=input("enter the location of the file:")
format=input("enter the format of the file with its name:")
os.chdir(f"{location}")
os.rename(format,format.capitalize())
print("done successfully")
def make_file():
location=input("enter the location of the file:")
os.chdir(f"{location}")
name=input("enter the name of the file:")
os.mkdir(f"{name}")
print("done successfully")
def remove_file():
location=input("enter the location of the file:")
os.chdir(f"{location}")
remove=input("enter the name of the file to be removed:")
os.removedirs(f"{remove}")
print("done successfully")
i=1
while i==1:
n1=input("do you want to pretify folder/make folder/remove folder: ")
if n1=="pretify":
pretify()
elif n1=="make":
make_file()
elif n1=="remove":
remove_file()
else:
break
Comments
Post a Comment