Please run the following Google Collaboratory file to view proper output. If the media type is not an image, we print a short message saying that “Image is not available”.Then we use the Audio() function to play the audio file in our jupyter notebook.Then we store that information in specific directory with the. We create an object that will take text to be converted, speed of speech and language as inputs.If the user presses *, we’ll use Google Text to Speech ( gtts) library to convert the text into audio file. Now that our image and other information is displayed, we’ll ask the user if they want to hear the explanation of the image or not.Then we display the main image using the Image() function of the Ipython library.If the key exists, then we’ll display its value. We check if the specific information of the key exists or not. Now that we have downloaded the image in a specific directory, we are going to display other related information to the image.We also use os.path.join() to store the image in the newly created directory with a specified title name.To fetch the image we are using the () function. Now we fetch the image using the url retrieved in apod variable.If the directory doesn’t exist, then we create it using. To check whether the directory exists or not, we are using. We create a directory using the os library. Now we must have a specific directory to store the images.We also replace the colons and spaces with an underscore.Here, we will use the date of the image followed by the title of the image followed by the extension of the image. Now, we have to maintain a certain kind of name structure to save the images. So if our image has Standard Definition then we are not entering the loop.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |