在 jupyter notebook 中使用未上传的文件

匿名的

是否可以在 jupyter notebook 中使用未上传的文件(例如图像),或者是否有将文件上传到 jupyter notebook 的脚本?我做了一些研究,但没有找到任何东西。

Mader n 推子

当然!就像一个普通的python脚本。假设您要打开一个名为“file.txt”的文件并读取其内容。

with open("the/path/of/file.txt", "r") as file:
    text = file.read()

现在使用名为 picture.jpg 的 cv2 的图像

image = cv2.imread("the/path/of/the/image/picture.png)

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章