Google Colab Notebook 的外部文件引用配置
Google Colab Notebook 的外部文件引用配置
Reference: How to upload the file and read Google Colab
先装工具:
google-drive-ocamlfuse!apt-get install -y -qq software-properties-common python-software-properties module-init-tools
!add-apt-repository -y ppa:alessandro-strada/ppa 2>&1 > /dev/null
!apt-get update -qq 2>&1 > /dev/null
!apt-get -y install -qq google-drive-ocamlfuse fuse
from google.colab import auth
auth.authenticate_user()
from oauth2client.client import GoogleCredentials
creds = GoogleCredentials.get_application_default()
import getpass
!google-drive-ocamlfuse -headless -id={creds.client_id} -secret={creds.client_secret} < /dev/null 2>&1 | grep URL
vcode = getpass.getpass()
!echo {vcode} | google-drive-ocamlfuse -headless -id={creds.client_id} -secret={creds.client_secret}去网页确认一下:
confirm the authentication of this access. Follow the order saying open the link, and you will visit some blue-ish page displaying your key. *
再挂载
!mkdir drive
!google-drive-ocamlfuse drive
!ls drive/"Colab Notebooks"
就可以了。
Google Colab Notebook 的外部文件引用配置的更多相关文章
- 关于<appSettings file="app.config" >引用外部文件的配置值
web.config文件中,appSetting节点引用了外部的配置文件, <appSettings file="app.config"> </appSettin ...
- 有用的javascript外部文件或其他外部文件引用
1.<link href='http://fonts.googleapis.com/css?family=PT+Sans+Narrow' rel='stylesheet' type='text/ ...
- sass实战演练01 - 外部文件引用和变量
SASS是什么? 目前前端开发中css已经是公认的”前端程序员必须掌握”的知识,最早的css编写都是手工一条条写出来的,工作量大.不利于维护. 而sass的存在使得css开发可以像写代码一样最终生成一 ...
- Spring(二)--FactoryBean、bean的后置处理器、数据库连接池、引用外部文件、使用注解配置bean等
实验1:配置通过静态工厂方法创建的bean [通过静态方法提供实例对象,工厂类本身不需要实例化!] 1.创建静态工厂类 public class StaticFactory { private st ...
- 在Google Colab中导入一个本地模块或.py文件
模块与单个.py文件的区别,模块中含有__init__.py文件,其中函数调用使用的是相对路径,如果使用导入.py文件的方法在Google Colab中导入模块 会报错:Attempted relat ...
- Spring 后置处理器 PropertyPlaceholderConfigurer 类(引用外部文件)
一.PropertyPlaceholderConfigurer类的作用 PropertyPlaceholderConfigurer 是 BeanFactory 后置处理器的实现,也是 BeanFact ...
- 解决HTML加载时,外部js文件引用较多,影响页面打开速度问题
解决HTML加载时,外部js文件引用较多,影响页面打开速度问题 通常HTML文件在浏览器中加载时,浏览器都会按照<script>元素在页面中出现的先后顺序,对它们依次加载,一旦加载的j ...
- 类库文件引用web服务报错解决方法-在 ServiceModel 客户端配置部分中,找不到引用协定的默认终结点元素
由于需求,需要改造原有应用,因原有应用是写在console下面的,现在需要开放至web下, 想到BIZ层应用代码都是一样的,又不想在web下在添加引用,而重复写代码,故将原有的console下的服务和 ...
- 我也可以独立(引用JS外部文件)
我也可以独立(引用JS外部文件) 通过前面知识学习,我们知道使用<script>标签在HTML文件中添加JavaScript代码,如图: JavaScript代码只能写在HTML文件中吗? ...
随机推荐
- Convert BST to Greater Tree
Given a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original B ...
- layui布局器网站工具
http://layuiout.magicalcoder.com/magicaldrag-admin/drag
- SQL配置的坑
我要被自己蠢哭了,新做了一台电脑装SQL sever为了存数据,配置完,突然间发现MSSQLSEVER 不能重新启动,相当于之前的配置,还IP都白弄了.我找原因找了3个小时,后来发现是手欠启动的不该启 ...
- java正则表达式appendReplacement和appendTail方法
appendReplacement是java中替换相应字符串的一个方法 appendReplacement(StringBuffer sb,String replacement) 将当前匹配子串替换为 ...
- C++11 类型后置语法
#include <iostream> #include <typeinfo> #include <type_traits> using namespace std ...
- 使用selenium爬取网站动态数据
处理页面动态加载的爬取 selenium selenium是python的一个第三方库,可以实现让浏览器完成自动化的操作,比如说点击按钮拖动滚轮等 环境搭建: 安装:pip install selen ...
- 《Linux内核原理与分析》第八周作业
课本:第七章 可执行程序工作原理 ELF目标文件格式 目标文件:编译器生成的文件. 目标文件的格式:out格式.COFF格式.PE(windows)格式.ELF(Linux)格式. ELF(Execu ...
- redux进一步优化
1. 将原来的 mapStateToDispatch 中的函数提取出来,放在组件中, 如原来的: function mapStateToProps(state, ownProps) { retur ...
- 解决Visual Studio禁止使用strlen函数的问题
问题描述: 在学习C++的复制构造函数以及复制赋值运算符的重载时,需要用到使用C风格的字符串作为引入,由于我用的是VS2015(社区版),在编译时出错.编译器提醒strcpy函数是不安全的,建议改用s ...
- python print format
python print format %o —— oct 八进制 %d —— dec 十进制 %x —— hex 十六进制 1 >>> print('%o' % 20) 2 24 ...