import os
import getpass
is_colab = 'google.colab' in str(get_ipython()) # for Google Colab
if is_colab: # Colab
from google.colab import drive
drive.mount('/content/drive')
DIR_PREFIX = '/content/drive/MyDrive'
elif os.name ==- 'nt': # Windows
DIR_PREFIX = f'C:/Users/{getpass.getuser()}/Documents'
else: # Mac, Linux
DIR_PREFIX = f'/Users/{getpass.getuser()}/Documents'
|