Collect user logons from Windows 10 with Python 3.

This is basically how I collect physical user logons along with reboots, etc. I dump this shit into a database and deliver via a web-page so folks can do dated searches by workstation or user ID. Works beautifully. You will need the Win32api libraries. I am running this on a Win 2019 server from Python3.7, […]

Get all installed software on Windows 10 with Python 3 and WMI.

This is very basic and I’d lie if I said I hadn’t tried looping through the registry for 64/32 bit, but this works great and isn’t missing entries. I deliver this in a web page making it easy to do look ups on most machines in my org. Tweak as you need, add some error […]

Execute PowerShell from Python

I originally wrote this to execute PowerShell scripts from a Flask web interface. You can now install Powershell on Linux. Crazy, ain’t it?

List or search all installed apps on Ubuntu 18.04 with Python.

I was bored… Of course this can be done easily in the terminal, but what’s the fun in that? This should work on any flavor of Debian/Ubuntu. import os import subprocess as sp ”’ Pipe to file in terminal: $ flatpak list –app –show-details > ~/Documents/installed-flatpack.log $ dpkg –get-selections > ~/Documents/installed-software.log Not using Debian? Here’s […]

Extract CAB files with Python and Patool.

Install 7zip. This assumes you are on Windows. Add the 7zip path to the system path. In the searchbar type env and open the result. Click Environment Variables in the dialog. Add to PATH. Windows 10 just click add and browse to the folder 7zip installed to, i.e., C:\Program Files\7-zip. Otherwise, paste the path making […]

Python3 Gtk3 Thread Example

Quick Python3 Gtk3 app to execute Python scripts to test long running threads in Gtk3 app. Some things could be better, like the python paths collection and displaying the PID, but I was focused on running threads without freezing the GUI and it just kind of happened. Hope it’s useful to someone.

Create mov,mp4 thumbnails from Python3

I was working on a Gtk 3 project to roll up all my iPhone videos into a flowbox for easy locating and processing since iPhone doesn’t name things in a meaningful way and photo managers dump things into not so meaningful folders, thumbnails was a must to locate videos easily. Plus, I wanted to do […]

GTK3 Calendar dialog example in Python.

  #!/usr/bin/python3 import gi gi.require_version(‘Gtk’, ‘3.0’) from gi.repository import Gtk, Gio, GObject GObject.threads_init() class CalDialog(Gtk.Dialog): ”’ Calendar Dialog ”’ def __init__(self, parent): Gtk.Dialog.__init__(self, “Select Date”, parent, 0, (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_OK, Gtk.ResponseType.OK)) self.set_default_size(300, 200) self.value = None box = self.get_content_area() calendar = Gtk.Calendar() calendar.set_detail_height_rows(1) calendar.set_property(“show-details”,True) calendar.set_detail_func(self.cal_entry) box.add(calendar) self.show_all() def cal_entry(self, calendar, year, month, date): #print(year, month, […]