The text below is selected, press Ctrl+C to copy to your clipboard. (⌘+C on Mac) No line numbers will be copied.
Guest
Python FAQ. What is tkinter in Python? What is the best GUI for Python? Tkinter Course: Create Graphic User Interfaces in Python Tutorial
By Guest on 7th November 2022 08:36:47 AM | Syntax: PYTHON | Views: 142



New Paste New paste | Download Paste Download | Toggle Line Numbers Show/Hide line no. | Copy Paste Copy text to clipboard
  1. What is tkinter in Python?
  2. Is tkinter the only GUI for Python?
  3. What is the best GUI for Python?
  4. What is tkinter in Python with example?
  5.  
  6.  
  7.  
  8. What GUI toolkits exist for Python?
  9. ===================================
  10.  
  11. Standard builds of Python include an object-oriented interface to the
  12. Tcl/Tk widget set, called tkinter.  This is probably the easiest to
  13. install (since it comes included with most binary distributions of
  14. Python) and use. For more info about Tk, including pointers to the
  15. source, see the Tcl/Tk home page.  Tcl/Tk is fully portable to the
  16. macOS, Windows, and Unix platforms.
  17.  
  18. Depending on what platform(s) you are aiming at, there are also
  19. several alternatives. A list of cross-platform and platform-specific
  20. GUI frameworks can be found on the python wiki.
  21.  
  22.  
  23. Tkinter questions
  24. =================
  25.  
  26.  
  27. How do I freeze Tkinter applications?
  28. -------------------------------------
  29.  
  30. Freeze is a tool to create stand-alone applications.  When freezing
  31. Tkinter applications, the applications will not be truly stand-alone,
  32. as the application will still need the Tcl and Tk libraries.
  33.  
  34. One solution is to ship the application with the Tcl and Tk libraries,
  35. and point to them at run-time using the "TCL_LIBRARY" and "TK_LIBRARY"
  36. environment variables.
  37.  
  38. To get truly stand-alone applications, the Tcl scripts that form the
  39. library have to be integrated into the application as well. One tool
  40. supporting that is SAM (stand-alone modules), which is part of the Tix
  41. distribution (https://tix.sourceforge.net/).
  42.  
  43. Build Tix with SAM enabled, perform the appropriate call to
  44. "Tclsam_init()", etc. inside Python's "Modules/tkappinit.c", and link
  45. with libtclsam and libtksam (you might include the Tix libraries as
  46. well).
  47.  
  48.  
  49. Can I have Tk events handled while waiting for I/O?
  50. ---------------------------------------------------
  51.  
  52. On platforms other than Windows, yes, and you don't even need threads!
  53. But you'll have to restructure your I/O code a bit.  Tk has the
  54. equivalent of Xt's "XtAddInput()" call, which allows you to register a
  55. callback function which will be called from the Tk mainloop when I/O
  56. is possible on a file descriptor.  See File Handlers.
  57.  
  58.  
  59. I can't get key bindings to work in Tkinter: why?
  60. -------------------------------------------------
  61.  
  62. An often-heard complaint is that event handlers bound to events with
  63. the "bind()" method don't get handled even when the appropriate key is
  64. pressed.
  65.  
  66. The most common cause is that the widget to which the binding applies
  67. doesn't have "keyboard focus".  Check out the Tk documentation for the
  68. focus command. Usually a widget is given the keyboard focus by
  69. clicking in it (but not for labels; see the takefocus option).
  70.  
  71. Tkinter Beginner Course - Python GUI Development
  72.  
  73. Tkinter Course - Create Graphic User Interfaces in Python Tutorial (5 Hours)
















Python software and documentation are licensed under the PSF License Agreement.
Starting with Python 3.8.6, examples, recipes, and other code in the documentation are dual licensed under the PSF License Agreement and the Zero-Clause BSD license.
Some software incorporated into Python is under different licenses. The licenses are listed with code falling under that license. See Licenses and Acknowledgements for Incorporated Software for an incomplete list of these licenses.

Python and it's documentation is:
Copyright © 2001-2022 Python Software Foundation. All rights reserved.
Copyright © 2000 BeOpen.com. All rights reserved.
Copyright © 1995-2000 Corporation for National Research Initiatives. All rights reserved.
Copyright © 1991-1995 Stichting Mathematisch Centrum. All rights reserved.

See History and License for complete license and permissions information:
https://docs.python.org/3/license.html#psf-license
  • Recent Pastes