Advertisement

Advertisement

Python Kivy Tutorial

Kivy can build applications for desktop and mobile including Android and iOS. The same code base can be used for both desktop and mobile, depending on what hardware devices you are trying to access.

This guide will walk through the basics of installing Kivy, building simple applications, building and packaging them for desktop and Android.

For an example of a complete project, check out my Bitcoin Price Checker example with the Live Stream on YouTube.

Alternatives for desktop application programming with Python are PyQt5, Tkinter, and wxPython. Those packages have a more traditional desktop UI but lack the Android and iOS build capabilities the same way Kivy has. Qt technically supports Android but it is not easy to build with PyQt5.

Expose a Local Port over a Remote VPS with SSH Remote Port Forwarding

There are occassions when you want to expose a local port to the world so it can be accessed publicly on the internet.

For example, if you want to:

  • Share you local development environment publicly
  • Be able to receive webhooks from external services for your local development environment like Stripe webhooks
  • Expose a local database to the internet via a remote server

One option is to log in to your router, typically https://192.169.1.254/ or something similar, and configure port forwarding. That will let you tell the router to take incoming traffic for a specific port and send it your local computer. This can be annoying because you have to undo the change when you are done, which is easy to forget about, and you may not have access to your router with admin privileges at all. You can also run in to port conflicts.

Another option is to use a remote host, like a VPS rented from a service like Digital Ocean to expose your port to the internet. You can do this by using SSH port forwarding (tunneling) to securely forward a port from your local computer to a port on the Digital Ocean VPS. In turn, you can expose that port on the VPS to the internet.

This example is like an exercise in setting up your own ngrok service.

Python Logging Tutorial

This is a simple guide to Python core logging package basics. The Python logging package is very powerful and widely used. For example, Django uses Python's built-in logging package.

For the most in-depth and up-to-date information, always refer to the official Python logging documentation. This guide will walk through a summary of the things I think are most important and useful in my regular work.

STDIN, STDOUT, STDERR, Piping, and Redirecting

Operating systems recognize a couple special file descriptor IDs:

  • STDIN - 0 - Input usally coming in from keyboard.
  • STDOUT - 1 - Output from the application that is meant to consumed by the user, stored in a file, or piped to another application for parsing. Typically goes to terminal.
  • STDERR - 2 - Used for info, debug, and error messages to the user that are not intended to specifically be part of the application output. Typically goes to terminal.

This guide will look at how you can redirect and pipe these streams for better application development and system administration.

Electron with Angular Tutorial

Electron is an amazing framework that lets you create desktop application using JavaScript, HTML, and CSS. It is essentially a web application that is self contained as a desktop application. The Electron API lets you access native system elements like the system tray icons, menus, dialogs, etc.

In this guide, we will look at how to create an Electron application with the Angular framework using TypeScript. We will cover:

  • Building a project from scratch
  • Packaging the desktop application for distribution
  • Using live reloading for development
  • Using Electron APIs for inter-process communication

Recursively Copy, Delete, and Move Directories in Windows

If you need to copy an entire directory to a new destination in Windows, you can use xcopy. This guide will show you how to use xcopy to recursively copy a directory, all of its subdirectories, and include hidden files. We will also look at how to remove a directory with rmdir and move a directory with move.

Set Environment Variables in Windows

In Windows, you sometimes need to modify environment variables. There are environment variables like %APPDATA% and %PROGRAMFILES% which contain useful paths, and others that contain things like your username (%USERNAME%). An important one that you may want to modify is %PATH%. In this guide we will look at how to set, check, update, and unset environment variables using the GUI and the command prompt.

Note that environment variables are case-insentive and that there are system-wide environment variables and user-specific environment variables.

Create a Windows .ico Icon File

When creating icons for Windows applications, sometimes you can't just use a .png file and you must use a special .ico format.

The ICO format is a collection of .png or .bmp images in a special structure. Fortunately, there are readily available tools to help you take a simple .png and convert it to the .ico file. This guide will look at a couple options.

NativeScript Tutorial

NativeScript is an amazing framework that lets you create cross-platform mobile applications for Android and iPhone using TypeScript. Not only does it allow you to use TypeScript, but you can also use Vue.js or Angular frameworks!

In this guide, I will focus on installing the necessary tools to build an Android application using the Angular framework in Windows.

Advertisement

Advertisement