Skip to content

Instantly share code, notes, and snippets.

@sizhky
sizhky / colab_important_snipplets.py
Created September 19, 2020 12:11 — forked from adityajn105/colab_important_snipplets.py
Google Colab important code snipplets
### Download a file to Local System from Colab
from google.colab import files
with open('example.txt', 'w') as f:
f.write('some content')
files.download('example.txt')
#======================================================================================================
#upload file to Colab from Local System
from google.colab import files
uploaded = files.upload()
@sizhky
sizhky / .gitignore
Created November 10, 2022 09:47
Python's gitignore
# Data
*.csv
*.png
*.jpg
*.jpeg
*.pdf
*.json
# Byte-compiled / optimized / DLL files
__pycache__/
@sizhky
sizhky / conda_utils.sh
Last active January 8, 2024 08:48
utilities for conda environments
create_conda_env() {
# Check if the environment name and Python version are provided as arguments
if [ $# -lt 2 ]; then
echo "Please provide the conda environment name and Python version as arguments."
return 1
fi
# Create conda environment with the specified Python version
conda create -n "$1" "$2"