Just specify where your file is starting from drive.MyDrive
.
For example, if I had a file test_function.py
in the root of my Google Drive with the function square
in it, I can import it by
from drive.MyDrive.test_function import square
Example image of execution and printing of paths:
And yes, you are able to run your Jupyter Notebooks from anywhere in your Google Drive. Just find the file, click on it, and click on "Open with Google Colaboratory" at the top when Google says there is "No preview available".
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…