how to pull images from android device from usb in python

Solutions on MaxInterview for how to pull images from android device from usb in python by the best coders in the world

showing results for - "how to pull images from android device from usb in python"
Claudio
30 Aug 2016
1import os
2import shutil
3
4#path
5path = "'Deze pc'/'HUAWEI Mate 10 lite'/'Interne opslag'"
6
7# List files and directories
8# in '/home/User/Documents'
9print("Before copying file:")
10print(os.listdir(path))
11
12#Source path
13source = "C:/Users/Tim/PycharmProjects/project1/testfile.jpg"
14
15# Print file permission
16# of the source
17perm = os.stat(source).st_mode
18print("File Permission mode:", perm, "\n")
19
20# Destination path
21destination = "'Deze pc'/'HUAWEI Mate 10 lite'/'Interne opslag'/photos"
22
23# Copy the content of
24# source to destination
25dest = shutil.copy(source, destination)
26
27# List files and directories
28# in "/home / User / Documents"
29print("After copying file:")
30print(os.listdir(path))
31
32# Print file permission
33# of the destination
34perm = os.stat(destination).st_mode
35print("File Permission mode:", perm)
36
37# Print path of newly
38# created file
39print("Destination path:", dest)
40
similar questions