Categories
python

Python: Print all modules and packages available on the python path

When working with python a ImportError or ModuleNotFoundError: No module named 'xxx' may arise. This error usually means that the script or python file you are running does not know about a module you are importing. How can we get a list of modules that are accessible? Using Sys Modules This gets all package modules […]

Categories
python

A review of ____ Python Books

I like python. It is a great programming language with great conventions and a great community. It has been a close ally and friend over the years. There are many books out there that teach python or cover topics within python. Many of them are titled "____ Python" or "XXXX Python" or "Your word Here […]

Categories
aws python

How to View AWS Lambda Event Data?

Wondering how to actually view the event data your lamba function received? With python. In this post a solution is proposed. Other search phrases: View aws lambda event data aws lambda view event data Viewing AWS Lambda Event Data Create a new lambda with the permissions and trigger you need and call it test-debug-<myproblem> I […]

Categories
python ubuntu

Initial Setup of a Ubuntu 20.04 VM with Compiled Python 3.10

Assuming you have logged in as root with a password Creating a non-root User adduser ubuntu usermod -aG sudo ubuntu Add your SSH key to the new User ssh-copy-id ubuntu@ ssh ubuntu@ Enabling Firewall sudo ufw app list sudo ufw status Disable root login and password based login sudo vim /etc/ssh/sshd_config Uncomment and set: PasswordAuthentication […]

Categories
python ubuntu

Installing python3.9 on ubuntu 20.04 from source

I’ve found installing python from source on ubuntu just makes your life easier. Python depends on a few system binaries and linked libraries so you need to ensure they are present first. sudo apt install software-properties-common build-essential \ libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev \ tk-dev libgdbm-dev libc6-dev libbz2-dev libncurses-dev libgdbm-dev \ libpcap-dev libexpat1-dev libffi-dev liblzma-dev libgdbm-compat-dev […]