Calculating compound interest with Python 3

Compound stonks only go up! I have a growing interest in finance and analytics, so it felt like a great idea to start creating my own set of financial tools with Python. This article will explain how I created a simple but effective script for calculating compound interest with Python. I wrote this in Python 3 (as all new Python projects should be from now onwards), but the library dependencies are very lightweight, making this something that could easily be re-written from Python 2. ...

January 3, 2021 · 3 min · Tom

How to force the Windows 10 20H2 update

Are you still waiting for your Windows 10 computer to receive the 20H2 update? Here is how to force the windows 10 20H2 update. For many, the update may already available the Windows 10 update settings: The 20H2 update when available in the Windows 10 update settings. Microsoft is staggering the over-the-air update as they usually do with new major releases. However if you are tired of hitting ‘check for updates’ in the windows 10 update settings, there is a way to press the issue: ...

January 2, 2021 · 2 min · Tom

How to invoke UAC in a Windows Batch script

Here is my quick and easy way to raise the privilage level of a Windows Batch script; allowing you to run your code at an administrator level. This is not a new question and has been asked many times on StackOverflow forums. The best answer I was able to find was the following from dbenham: https://stackoverflow.com/questions/1894967/how-to-request-administrator-access-inside-a-batch-file/10052222#10052222 That being said there are many ways to skin this cat, so I came up with my own method, all be it derivative. The main difference in the following code is that you will always get a UAC prompt in my variant of the code, even if you are currently running it as an account that is a member of the local administrators group: ...

December 29, 2020 · 2 min · Tom

How To call a bash command with variables in Python

A quick Google of the above only seemed to give me answers for the inverse, calling a python script from a bash shell and handing it variables. At least, the first 3 results showed this and I’m probably not alone when it comes to scrolling down past the StackOverflow articles. So I am had to go it alone and the way that I figured out how to call a bash command with variables in Python (3), is a total hack… But it works. This is commonly referred to as ‘getting the job done’ code. ...

December 28, 2020 · 3 min · Tom

Monitor your public IP address with Python

This is my lean and effective way to monitor your public IP address with Python, specifically Python3. The script – code and GitHub link below – runs on a continuous loop, which I covered in a previous post: here. NOTE: this code is reliant on the dig system command – so this essentially only work on a unix based system. I was running this on a Debian install. import os import subprocess import re import time print("start monitor vpn monitor check") expected_IP: "0.0.0.0" # ENTER YOUR EXPECTED PUBLIC IPv4 ADDRESS HERE current_IP: subprocess.check_output("dig +short myip.opendns.com @resolver1.opendns.com", shell=True) try: while True: if expected_IP in str(current_IP): print("IPs Match - Things are normal") else: print("Current IP: " + str(current_IP) + "\nIP NOT AS EXPECTED!") #Code to complete actions called here time.sleep(60) # Change this timer to reduce/increase time between checks (seconds) except KeyboardInterrupt: print("\nHard Exit Initiated. Goodbye!") https://github.com/Tombo1001/PyIPmonitor ...

December 13, 2020 · 2 min · Tom