当前位置:网站首页>How to quickly upload files to Google Lab
How to quickly upload files to Google Lab
2022-07-24 17:56:00 【samll-guo】
It is divided into the following steps :
Step#1 Connect to google Cloud disk :
from google.colab import drive
drive.mount('/content/drive',force_remount = True) After successful execution , Will be displayed : Mounted at /content/drive
Step#2 Go to subdirectory My Drive:
import os
root_dir = "/content/drive/My Drive/"
os.chdir(root_dir)confirm :
Show : /content/drive/MyDrive
Step#3 Create subdirectories "Colab_Notebooks" :
!mkdir "Colab_Notebooks"
Step#4 Go to subdirectory :
import os
os.chdir("Colab_Notebooks")Step#5 Then create the next level and directory "Project_folder":
!mkdir "Project_folder"
Step#6 Enter the newly created next level subdirectory :
import os
root_dir = "/content/drive/My Drive/"
project_folder = "Colab_Notebooks/Project_folder/"
os.chdir(root_dir + project_folder)Step#7 Check the current directory :
!pwd Show results :/content/drive/My Drive/Colab_Notebooks/Project_folder
Step#8 Now? , Start file upload :
from google.colab import files
files.upload()
After executing this code , A dialog window for selecting files will be displayed .
I can upload my files : myfunctions.py
I have this file in my local C The plate is ready . After selecting this file , It will be uploaded automatically .
In my myfunctions.py , It has the following contents :
def sum_two(num_1, num_2):
result = num_1 + num_2
return resultStep#9 Now? , I can make function calls across files :
import myfunctions
result = myfunctions.sum_two(100,200)
print (result)Show results : 300
边栏推荐
- Pay close attention! List of the latest agenda of 2022 open atom open source Summit
- C language programming training topics: K characters in left-handed string, little Lele and Euclidean, printing arrow pattern, civil servant interview, poplar matrix
- C language custom types - Enumeration
- Practical application cases of digital Twins - Smart Park
- 0623~ holiday self study
- C language to achieve a static version of the address book
- wallys/IPQ8074A 4x4 2.4G 8x8 5G 802.11ax
- Simple test JS code
- 手写博客平台~第二天
- Interview assault 66: what is the difference between request forwarding and request redirection?
猜你喜欢

快速完成intelij idea的单元测试JUnit4设置

JumpServer的使用

Detailed explanation of ansible automatic operation and maintenance (V) the setting and use of variables in ansible, the use of jinja2 template and the encryption control of ansible

Common methods of number and math classes

Use Matplotlib to simulate linear regression

Dry goods | three sub domain name collection tools worth collecting

es(1)

redis集群的三种方式

二维卷积——torch.nn.conv2d的使用

Scept: consistent and strategy based trajectory prediction for planned scenarios
随机推荐
Inherit, override, overload
C语言编程训练题目:左旋字符串中的k个字符、小乐乐与欧几里得、打印箭型图案、公务员面试、杨树矩阵
邻接表的定义和存储以及有向图无向图的邻接存储
0612~quartz timer frame
Single cell code analysis - gynecological cancer single cell transcriptome and chromatin accessibility analysis 1
ansible自动化运维详解(五)ansible中变量的设定使用、JINJA2模板的使用以及ansible的加密控制
Is header file required? Follow the compilation process~~~
Section 7 Data Dictionary: hash followed by Daewoo redis ------- directory post
Just one dependency to give swagger a new skin, which is simple and cool!
Internship report 1 - face 3D reconstruction method
C语言实现静态版本的通讯录
Preliminary study of Oracle pl/sql
C language custom types - Enumeration
int8 & int8,你栽过这样的跟头吗?
0621~ES&Lucene
Go to bed capacity exchange
T245982 「KDOI-01」醉花阴
JumpServer的使用
es(1)
Trends of semiconductor industry