Code: import os # imports os module import shutil # imports shutil module file =os.listdir() # it lists the files present in this directory def Createfolder ( foldername ): # Creates a foldername with a provided name if not os.path.exists(foldername): # if folder does not exists os.makedirs(foldername) # Then folder gets created of provided foldername else : print ( f " { foldername } folder already exists" ) #if folder exists message gets printed Createfolder( 'Media' ) Createfolder( 'Documents' ) Createfolder( 'Others' ) # c...
I am using Visual studio code editor for this project. Its really awesome for writing huge programs as it has awesome extensions which makes your coding life ease. It has triggered love for many coders as it is one of the Microsoft Produ ct. Link for vs code: Visual studio code Feel free to use other editors Like pycharm . B ut for my convince I am using VS Code. The Project begins with importing some required modules by using "import" keyword. Datetime Random Datetime Module : This module is used to fetch the current time and date as the name suggests. I have used "datetime.datetime.now()" for Bookticket function to do this task. Random Module: This module is used to generate a random number. For more checkout the documentation Random module Strftime: It used to convert time into string. For more details checkout the documentation: Strftime To create a class use the keyword class : A class is a Te...
Comments
Post a Comment