My project is a jpg/png slideshow written in Python 3.6 which I compile into an exe using Pyinstaller. I understand the exe may be a 'final product' and I am looking into ways to be able to add images to the img folder LATER and have the exe read those files as well. Is that even possible? TIA.
Asked
Active
Viewed 130 times
0
-
I am not sure where the issue would be. If your exe is reading images from the image folder, copy the new ones into it and it should be fine. Unless of course in your python code you are calling each one by name. Then you would need to re-compile – The4thIceman Oct 31 '17 at 00:16
-
I am not sure how else one would call a file from a folder if not by name. The python code first loads whatever files are in the image folder then call each individual pic when it’s time to show them. Adding new pics to the folder after compiling obviously does not work, at least in my project. – rearThing Oct 31 '17 at 19:53
-
Correct, for your project it would not work. This can help if you want to load the images as a group: https://stackoverflow.com/questions/26392336/importing-images-from-a-directory-python – The4thIceman Oct 31 '17 at 20:05
-
Thanks, I actually need to rephrase my last comment. I only use indexes when loading files first with: `os.listdir('pics')` and secondly with `os.path.abspath`, so no name calling. I understand glob does a similar job, may try that to see if it makes any difference. – rearThing Oct 31 '17 at 20:23
-
Well, it turns out images added later were corrupted so False alarm. thanks @The4thIcemen for jumping in. – rearThing Oct 31 '17 at 22:54