Posts

PyQtgraph - Graphing with a Ui File

PyQtgraph Graph in Native Window

Dedicating a UI file to store the application layout will make for a more organized process when working with PyQt. The Python code will be cleaner if it focuses on creating the dynamic data that will be inserted into the ui file.

To demonstrate this, create a window.ui file.

<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <class>MainWindow</class>
 <widget class="QMainWindow" name="MainWindow">
  <property name="windowTitle">
   <string>MainWindow</string>
  </property>
  <widget class="QWidget" name="centralwidget">
     <layout class="QVBoxLayout" name="verticalLayout">
     </layout>
  </widget>
 </widget>
</ui>
Categories: #python #shell
Tags: #cli-tools
fzf - Integrate with Jq for JSON Search

Fzf Search JSON Data

JSON is a ubiquitous data format and searching for content in JSON will come up often enough to warrant a real-time search functionality. jq can be used to query json and fzf can be combined with this tool to fulfill our JSON search capabilities.

Start fzf with jq

echo '' | fzf --preview "jq {q} < us-data.json.json"
Categories: #fzf
Tags: #cli-tools
DITA - Structured Documentation with XML

DITA Setup

DITA stands for Darwin Information Typing Architecture, it is an XML specification that prescribes tags for organizing your documentation content. For Dita to be able to generate a well-defined structure, it suggests a rather prescriptive methods of tag use. The intention of Dita is to promote content reuse so that your documentation project will be more manageable as it scales up in size and complexity.

Getting started with Dita begins with having these prerequisites.

  • Java
  • Text editor
  • DITA-OT
Categories: #documentation
Nuitka and PyQtgraph - Bundle a Python Application into a Standalone Binary

PyQtgraph Standalone Application

Nuitka is a Python compiler that supports the conversion of a Python application to compiled code. It enables you to create a single file executable for convenient distribution.

Prerequisites

You will need a C compiler and a Python version specified in the Nuitka README.md.

Installing Nuitka

python3 -m pip install nuitka
Categories: #python #shell
Tags: #cli-tools
Creating an AppImage from a Binary Executable

Make a Portable Desktop Application without the need for Installation

To create a binary which can be run on many Linux machines, an AppImage can be generated. An AppImage wraps around the files needed to run the application and when executed, doesn't require modifications to your operating system as it is self-contained.

Download the appimage tool executable file from here.

Categories: #shell
Tags: #cli-tools
Dearpygui - Menu Bar

With dearpygui, there are two ways to create a menu bar that displays within your main application window. One method of creating a menu bar is to use the "Viewport Menu Bar" which is the traditional menu bar with the fixed horizontal row of menu entries found near the top of your main applications window and the other is the "Menu Bar" which is a floating menu window inside your main application window.

Categories: #python
Tags: #dearpygui