I'm looking for simplification/encapsulation so my existing programs that use (sic) open("my_file.txt") can be ported to colaboratory with the minimum change in the existing logic flow. Happy to have some cut/paste logic before my existing logic.
The mental model I understand from google (here) is that I have to do these prerequisites to get my file loaded.
- upload to google drive
- download to python (vm, probably in /tmp)
And then I can execute my existing code w/o change.
Therefore the I suspect/propose that what works for me (but not just me!) would be an interface/function as follows:
- inputs (from local computer)
- source_file_dir
- source_file_name
- (of course authentication inputs are implicitly required)
- output
- python_vm_file_dir (dir I can use in my program; /tmp is fine)
- (implicitly I expect the same dest_file_name)
With this code snippet, I code easily move code into colaboratory.
Has anyone already created this?
Thank you.