Python在哪里使用路径'/sdcard/file.bin'保存文件

时间:2017-05-14 01:39:39

标签: python-3.x android-7.0-nougat

import pickle 

FILE_PATH='/sdcard/file.bin'
DIC = {'usr':'jxxx@yyy.com',
       'pw':'123456' }

with open(FILE_PATH, 'wb') as handle:
    pickle.dump(DIC, handle)

with open(FILE_PATH, 'rb') as handle:
    b = pickle.loads(handle.read())

print(b)

鉴于上面我在QPython的Android手机上执行的代码,我无法使用文件管理器(文件管理器HD)在我的SD卡上找到file.bin。有人能告诉我文件的绝对路径吗?我的手机正在运行Nougat。

1 个答案:

答案 0 :(得分:0)

我终于发现文件是用storage / emulated / 0编写的!