Skip to content

Instantly share code, notes, and snippets.

View darkato42's full-sized avatar
🏠
Working from home

Yulin Wu darkato42

🏠
Working from home
View GitHub Profile
@MichaelCurrin
MichaelCurrin / setup-python3-virtual-env.md
Last active March 27, 2026 08:07
Set up Python 3 and new virtual environment

Set up Python 3 and new virtual environment

A beginner's guide

This guide covers how to install and upgrade Python 3 and how to create and an install into a Python virtual environment.

This is best practice in Python for both local and production code, as it isolates the scope where your python commands and pip commands run, protecting your global environment and allowing your to manage multiple virtual environments each with their own set of unique Python packages.

"""
The most atomic way to train and run inference for a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp