Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 14126

GUI isn't showing up after running python code

$
0
0

I'm building an Image to PDF converter app using python. When I run the code in the terminal the UI doesn't appear. Here is the code:

`import tkinter as tk from tkinter import filedialog, messagebox import os class ImageToPdfConverter:    def __init__(self, root):        self.root = root        self.image_paths = []        self.output_pdf_name = tk.StringVar()        self.selected_image_listbox = tk.Listbox(root, selectmode=tk.MULTIPLE)        self.initialize_ui()    def initialize_ui(self):        title_label = tk.Label(self.root, text = "Image to PDF Converter", font=("Helvetica", 16,"bold"))        title_label.pack(pady=10)def main():    root = tk.Tk()    root.title("Image to PDF")    root.geometry("400x600")    root.mainloop()    if __name__== "__main__":        main()`

When I click "Run Python File in Terminal", it runs however the UI does not show up.


Viewing all articles
Browse latest Browse all 14126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>