I am brand new to Python and am working on an image filing app. I created an array extracting files from a local folder on my desktop as a test. With the code I have below I am using PIL, and can open up all the images (currently 8) separate from the GUI. How do I take an array of images and place them INTO the GUI and have them show side by side. Any feedback is greatly appreciated thank you. Code below:
import numpy as np
import customtkinter
import tkinter as tk
from tkinter import *
import glob
import cv2
from PIL import Image, ImageTk
MainWindow = customtkinter.CTk()
SamplePhotos = glob.glob("C:/Users/*****/Desktop/MTGPythonPHotos/*")
images = []
for image in SamplePhotos:
im=Image.open(image)
im.show()
images.append(im)
print(image)
print(len(images))
ImageArrayText = customtkinter.CTkLabel(MainWindow, text = len(images), font = ("Arial", 30))
ImageArrayText.pack()
#DisplayedImages = Label(MainWindow, image = images)
#DisplayedImages.pack()
MainWindow.mainloop()
New contributor
Mr_Packer12 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.