[Python] startx doesn't load python tkinter app openbox

Discussão em 'Python' iniciado por Stack, Fevereiro 22, 2025.

  1. Stack

    Stack Membro Participativo

    Im using openbox to control a tkinter app. My app is t.py and is located in ~.

    This is my ~/.config/openbox/autostart:

    python3 ~/t.py


    This is t.py:

    import tkinter as tk

    root = tk.Tk()
    label = tk.Label(root, text="Hello")
    label.pack()
    root.mainloop()


    When I run sudo startx, I can see the cursor pop up then hide, but after that its just a black screen. I am running these commands over ssh as well. I had this working before with a separate .py file but can no longer get it to work. I am running this on a Raspberry Pi Zero 2 W with a HDMI screen. The Pi is installed with the latest Raspberry Pi OS Lite.

    Continue reading...

Compartilhe esta Página