Framework for console GUI apps
Project description
Framework for console GUI apps
Установка
Установить через pip:
pip install FloriaConsoleGUI --upgrade
Или скачать исходный код из PyPi
Использование
Рекомендуется писать код только в самом python
Пример обычного использования:
main.py:
from random import random as rdf
from FloriaConsoleGUI import *
from FloriaConsoleGUI.Graphic.Widgets import *
from FloriaConsoleGUI.Graphic.Windows import *
from FloriaConsoleGUI.Managers import *
@Core.init_all_event.dec
def init():
WindowManager.openNewWindow(
TitledWindow(
size=(20, 10),
frame=True,
title=' Example ',
widgets=[
Label(
text='hello world!',
name='label'
)
]
)
)
@Core.SimulationThread.sim_event.dec
def simulation():
label: Label = Widget.getByName('label')
if label is not None:
label.text = f'{rdf():.4f}'
if __name__ == '__main__':
Core.init()
Core.start()
Core.term()
Однако, для удобства есть динамическое обновление:
- .json - для древа
- .py - для скриптов (не рекомендуется из-за специфики реализации)
Не обязательно использовать сразу оба
Пример с динамическим обновлением:
main.py:
from FloriaConsoleGUI import *
from FloriaConsoleGUI.Managers import Parser
@Core.init_all_event.dec
def init():
Core.addDynamicModule('dyn.py', 'dyn')
Parser.setFile('./dyn.json')
@Core.SimulationThread.sim_event.dec
def simulation():
Core.checkDynamicModules()
Parser.checkUpdate()
if __name__ == '__main__':
Core.init()
Core.start()
Core.term()
dyn.py:
from random import random as rdf
from FloriaConsoleGUI import *
from FloriaConsoleGUI.Graphic.Widgets import *
@Core.SimulationThread.sim_event.dec
def simulation():
label: Label = Widget.getByName('label')
if label is not None:
label.text = f'{rdf():.4f}'
dyn.json:
[
{
"class": "TitledWindow",
"size": [20, 10],
"frame": true,
"title": " Example ",
"widgets": [
{
"class": "Label",
"name": "label",
"text": "hello world!"
}
]
}
]
Результат:
Документация
На данный момент документация разрабатывается...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file FloriaConsoleGUI-1.1.2.tar.gz.
File metadata
- Download URL: FloriaConsoleGUI-1.1.2.tar.gz
- Upload date:
- Size: 32.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2971f8775a290f98d709163f4ca61fa3304b734a9ea98479af44345166b127b9
|
|
| MD5 |
c0bb2ac6dbf22b16094c940a33e63f35
|
|
| BLAKE2b-256 |
73911d207d435d6b7cc5a947af962454bc1f820e7717b1827eb0269f955549cf
|
File details
Details for the file FloriaConsoleGUI-1.1.2-py3-none-any.whl.
File metadata
- Download URL: FloriaConsoleGUI-1.1.2-py3-none-any.whl
- Upload date:
- Size: 49.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99be9ad29605e5df80ee765f5eaf5ecfbfaf1b76ab6ae92178a636d9d11b1f39
|
|
| MD5 |
299f80eea38d89df0eaca9ee1f1e3615
|
|
| BLAKE2b-256 |
02fa6934599865fb52d401e8035c1f5484988efde3ee3660c784651ffd143801
|