Python Forum

Full Version: Printing images from a list
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am just starting to learn Python. I have written this simple program to print the employee number, employee name and a picture of the employee by giving the program the employee number. Where it says "Henrys Picture", I would want an actual photograph of Henry.

My first question is can you put a picture or image into a list?

If possible I would like to put 100 pictures into my Python program, without accessing external picture files.
Is this possible or would I have to have the program load a jpeg or tif file?

Any thing to get me started would be greatly appreciated.

employee = [[0,"Joe","Joes pic"],[1,"Henry","Henrys picture"],[2,"Joan","Joans picture"]]
print(employee[1])
Maybe a more experienced person can correct me but, I don't think that is possible. You will have to load an image file from a folder. Whether it be converted to a binary or some other means. How do you plan to display the information?
I would display it.

Employee Number Employee Name Photograph
1..........................................Henry ...... Big Grin
Are you going to use a gui like tkinter, pyqt5, or some other gui?
I just heard of the program tkinter the other day and am not familar with Gui's since most of the programming I did was in Excel Visual Basic for Applications.

Tkinter is probably something I will use since my program will be constantly calling for input from the user.

I want to make a self executable file of my program and an article I read said this is possible with Tkinter.

So I guess the answer is yes.