markdown_image = open('/tmp/markdown_image.txt','w') withopen('/tmp/picture.txt','r') as f: for i in f.readlines(): PATH = path+i print(PATH) uploaded_image = im.upload_image(PATH.strip('\n'), title="Uploaded with PyImgur") print(uploaded_image.title) markdown_image.write("![]("+uploaded_image.link+")") print(uploaded_image.link) print(uploaded_image.size) print(uploaded_image.type) markdown_image.close() print("please use 'cat /tmp/markdown_image.txt' to view the markdown image path")