I n today's era who would don't like to learn about technology? .The latest trending hot topics like Machine learning, Data Science, Big data, and Data visualization. these are such technologies that are taking the world to the next level. The person who might be reading this may be a computer nerd or expert or a student like me. So to be updated we must read the treading topics of upcoming updates and technology But I know you very well!. Going to the website or reading articles or even in-shorts sounds troublesome. So the best and fun solution is that we can read the news programmatically. To do this I have used the requests module and JSON module Here the major part is to get the API key by creating an account on the news API website . requests. get(URL) -- it visits the provided URL and collects the HTML content of the web page brings it in the python code. But we need the title from the news So to do that, I have used JSON built-in function JSON.l...
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...
Comments
Post a Comment