Skip to content

Instantly share code, notes, and snippets.

View Hosuke's full-sized avatar
🐢
I code slowly

Huang Geyang Hosuke

🐢
I code slowly
View GitHub Profile
@Hosuke
Hosuke / venv_explained.sh
Last active May 31, 2019 10:14 — forked from wxiaoguang/venv.sh
python3 virtualenv/venv helper bash script (env init, env bootstrap, pip requirement installation, program exec) with explanation
#!/bin/bash
# Go to the location where your script located wherever your run it,
# and store the path contains the script at DIR.
# ${BASH_SOURCE[0]} is a more precised way to locate compare to $0
# https://stackoverflow.com/questions/35006457/choosing-between-0-and-bash-source
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# Set DIR as the working directory.