Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Printing images from a list
#1
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])
Reply
#2
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 welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags


Reply
#3
I would display it.

Employee Number Employee Name Photograph
1..........................................Henry ...... Big Grin
Reply
#4
Are you going to use a gui like tkinter, pyqt5, or some other gui?
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags


Reply
#5
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question Printing through list.. again jesse68 2 1,162 Apr-16-2022, 03:24 PM
Last Post: jesse68
  help for list printing jip31 8 3,695 May-01-2021, 03:52 AM
Last Post: Pedroski55
  Problem printing last element from a list tester_V 3 2,429 Oct-30-2020, 04:54 AM
Last Post: tester_V
  Printing empty list? hhydration 2 2,146 Oct-28-2020, 11:34 AM
Last Post: Atekka
  printing a list contents without brackets in a print statement paracelx 1 2,157 Feb-15-2020, 02:15 AM
Last Post: Larz60+
  Printing List in one line bharat_s579 6 4,173 May-26-2019, 08:30 PM
Last Post: perfringo
  list is printing incorrectly.. anna 1 2,115 May-18-2019, 12:12 PM
Last Post: ichabod801
  Printing one thing from a list bidoofis 1 2,367 Feb-05-2019, 09:02 PM
Last Post: ichabod801
  Printing a new python list abdallah786 3 91,148 Aug-17-2018, 03:21 PM
Last Post: buran
  [Help] List of Lists not printing both Cmder/Anaconda? vanicci 4 3,602 Aug-15-2018, 03:00 PM
Last Post: vanicci

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020