Reputation: 33
I am developing an application using Python + SQLite. The application is very basic - it will take user input through GUI and retrieve data based on the button clicks. There is no requirement for web technology.
I plan to use Tkinter for developing the GUI. This works fine for taking user input. However the output is a bit complex - it involves a lot of table joins and formatting the result table by way of merging some rows. I have HTML code for this output and it looks good. Tkinter does not have built-in table widget so to get that same output it would require lot more work. Further, I don't think I can get the formatted output I require by Tkinter.
What I am thinking of is this : is it possible to use a combination of browser app and desktop app features? Can I use Tkinter to take user input using normal GUI and use browser to display results? I plan to put html code as triple quoted string inside Python script and produce the html output in the browser (the browser will not be used to take user input at all, so there is no need to send data from the form to Python). The user after seeing the result can close the browser window and proceed in Tkinter GUI for rest of the work.
Is this a good idea to use Tkinter GUI for input and browser for output?
Upvotes: -1
Views: 196
Reputation: 46
You can do it by installing tkinter web, and then create a TKinter frame that loads your HTML with .get()
methods:
pip install tkinterweb
then:
from tkinterweb import HtmlFrame
Read the documentation here.
Upvotes: 1
Reputation: 360
It certainly is possible to use the combination of browser app and desktop app together. However, to me it seems like the work would be more complicated than necessary.
How about making a simple server with python and just solely sticking with the web app? You can just use simplehttpserver and not have to do any server configuration. (i.e. just http://0.0.0.0:3000 to access the web after running simplehttpserver with python)
You already have the nicely made HTML code, I think that would be a much simpler way of accomplishing the task.
Upvotes: 2