Paula Gauto Software and DevOps Engineer

Python Venv Terminal Alias

Simplify Your Virtual Environment Workflow with Zsh Aliases

Managing virtual environments is an essential part of many development workflows. However, constantly typing out the full command to activate or create a virtual environment can be time-consuming and cumbersome. Thankfully, there’s a solution that can streamline your workflow in the Zsh shell.

By adding a few lines to your .zshrc file, you can create custom aliases that simplify the process. Inspired by a helpful gist found at this link, I have created my own version of these aliases. At the end of your .zshrc, add the following:

alias activate='source .venv/bin/activate || echo "no venv available in current folder"'
alias mkenv='python3 -m venv .venv 2>/dev/null && echo "Virtual environment created." || echo "venv already exists"'
alias rmenv='rm -rf .venv && echo "venv removed." || echo "No venv available in current folder"'

Make sure you restart your terminal before you test it out.

Usage

Command Description Longer Command
mkenv Creates a new virtual environment python3 -m venv .venv
activate Activate your virtual environment source ./.venv/bin/activate
rmenv Removes the virtual environment if it exists. rm -rf .venv

By simplifying the process of working with virtual environments, these aliases can save you valuable time and keystrokes.

Give these aliases a try and experience a more efficient virtual environment workflow in your Zsh shell!

Misc Python Scripts

Introducing Python-Projects: A Collection of Python Snippets

In the quest to expand my coding skills and showcase my expertise, I have created a repository called python-projects on GitHub. This repository houses various small Python snippets that I have worked on over time.

Let’s take a closer look at some of the projects featured in this repository:

Name Description URL
Binary Trees Various binary tree sorting and trimming activities 🔗
Implementing a data structure Write a set of procedures that create and manipulate instances of said structure. 🔗
Pascal Triangle Given an integer numRows, return the first numRows of Pascal’s triangle. 🔗
Two Sum Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. 🔗

Catching Up

Hi there! so long no see?

I’ve been a bit MIA but I’m back, I hope. In my defense, I’ve been busy. Today is a big day because it’s my first day as DevOps engineer at Black Spectacles, and I just could not be more excited!

Either way, I’m hoping to come back and fontinue working on the last days of Dr. Angela Yu’s 100 days of Python Code.

See you around! 👋🏻

Welcome

Hi there! Nice to see you here 🙂

Almost a year ago, I decided it was time to refresh my Python coding skills. After looking at a few options, I went with Angela Yu’s 100 Days of Python Code, and what a great decision that was!

Truth is, I didn’t start it until almost 6 months after purchasing the course 😬 but when I did, I committed to work on it consistently on weekdays and I actually stuck to it! Who would have believed! Fast forward to today, I’m on day 80-something working on the final portfolio projects as time allows.

You can check out my progress in a github repo I created.

# README.md contents ->
for day in 100_days_of_python_code:
    progress.append(day, description, link_to_code)

# Or, if you're a fan of list comprehension -> 
progress = [[day, description, link to code] for day in 100_days_of_python_code]

Making This Site

I’ve wanted to have a personal website for so long now! It’s almost embarrassing that, as a programmer, I haven’t had some sort of website. All summer, I pondered between flexing my Python skills and creating a Flask website or rely on a simpler, quicker version that gets me the desired result without hassle.

Although creating a Flask website is a fantastic idea, it may not be the most time-efficient decision, and boy, it takes time. I even created (and almost finished!) a Flask+Bootstrap site with my own color palette and customized theme. It wasn’t until I almost reached the final stages (ironically, that meant setting up the blog’s database and CSS) that it hit me. Worst of all is that I already had this website up! It just wasn’t being used to its fullest potential.

A non-comprehensive list of reasons why I ended up choosing GitHub Pages:

  • Free hosting service
  • Free domain! your_account_name.github.io
  • CI/CD using Built-In Github Actions marketplace plugins
  • Option to use markdown, HTML, or mix them both in a .md file!
  • Overall quick code-to-deploy turnaround

    Inspiration and acknowledgments

  • Theme: Minimalist, Etch
  • Cool icons from font-awesome