https://www.gravatar.com/avatar/206912d6900c65386f24516df605c206?s=240&d=mp

Kourtney's Space

Pyenv Notes

Functions and Reasons for Using pyenv

pyenv is a tool used to install various versions of Python on a system,

and to conveniently switch between Python versions.

When you need to develop or maintain projects that require different Python versions simultaneously,

you will need to use pyenv to help switch Python versions.

New Python versions usually include syntax updates or new features.

For example, Python’s async / await feature appeared only in Python 3.5 and later.

Python Coroutine Asyncio

Before the advent of asyncio,
when a Python program had many tasks that needed to be executed concurrently,
and wanted to improve program performance,
the only options were multiprocessing or threading.
After Python 3.4, asyncio became another option.
asyncio can be used to write coroutines,
and execute coroutines concurrently using an event loop,
reducing unnecessary waiting time in the program to improve performance.

Pipenv Notes

Why Pipenv

When maintaining many Python projects,
different projects might use different versions of the same Python libraries.
Not using a virtual environment and installing all Python modules directly on your machine will lead to version conflicts.

In the past, the mechanism of virtualenv + requirements.txt allowed different projects to use different versions of the same package,
and also enabled new developers or production environments to quickly install the packages required by the project.

Stateless HTTP, Stateful Session and Cookies

Stateless HTTP

HTTP is a stateless protocol,
meaning that each request/response is independent,
and is unrelated to previous or subsequent requests/responses.
The same request will always receive the same response,
and will not differ based on the content of previous requests/responses.

This allows the server to save a large amount of database and server storage space because it doesn’t need to store user information.
It also speeds up response times and saves considerable network bandwidth because the client doesn’t always have to connect to the same socket.

WSL 2 on Windows Part 2 - Terminal Interface Settings

/images/wsl2_terminal_screenshot.png

Bringing the terminal settings from Linux and Mac to Windows for easier operation.

Windows Terminal Features

With Windows Terminal, you can:

  • Enable multiple tabs (quickly switch between multiple Linux CLIs, Windows CLIs, PowerShell, etc.)
  • Customize key bindings (shortcuts for opening/closing tabs, copy/paste, etc.)
  • Use search functionality
  • Customize themes

These features offer much more than native WSL support, and allow for a setup similar to my Linux or Mac development environments, which is why I decided to use Windows Terminal.

WSL 2 on Windows Part 1 - Installation and Activation

I’m used to using Linux or Mac terminals for work.
I took some time to set up the WSL environment on my home PC to easily switch work environments.

Differences between WSL 2 and WSL 1

WSL 2 is based on Hyper-V and runs a full Linux kernel in a virtual machine.
WSL 1 is a simulation of Linux functionalities on the Windows system.
Therefore, WSL 2 supports more native Linux features and system calls than WSL 1.