Printing images from a list - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Printing images from a list (/thread-27785.html) |
Printing images from a list - Heyjoe - Jun-21-2020 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]) RE: Printing images from a list - menator01 - Jun-21-2020 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? RE: Printing images from a list - Heyjoe - Jun-22-2020 I would display it. Employee Number Employee Name Photograph 1..........................................Henry ...... RE: Printing images from a list - menator01 - Jun-22-2020 Are you going to use a gui like tkinter, pyqt5, or some other gui? RE: Printing images from a list - Heyjoe - Jun-22-2020 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. |