Skip to content

Instantly share code, notes, and snippets.

@ssokolow
ssokolow / term_qt.py
Created April 26, 2020 09:04
Example of creating a simple terminal emulator widget from a QTextEdit
"""Primitive terminal emulator example made from a PyQt QTextEdit widget."""
import fcntl, locale, os, pty, struct, sys, termios
import subprocess # nosec
# Quick hack to limit the scope of the PyLint warning disabler
try:
# pylint: disable=no-name-in-module
from PyQt5.QtCore import Qt, QSocketNotifier # type: ignore
from PyQt5.QtGui import QFont, QPalette, QTextCursor # type: ignore
@Axel-Erfurt
Axel-Erfurt / PyEdit2.py
Last active April 9, 2024 02:03
Python Editor (created with PyQt5)
#!/usr/bin/python3
# -- coding: utf-8 --
from __future__ import print_function
from PyQt5.QtWidgets import (QPlainTextEdit, QWidget, QVBoxLayout, QApplication, QFileDialog, QMessageBox, QLabel, QCompleter,
QHBoxLayout, QTextEdit, QToolBar, QComboBox, QAction, QLineEdit, QDialog, QPushButton,
QToolButton, QMenu, QMainWindow, QInputDialog, QColorDialog, QStatusBar, QSystemTrayIcon)
from PyQt5.QtGui import (QIcon, QPainter, QTextFormat, QColor, QTextCursor, QKeySequence, QClipboard, QTextDocument,
QPixmap, QStandardItemModel, QStandardItem, QCursor)
from PyQt5.QtCore import (Qt, QVariant, QRect, QDir, QFile, QFileInfo, QTextStream, QSettings, QTranslator, QLocale,
@sandeep-datta
sandeep-datta / create_img
Last active September 14, 2022 21:32
A python script for creating a linux virtual disk with a ready to use rootfs
#!/usr/bin/python3
import sys
import os
import argparse
from os import path
from pprint import pprint
from tempfile import TemporaryDirectory