Skip to content
Advertisement

Tag: tkinter

Cannot bind NumPad minus key on Linux with Tkinter

I encountered an issue regarding KeyPress binds in tkinter when switching between Windows and Linux while using a NumPad. Using self.bind(“-“, function) works on Windows, however is not triggered on Linux. With the following code snippet I found out that the events of a keyboard-minus differs from a numpad-minus. Code: Output: Is there a way to make Linux recognize the

How to build a Tkinter GUI in linux like exe in window?

I worote some Tkinter script in Linux,everytime I use “python script.py” to run it from terminal, but in windows,I can use pyinstaller to build an EXE file, then double click the GUI will run. How do I do in linux to build an “exe” file then can click it will run instead of “python script.py”? pyinstaller Answer In Linux you

How can I use python 3 tkinter in Linux?

I tried the following program in Win10, it works But I want to use it in linux mint and it display nothing (it display a window with a button on my win10) from tkinter import * tk=Tk() btn= Button(tk,text=”ttk”) btn.pack() I want it display a window with a button on my linux mint Answer You need to invoke Tk’s mainloop.

unbound method mainloop() must be called with Tk instance as first argument (got nothing instead)

The below code is a simple code which I tried to check if Tkinter worked… Acoording to https://www.tutorialspoint.com/python/python_gui_programming.html this should open a blank window But the following error message was received Any suggestions… Answer Tkinter.Tk() creates an instance of Tk() object which act as argument for mainloop. Do this instead: Read this for further understanding. tkinter-understanding mainloop

‘Close window’ button wont work when using tkinter + gobject

My tkinter application runs fine, but to implement dbus functionality I had to use gobject. Got it working and all, except that, running both tkinter’s and gobject’s mainloops makes the “close window” button from the standard window manager (‘x’ button in the window interface) not to work. :/ Everything else works fine, including resizing, minimizing/maximizing, restoring, and moving the window.

Binding callbacks to minimize and maximize events in Toplevel windows

I’ve read through related answers and it seems that the accepted way to do this is by binding callbacks to <Map> and <Unmap> events in the Toplevel widget. I’ve tried the following but to no effect: I’m running python 2.7 on Linux. Could this be related to window manager code in different operating systems? Calling tk.iconify() before tk.mainloop() has no

How to open new bash terminal using Python

I am trying to open a new terminal window in Tkinter application. I’ve used os.system(“/bin/bash”) but it works in current bash only. Which stops runnning code and causes application freeze. I want to open new Terminal. How to do that? gedit like programs work fine without disturbing current apllication. Answer Try this:

Tkinter look (theme) in Linux

I know that Tkinter is not so modern, not so cool and maybe better to use PyQt or etc. But it is interesting for me can Tkinter look not so ugly in Ubuntu (Linux). Looks that brew version (in OS X) of python’s Tkinter compiled with built-in theme and looks good: But Ubuntu’s Tkinter makes me cry: I’ve read that

Advertisement