xkcd.py downloads all the images from the website named xkcd.com while random.py downloads a random image from the same website. You can use these codes and save all the images in a single directory. Enjoy! P.S. - Keep xkcd.py and random.py in different directory.