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. Vivado Design Suite用户指南之约束的使用第一部分(介绍部分)

    首先来看目录部分: 首先是介绍部分:这部分讲述的是Migrating From UCF Constraints to XDC Constraints(从UCF约束迁移到XDC约束)和About XDC ...

  2. iOS企业版打包 发布在线安装包 plist

    本文转载至 http://blog.csdn.net/u011452278/article/details/49511385 原文转载:http://blog.csdn.net/pang040328/ ...

  3. 移动端click事件

    var tap = "ontouchstart" in document.documentElement ? "touchend" : "click& ...

  4. Consul的应用

    Consul在集群上的每一个节点(包括Server和Client)都运行一个Agent,通过这个Agent可以进行对Consul所提供的功能的操作,通过调用一系列HTTP API与Agent的交互即可 ...

  5. WinDbg 之 SOS扩展命令

    SOS.dll (SOS debugging extension) The SOS Debugging Extension (SOS.dll) helps you debug managed prog ...

  6. 作业二 分布式版本控制系统Git的安装与使用

    第一步:Git bash配置 修改用户名和邮箱地址: $ git config --global user.name "zzj" $ git config --global use ...

  7. [本体论][UML][统一建模语言][软件建模][OWL]从本体论到UML到OWL

    以下内容,是关于软件建模的方法与思路. UML与OWL都是基于本体论的建模语言. 本体论(哲学) 本体论(信息科学) UML(统一建模语言) more info 参考:[设计语言][统一建模语言][软 ...

  8. 【实战】Docker入门实践二:Docker服务基本操作 和 测试Hello World

    操作环境 操作系统:CentOS7.2 内存:1GB CPU:2核 Docker服务常用命令 docker服务操作命令如下 service docker start #启动服务 service doc ...

  9. LeetCode 1013 Partition Array Into Three Parts With Equal Sum 解题报告

    题目要求 Given an array A of integers, return true if and only if we can partition the array into three  ...

  10. typescript interface 泛型

    interface interface Obj { [index: string]: any; } class Person { name: string; } let obj: obj = { na ...