Nov-28-2018, 08:18 AM
Thanks Larz
I had already tried that, the reason it didn't work for me was that I had the path wrong didn't realise that windows truncated username.
So changed the path and ran the program again with the following result
images_0.jpg
images_1.jpg
images_2.jpg
images_3.jpg
I have used this code.
I had already tried that, the reason it didn't work for me was that I had the path wrong didn't realise that windows truncated username.
So changed the path and ran the program again with the following result
C:\Users\anybl\Python_Progs\shapes>image.py [<PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=4032x3024 at 0x3C10950>]What I am after is just a list of the images in a folder i.e
images_0.jpg
images_1.jpg
images_2.jpg
images_3.jpg
I have used this code.
import pathlib # define the path currentDirectory = pathlib.Path('.') for currentFile in currentDirectory.iterdir(): print(currentFile)Which gave me this.
C:\Users\anybl\Python_Progs\shapes>image.py cat.png image.py Shapes.py Shapes2_Pic.png Shapes_Pic.png star.pngWhich would be fine if it only gave me the images and not the .py extensions.