【发布时间】:2015-02-19 12:39:31
【问题描述】:
我已经在我的 Android 手机中安装了 QPython。 我在 QEdit 中写了一条语句,从下面的路径读取文本文件
/storage/emulated/0/com.hipipal.qpyplus/script3/File1.txt
我使用了下面的语句
fob=open('/storage/emulated/0/com.hipipal.qpyplus/script3/File1.txt','r')
fob.read()
如果我运行该语句,它会抛出错误:
IOError:[Errno 2] No such file or directory: '/storage/emulated/0/com.hipipal.qpyplus/script3/File1.txt'
1|uo_a116@cancro:/ $
以上说法正确吗?
【问题讨论】:
-
该代码对我有用,只需确保您的键盘产生正常的单引号:' ' 而不是' '。