-5

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.
1
  • 2
    Welcome 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. Commented yesterday

1 Answer 1

0

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.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.