I've been trying to input a tkinter code into a HTML format, like when I click a button, it opens a Tkinter layout. But it keeps giving me an error. What must I do?
New contributor
Trishan Karmakar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
-
2Welcome to Stack Overflow. What exactly do you mean by "input a tkinter code into a HTML format"? What you should do is include the code you're having issues with and also include the full traceback error. Without these, it's impossible to know how to answer you question.ewokx– ewokx2025-11-21 03:56:00 +00:00Commented yesterday
Add a comment
|
1 Answer
Tkinter runs on your local machine. HTML/JavaScript runs in a web browser. So you can't directly embed Tkinter in HTML because they operate in completely different environments. Here are a few things I can suggest:
If it's a desktop app, use Tkinter by itself, don't try to mix it with HTML.
If it's a web app, replace Tkinter with a web framework (Flask, Django) + HTML/CSS/JavaScript.
If it's both, run Tkinter on the backend and communicate with a web frontend via an API.
New contributor
Shirley is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.