The sagetk Python module
sagetk is a Python module for creating GUI applications using a HTML and CSS like syntax . It is built on top of classical tkinter library and provides a high-level interface for defining widgets, handling events, and managing application state.
INSTALLATIONS:
sagetk can be installed using pip:
pip install sagetk
It depends on few other packages, including, pillow and html.parser, which will also be installed automatically.
USAGE
The basic usage of sagetk involves defining a document object that describes the structure and content of the GUI using a markup language similar to HTML. This document can include various widgets, such as buttons, labels, text areas, menus, and tables, as well as event handlers that respond to user interactions with the widgets.
Once the document is defined, it can be displayed in a window by calling the document() function from the sagetk module that serves the document and handles user interactions, such as clicks, key presses, and mouse movements.
The run() function can then be called to start the event loop and handle these interactions. This function blocks until the user closes the window or the program exits.
DOCUMENTATIONS
The sagetk module includes comprehensive documentation that covers the various widgets, events, functions, and classes available in the library. The documentation is available online at http://sagetk.atspace.cc, and can also be accessed programmatically using the help() function in Python.
EXAMPLES
The sagetk module includes several examples that demonstrate the usage and capabilities of the library. These examples cover a wide range of GUI applications, from simple calculators and text editors to more complex data analysis tools and scientific simulations.
The examples are located in the examples directory of the sagetk source distribution, and can be run by executing the corresponding Python scripts. They can also be used as templates or starting points for building custom GUI applications using sagetk.
//CREATING BUTTON
import sagetk as tk
tk.g=globals()
doc="""
<root>
<title>my app</title>
<button onclick="alert('hello world')">Click here</button>
</root>
"""
tk.document(doc)
tk.run()
//CREATING INPUTS
import sagetk as tk
tk.g=globals()
doc="""
<root>
<title>my app</title>
<input type="text"></input>
</root>
"""
tk.document(doc)
tk.run()
//CREATING TABLE
import sagetk as tk
tk.g=globals()
doc="""
<root>
<title>my app</title>
<table>
<tr>
<th>name</th>
<th>age</th>
</tr>
<tr>
<td>Mark</td>
<td>77</td>
</tr>
</table>
</root>
"""
tk.document(doc)
tk.run()
//CREATING Menu
import sagetk as tk
tk.g=globals()
doc="""
<root>
<title>my app</title>
<menu>
<mi label=file>
<md onclick="func">open</md>
<sp></sp>
<md>save as</md>
</mi>
<mi label=edit>
<md alt="ctrl + x">cut</md>
<sp></sp>
<md alt="ctrl + c">copy</md>
</mi>
</menu>
</root>
"""
tk.document(doc)
tk.run()
Change log
==========
0.0.1 (02/04/2023)
------------------
Third release
Raw data
{
"_id": null,
"home_page": "",
"name": "sagetk",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "sagetk,GUIs,html,gui,tkinter,tk",
"author": "Chanda Fungamwango Mark",
"author_email": "chandamark386@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/ea/fb/fa5ae97029475cfc69cb8e4c7d535a452c0e02f168ca7a72cb75269acb3e/sagetk-0.0.3.tar.gz",
"platform": null,
"description": "The sagetk Python module\r\n\r\nsagetk is a Python module for creating GUI applications using a HTML and CSS like syntax . It is built on top of classical tkinter library and provides a high-level interface for defining widgets, handling events, and managing application state.\r\n\r\n\r\nINSTALLATIONS:\r\n\r\nsagetk can be installed using pip:\r\n\r\npip install sagetk\r\n\r\nIt depends on few other packages, including, pillow and html.parser, which will also be installed automatically.\r\n\r\nUSAGE\r\n\r\nThe basic usage of sagetk involves defining a document object that describes the structure and content of the GUI using a markup language similar to HTML. This document can include various widgets, such as buttons, labels, text areas, menus, and tables, as well as event handlers that respond to user interactions with the widgets.\r\n\r\nOnce the document is defined, it can be displayed in a window by calling the document() function from the sagetk module that serves the document and handles user interactions, such as clicks, key presses, and mouse movements.\r\n\r\nThe run() function can then be called to start the event loop and handle these interactions. This function blocks until the user closes the window or the program exits.\r\n\r\n\r\nDOCUMENTATIONS\r\n\r\nThe sagetk module includes comprehensive documentation that covers the various widgets, events, functions, and classes available in the library. The documentation is available online at http://sagetk.atspace.cc, and can also be accessed programmatically using the help() function in Python.\r\n\r\nEXAMPLES\r\n\r\nThe sagetk module includes several examples that demonstrate the usage and capabilities of the library. These examples cover a wide range of GUI applications, from simple calculators and text editors to more complex data analysis tools and scientific simulations.\r\n\r\nThe examples are located in the examples directory of the sagetk source distribution, and can be run by executing the corresponding Python scripts. They can also be used as templates or starting points for building custom GUI applications using sagetk.\r\n\r\n//CREATING BUTTON\r\nimport sagetk as tk\r\ntk.g=globals()\r\ndoc=\"\"\" \r\n<root>\r\n<title>my app</title>\r\n<button onclick=\"alert('hello world')\">Click here</button>\r\n</root> \r\n\"\"\"\r\ntk.document(doc)\r\ntk.run()\r\n\r\n\r\n//CREATING INPUTS\r\nimport sagetk as tk\r\ntk.g=globals()\r\ndoc=\"\"\" \r\n<root>\r\n<title>my app</title>\r\n<input type=\"text\"></input>\r\n</root> \r\n\"\"\"\r\ntk.document(doc)\r\ntk.run()\r\n\r\n\r\n//CREATING TABLE\r\nimport sagetk as tk\r\ntk.g=globals()\r\ndoc=\"\"\" \r\n<root>\r\n<title>my app</title>\r\n<table>\r\n<tr>\r\n<th>name</th>\r\n<th>age</th>\r\n</tr>\r\n<tr>\r\n<td>Mark</td>\r\n<td>77</td>\r\n</tr>\r\n</table>\r\n</root> \r\n\"\"\"\r\ntk.document(doc)\r\ntk.run()\r\n\r\n\r\n//CREATING Menu\r\nimport sagetk as tk\r\ntk.g=globals()\r\ndoc=\"\"\" \r\n<root>\r\n<title>my app</title>\r\n<menu>\r\n<mi label=file>\r\n<md onclick=\"func\">open</md>\r\n<sp></sp>\r\n<md>save as</md>\r\n</mi>\r\n<mi label=edit>\r\n<md alt=\"ctrl + x\">cut</md>\r\n<sp></sp>\r\n<md alt=\"ctrl + c\">copy</md>\r\n</mi>\r\n</menu>\r\n</root> \r\n\"\"\"\r\ntk.document(doc)\r\ntk.run()\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nChange log\r\n==========\r\n\r\n0.0.1 (02/04/2023)\r\n------------------\r\n\r\nThird release\r\n\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A Python library for creating GUIs in HTML/CSS like syntax",
"version": "0.0.3",
"split_keywords": [
"sagetk",
"guis",
"html",
"gui",
"tkinter",
"tk"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "eafbfa5ae97029475cfc69cb8e4c7d535a452c0e02f168ca7a72cb75269acb3e",
"md5": "30081d841a5645c4e450c0258d9f5a30",
"sha256": "373a9c583ded1e2e052f040c35942dff4ca55a41341ffe776524bbdf42656f00"
},
"downloads": -1,
"filename": "sagetk-0.0.3.tar.gz",
"has_sig": false,
"md5_digest": "30081d841a5645c4e450c0258d9f5a30",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 13191,
"upload_time": "2023-04-02T16:17:08",
"upload_time_iso_8601": "2023-04-02T16:17:08.379725Z",
"url": "https://files.pythonhosted.org/packages/ea/fb/fa5ae97029475cfc69cb8e4c7d535a452c0e02f168ca7a72cb75269acb3e/sagetk-0.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-02 16:17:08",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "sagetk"
}