ls /usr/bin/python*
sudo apt-get remove python3.5
sudo apt-get remove --auto-remove python3.5
sudo apt-get purge python3.5
import multiprocessing #:) | |
def do_this(number): | |
print number | |
return number*2 | |
# Create a list to iterate over. | |
# (Note: Multiprocessing only accepts one item at a time) | |
some_list = range(0,10) |
""" | |
Usage: | |
Make sure that redis is running on localhost (or adjust the url) | |
Install uvicorn or some other asgi server https://asgi.readthedocs.io/en/latest/implementations.html | |
pip install -u uvicorn | |
Install dependencies |
1WBllCh7h5NjY09cvDby-amOO2FN0HbOA |
# source: https://www.geeksforgeeks.org/difference-between-multithreading-vs-multiprocessing-in-python/ | |
import time, os | |
from threading import Thread, current_thread | |
from multiprocessing import Process, current_process | |
COUNT = 200000000 | |
SLEEP = 10 | |
def io_bound(sec): |
def f(*, a): | |
pass | |
f(1) # raises error | |
f(a=1) # works |
# ======================================================================================== | |
# setup image | |
# ======================================================================================== | |
# download or build image | |
docker build . | |
# ======================================================================================== | |
# setup container | |
# ======================================================================================== |
I wanted to find a different method that didn't require me to read the json file or to have to upload it to root while using Colab. I instead wanted to just store the json in my drive somewhere and let the kaggle cli know where it is.
As it turns out, there's a way to do that, which is set the environment variable KAGGLE_CONFIG_DIR
If you don't have the json file yet, check the docs for how to get that: link Then upload it to your drive. Mine happens to be at /content/drive/My Drive/fastai-v3/.kaggle/kaggle.json. (ayyy shoutout to the FastAI courses 👌 ) Now in colab you can just run:
import random, math | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import matplotlib.patheffects as mpe | |
""" | |
dataset | |
""" |