Hi all, new to python and spent the last few days learning some basics (but kind of rushing through the fundimentals; i have some coding bg and mainly wanted to dive into working on this. not good practice, but its what i did)
My end goal is to write a program that will open a random PNG file from the liss of all files in a folder. i have written that successfully, but what i need is for it to open the actual file for editing. Below is a simplified version of my code that simply opens a specified image in a given older, and writes the filepath in the console.
Currently, as per how the actual module works, it scans the chosen file and opens it as a temporary image, which is deleted as soon as its opened, making it essentially a fresh image that would need to be saved/"re"saved as a new file, with the original left untouched no matter what. How would i go about opening the original file, such that the paint window that opens can be edited and then Ctrl + S would save those changes over the original specified file?
from PIL import Image # Initializer for images.
FileName = "3" # File to open.
FilePath = "C:/Users/ [Username] /Desktop/RandomImageTest/" + FileName + ".png" # Filepath for image to open.
print(FilePath) # Writes the filename in console.
Image.open(File).show() # Opens file.```