鱼C论坛

 找回密码
 立即注册
查看: 400|回复: 1

os.open打开的文件无法pickle.dump

[复制链接]
发表于 2018-8-9 21:48:34 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
刚刚在连续31课的代码时,
开始使用 open(**) 函数打开文件,pickl.dump 存入数据正常,然后突然脑抽 如果改用 os.open打开文件呢,
然后就 jjo( ̄ヘ ̄o#)了,直接上图 QQ截图20180809214444.png

我想问的是  是不是 若是涉及其他模块的函数 来 调用操作文件 只能使用 open() 函数去打开文件, 而不能使用os.open打开文件的返回; 还是说两者其实都可以,只是我不会去转换,我网上找不到多少 open和os.open 的区别,求问各位大神
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2018-8-9 22:29:28 | 显示全部楼层
OS里open说明

open(path, flags, mode=511, *, dir_fd=None)
Open a file for low level IO.  Returns a file descriptor (integer).

If dir_fd is not None, it should be a file descriptor open to a directory,
  and path should be relative; path will then be relative to that directory.
dir_fd may not be implemented on your platform.
  If it is unavailable, using it will raise a NotImplementedError.
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-10-6 06:45

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表