From 0ad87abacb3e221691df86f76a32d6720662e858 Mon Sep 17 00:00:00 2001 From: Eugenio Parodi Date: Fri, 27 Oct 2023 17:51:06 +0100 Subject: [PATCH] Doc Updated --- info/debug.html | 247 ++++++++++++++++++++++++++ info/features/crosscompatible.html | 139 +++++++++++++++ info/features/index.html | 195 ++++++++++++++++++++ info/installing.html | 274 +++++++++++++++++++++++++++++ 4 files changed, 855 insertions(+) create mode 100644 info/debug.html create mode 100644 info/features/crosscompatible.html create mode 100644 info/features/index.html create mode 100644 info/installing.html diff --git a/info/debug.html b/info/debug.html new file mode 100644 index 00000000..b5758894 --- /dev/null +++ b/info/debug.html @@ -0,0 +1,247 @@ + + + + + + + Debug — pyTermTk 0.36.0-a + documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Debug

+
+

Notes and tips about debugging

+
+

Env Variables

+

There are few ENV Variables that can be used to force some debugging features;

+
+

TERMTK_FILE_LOG - Log to a file

+

To force logging to a file (i.e. “session.log”)

+
TERMTK_FILE_LOG=session.log   python3   demo/demo.py
+
+
+
+
+

TERMTK_STACKTRACE - Force stacktrace generation with CTRL+C

+

Use this env variable to force a stacktrace generation to the file defined (i.e. “stacktrace.txt”)

+
TERMTK_STACKTRACE=stacktrace.txt   python3   demo/demo.py
+
+
+
+
+
+

Gui

+
+

Visual Studio Code

+

vsCode debug feature comes out of the box, it only require the default **Python** extension installed

+vsCode debug +
+
+

intellij IDEA

+

I haven’t tried it recently since my vsCode experience is silk smooth but based on the results of the issue 102 I am pretty confident that intellij debug feature should work as well

+
+
+

PyCharm

+

Same for PyCharm, I mean, I tried both those IDEs at least once.

+
+
+
+

Profiling

+
+

VizTracer

+https://github.com/ceccopierangiolieugenio/pyTermTk/assets/8876552/34ff9b77-f01b-45bd-a57e-971c7b68c4a2 +

this tool is able to generate a tracker file that can be viewed using Perfetto (UI)

+
# install cprofilev:
+#     pip3 install viztracer
+viztracer --tracer_entries 10000010 tests/paint.py
+
+# View the results
+# loading the "result.json" in https://ui.perfetto.dev
+# or running
+vizviewer result.json
+
+
+
+
+

cProfile, cProfilev

+
python3 -m cProfile -o profiler.bin tests/test.ui.004.py
+
+# install cprofilev:
+#     pip3 install cprofilev
+cprofilev -f profiler.bin
+# open http://127.0.0.1:4000
+
+
+
+
+

py-spy

+
# install
+pip install py-spy
+
+# run the application
+python3 demo/demo.py
+
+# on another terminal run the py-spy
+sudo env "PATH=$PATH" \
+    py-spy top \
+    --pid  $(ps -A -o pid,cmd | grep demo.py | grep -v grep | sed 's,python.*,,')
+
+
+
+
+

pyroscope

+

pyroscope can be used as well (I guess) for profiling

+
+
+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/info/features/crosscompatible.html b/info/features/crosscompatible.html new file mode 100644 index 00000000..5ace567a --- /dev/null +++ b/info/features/crosscompatible.html @@ -0,0 +1,139 @@ + + + + + + + Cross Compatibility — pyTermTk 0.36.0-a + documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Cross Compatibility

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/info/features/index.html b/info/features/index.html new file mode 100644 index 00000000..e41e7c47 --- /dev/null +++ b/info/features/index.html @@ -0,0 +1,195 @@ + + + + + + + Features — pyTermTk 0.36.0-a + documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Features

+
+

Main features

+
+

Self Contained

+
+
+
pyTermTk_ does not require external libraries (i.e. curses)
+
It can be installed through PyPi or simply copy the TermTk folder inside the root path of any project
+
+
+
+
+

Wide variety of built in base widgets

+
+
+

Specialised widgets

+
+
+

Cross Compatibility/Exporters

+
+
+
+

Alpha Features

+
+

Those are the feature/poc that are not being extensively tested and can be prone to unexpected behaviour. +Their APIs may change before the final release to address bugs or improving the overall design implementation.

+
+
+

Text Editor

+
+
+

Terminal Emulator

+
+
+

Terminal Multiplexer

+
+
+

ttkDesigner

+
+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/info/installing.html b/info/installing.html new file mode 100644 index 00000000..94b37d8f --- /dev/null +++ b/info/installing.html @@ -0,0 +1,274 @@ + + + + + + + Installation — pyTermTk 0.36.0-a + documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Installation

+

pyTermTk is a self contained library, +it does not require extra libraries to be used +and can be installed through PyPi +or just copying the TermTk Folder in the root folder of your project.

+
+

PyPi

+

It is possible to install pyTermTk with PyPi also inside a venv environment

+
+

User Install

+
# User/Global Install
+pip3 install --upgrade pyTermTk
+
+
+
+
+

Venv Install

+
# Create a venv environment in the ".venv" folder
+python3 -m venv .venv
+. .venv/bin/activate
+
+# Install inside the venv environment
+pip3 install --upgrade pyTermTk
+
+# ... Do you Stuff
+
+# Clear/Erase/GetRidOf the venv
+rm -rf .venv
+
+
+
+
+
+

Copy TermTk folder

+
git clone https://github.com/ceccopierangiolieugenio/pyTermTk.git
+cp -a pyTermTk/TermTk  <DEST_FOLDER>
+
+
+
+
+
+

Quickstart

+

There are a number of demo apps and examples that can be executed in the repository

+
+

Demos

+

Inside the demo +and demo/showcase +folders there are a number of examples that can be executed out of the box.

+
+

Prerequisites

+

Clone or Download the pyTermTk repo:

+
# Clone and enter the folder
+git clone https://github.com/ceccopierangiolieugenio/pyTermTk.git
+cd pyTermTk
+
+
+
+
+

Demos

+ +
# Run the main demo
+python3 demo/demo.py
+
+# Run the paint demo
+python3 demo/paint.py
+
+# Run the ttkode demo
+python3 demo/ttkode.py
+
+
+
+
+

Showcase

+

Highlight:

+ +
# Demo - Text Editor
+python3 demo/showcase/textedit.py
+# Demo - Animation
+python3 demo/showcase/animation.01.py
+# Demo - color picker
+python3 demo/showcase/colorpicker.py
+# Demo - file picker
+python3 demo/showcase/filepicker.py
+# Demo - drag & drop
+python3 demo/showcase/dragndrop.py
+# Demo - d&d with tabs
+python3 demo/showcase/dndtabs.py
+# Demo - d&d with list
+python3 demo/showcase/list.py
+# Demo - base widgets
+python3 demo/showcase/formwidgets02.py
+# Demo - messagebox
+python3 demo/showcase/messagebox.py
+# Demo - splitter
+python3 demo/showcase/splitter.py
+# Demo - Windows
+python3 demo/showcase/windowsflags.py
+# Demo - Tooltip
+python3 tests/test.ui.026.toolTip.py
+
+
+
+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file