Try this:
import tkinter as tk from PIL import ImageTk, Image #This creates the main window of an application window = tk.Tk() window.title("Join") window.geometry("300x300") window.configure(background='grey') path = "Aaron.jpg" #Creates a Tkinter-compatible photo image, which can be used everywhere Tkinter expects an image object. img = ImageTk.PhotoImage(Image.open(path)) #The Label widget is a standard Tkinter widget used to display a text or image on the screen. panel = tk.Label(window, image = img) #The Pack geometry manager packs widgets in rows or columns. panel.pack(side = "bottom", fill = "both", expand = "yes") #Start the GUI window.mainloop()
Related docs: ImageTk Module, Tkinter Label Widget, Tkinter Pack Geometry Manager
Related Posts:
- PermissionError: [Errno 13] Permission denied
- _tkinter.TclError: no display name and no $DISPLAY environment variable
- _tkinter.TclError: no display name and no $DISPLAY environment variable
- How to resize an image with OpenCV2.0 and Python2.6
- ImportError: No module named ‘Tkinter’
- How to pip or easy_install tkinter on Windows
- matplotlib error – no module named tkinter
- tkinter gui with progress bar
- filedialog, tkinter and opening files
- How can I create a dropdown menu from a List in Tkinter?
- TypeError: generatecode() takes 0 positional arguments but 1 was given
- Tkinter understanding mainloop
- takes 1 positional argument but 2 were given
- How to pass arguments to a Button command in Tkinter?
- Tkinter scrollbar for frame
- Tkinter understanding mainloop
- AttributeError: ” object has no attribute ”
- matplotlib error – no module named tkinter
- How to convert a PIL Image into a numpy array?
- How do I resize an image using PIL and maintain its aspect ratio?
- How to use an image for the background in tkinter?
- How to update a plot in matplotlib?
- No module named Image
- Saving a Numpy array as an image
- Function to close the window in Tkinter
- Windows- Pyinstaller Error “failed to execute script ” When App Clicked
- matplotlib: how to draw a rectangle on image
- RuntimeWarning: overflow encountered in ubyte_scalars
- Using Tkinter in python to edit the title bar
- Difference between import tkinter as tk and from tkinter import
- Disable / Enable Button in TKinter
- How to clear Tkinter Canvas?
- How to embed image or picture in jupyter notebook, either from a local machine or from a web resource?
- How to handle a Button click event
- TypeError: Image data can not convert to float
- Numpy Resize/Rescale Image
- TypeError: Image data can not convert to float
- tkinter gui layout using frames and grid
- Tkinter error: Couldn’t recognize data in image file
- Strange Exception in Tkinter callback
- How do I compile my Python 3 app to an .exe?
- Python OpenCV2 (cv2) wrapper to get image size?
- Equivalent to matlab’s imagesc in matplotlib? [duplicate]
- TypeError: only size-1 arrays can be converted to Python scalars (matplotlib)
- Why do I get TypeError: can’t multiply sequence by non-int of type ‘float’?
- Writing a pandas DataFrame to CSV file
- When should I use uuid.uuid1() vs. uuid.uuid4() in python?
- ImportError: No module named tensorflow
- Best way to convert string to bytes in Python 3?
- How do you change the size of figures drawn with Matplotlib?
- Error: all the input array dimensions except for the concatenation axis must match exactly
- Expected 2D array, got 1D array instead error
- How to prevent errno 32 broken pipe?
- The equivalent of a GOTO in python [duplicate]
- Invalid character in identifier
- if else in a list comprehension
- What does “\r” do in the following script?
- Convert list to tuple in Python
- Python: TypeError: object of type ‘NoneType’ has no len()
- anaconda – path environment variable in windows
- Pandas: ValueError: cannot convert float NaN to integer
- How to find all occurrences of an element in a list
- Python Finding Prime Factors
- ValueError: ‘object too deep for desired array’
- ‘int’ object has no attribute ‘__getitem__’
- AttributeError(“‘str’ object has no attribute ‘read'”)
- How to get an absolute file path in Python
- Restart python-script from within itself
- What does “TypeError ‘xxx’ object is not callable” means?
- How to make a 3D scatter plot in matplotlib
- Arrays used as indices must be of integer (or boolean) type
- How can I compare two lists in python and return matches
- How to draw vertical lines on a given plot in matplotlib
- Changing the “tick frequency” on x or y axis in matplotlib
- mysql_config not found when installing mysqldb python interface
- “ImportError: No module named site” on Windows
- How do you read a file into a list in Python?
- How to find elements by class
- Euclidean Algorithm / GCD in Python
- Pandas split DataFrame by column value
- Using numpy to build an array of all combinations of two arrays
- Get a random sample with replacement
- Can’t update to numpy 1.13 with anaconda?
- Is there any simple way to benchmark Python script?
- Purpose of python antigravity module
- Error: “dictionary update sequence element #0 has length 1; 2 is required” on Django 1.4
- Flask-SQLalchemy update a row’s information
- Inline for loop
- Read data (.dat file) with Pandas
- Is there any numpy group by function?
- What is the correct format to write float value to file in Python
- How is Python’s List Implemented?
- ImportError: No module named IPython
- How to find length of digits in an integer?
- What exactly do “u” and “r” string flags do, and what are raw string literals?
- “E: Unable to locate package python3-pip”
- Compare two columns using pandas
- ValueError: total size of new array must be unchanged
- Shuffle an array with python, randomize array item order with python
- No handlers could be found for logger