Path to SD card

from jnius import autoclass  # SDcard Android

# Get path to SD card Android
try:
Environment = autoclass('android.os.Environment')
sdpath = Environment.get_running_app().getExternalStorageDirectory() # Not on Android
except:
sdpath = App.get_running_app().user_data_dir

user_data_dir also works on Android, but it relies on a /sdcard symlink which is becoming outdated. I don't know for IOS or Windows Phone though.

Copy to SD card

import shutil

sdpathfile = os.path.join(sdpath, 'filename')
shutil.copyfile(os.path.join('folder', 'filename2'), sdpathfile)
=====================
FileChooserListView:
id: filechooser
path: "/your/path"
=====================

To find a directory on your system with python, you can do something like this:

import os

for root, dirs, files in os.walk("/"):
for name in dirs:
if name == "DCIM":
print(root, name)

Just be aware that it might find two or more directories named DCIM, on your sdcard and internal storage.

Python Kivy writes / read the file on the SD card的更多相关文章

  1. 执行Python "/bin/usr/python: bad interpreter: No such file or directory" 错误

    今天在电脑上写了一个Python脚本,写好之后用ftp传上去,然后执行/var/www/cron.py,结果报错,/bin/usr/python: bad interpreter: No such f ...

  2. -bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory

    -bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory python多版本造成额问题 找不到p ...

  3. 『Python Kivy』官方乒乓球游戏示例解析

    本篇文章用于对Kivy框架官方所给出的一个「乒乓球」小游戏的源码进行简单地解析.我会尽可能的将方方面面的内容都说清楚.在文章的最下方为官方所给出的这个小游戏的教程以及游戏源码. 由于篇幅所限,本文只简 ...

  4. 孤荷凌寒自学python第三十四天python的文件操作对file类的对象学习

     孤荷凌寒自学python第三十四天python的文件操作对file类的对象学习 (完整学习过程屏幕记录视频地址在文末,手写笔记在文末) 一.close() 当一个file对象执行此方法时,将关闭当前 ...

  5. File存对象--android 的File存储到SD卡();

    方法1:android File存对象--File存储到SD卡(); 1.保存对象到本地或SD卡需要注意的是,要保存的对象(OAuthV1)一定要实现了Serializable接口.实现了Serial ...

  6. 增加 addDataScheme("file") 才能收到SD卡插拔事件的原因分析 -- 浅析android事件过滤策略

    http://blog.csdn.net/silenceburn/article/details/6083375 =========================================== ...

  7. 『Python Kivy』Kivy模板语言KV说明

    语言概念 KV语言允许你以声明的方式创建控件树,以及绑定控件属性到其他的控件或使用一种自然的方式进行回调. 它允许非常快速并灵活的改变你的UI. 它还可以让你的应用程序与应用程序的界面进行分隔. 如何 ...

  8. Python Kivy 安装问题解决

    Fix: Running this was suggested by @matham in #3889 and solves the problem described below:python -m ...

  9. Python“Non-ASCII character 'xe5' in file”报错问题(转)

    今天在编译一个Python程序的时候,一直出现"Non-ASCII character 'xe5' in file"报错问题 SyntaxError: Non-ASCII char ...

随机推荐

  1. navicat for mysql cant connect to server 10038 远程连接出错

    使用的登录账号没有开通远程登录的权限,所以只能在服务器上通过命令行登录. 解决办法如下:1.在服务器上通过命令行或客户端登录mysql:2.执行以下sql:GRANT ALL PRIVILEGES O ...

  2. go关键字之struct定义声明方式

    type Student struct{ name string age int } var stu Student stu.name,stu.age = "张三”,10 stu2 := S ...

  3. 深度解剖session运行原理

    已经大半年没有更新博客了,一方面有比博客更重要的事情要做,另外一方面也没有时间来整理知识,所以希望在接下来的日子里面能够多多的写博客来与大家交流 什么是session session的官方定义是:Se ...

  4. 查看java内存情况命令

    转自:http://boendev.iteye.com/blog/882479 jinfo:可以输出并修改运行时的java 进程的opts. jps:与unix上的ps类似,用来显示本地的java进程 ...

  5. 阿里云申请免费https证书 + IIS服务器安装

    参考: 阿里云免费SSL证书申请与安装使用(IIS7)

  6. Install Local SQL In Mac OS

    extends:http://www.cnblogs.com/maxinliang/p/3583702.html 一.安装 到MySQL官网上http://dev.mysql.com/download ...

  7. 第四天,通过windows来执行第一个python文件步骤

    该看 第 38部分的啦

  8. position inherit 定位

    inherit  继承父元素   定位 举例  : <div class="father"> <p></p> </div> div{ ...

  9. Tensorflow 的saved_model模块学习

    saved_model模块主要用于TensorFlow Serving.TF Serving是一个将训练好的模型部署至生产环境的系统,主要的优点在于可以保持Server端与API不变的情况下,部署新的 ...

  10. grpc,protoc, protoc-gen-go,rust

    Rust 与服务端编程的碎碎念https://zhuanlan.zhihu.com/p/30028047 GRPC:golang使用protobuf https://segmentfault.com/ ...