One issue with using Google Collab is accessing files in your "Collab Notebooks" directory. The following examples show how to do this.
# Mount the Google Drive (click on the link to get the authorization code)
from google.colab import drive
drive.mount('/GoogleDrive')
Go to this URL in a browser: https://accounts.google.com/o/oauth2/auth?client_id=947318989803-6bn6qk8qdgf4n4g3pfee6491hc0brc4i.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&scope=email%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdocs.test%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.photos.readonly%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fpeopleapi.readonly&response_type=code Enter your authorization code: ·········· Mounted at /GoogleDrive
# Add the 'Colabs Notebooks' directory to the search path for importing
# (this only needs to be done once)
import sys
sys.path.append('/GoogleDrive/My Drive/Colab Notebooks/')
# Import the "linear_fit" function form the file "fiting.py" in the "Collab Notebooks" directory
from fitting import linear_fit
from numpy import *
# Read from the file "input.txt" in the "Colab Notebooks directory"
x, y, yerr = loadtxt('/GoogleDrive/My Drive/Colab Notebooks/input.txt', unpack=True)
# Write to the file "output.txt" in the "Colab Notebooks directory"
savetxt('/GoogleDrive/My Drive/Colab Notebooks/output.txt', x)