Answers for "how to pull images from android device from usb in python"

0

how to pull images from android device from usb in python

import os
import shutil

#path
path = "'Deze pc'/'HUAWEI Mate 10 lite'/'Interne opslag'"

# List files and directories
# in '/home/User/Documents'
print("Before copying file:")
print(os.listdir(path))

#Source path
source = "C:/Users/Tim/PycharmProjects/project1/testfile.jpg"

# Print file permission
# of the source
perm = os.stat(source).st_mode
print("File Permission mode:", perm, "\n")

# Destination path
destination = "'Deze pc'/'HUAWEI Mate 10 lite'/'Interne opslag'/photos"

# Copy the content of
# source to destination
dest = shutil.copy(source, destination)

# List files and directories
# in "/home / User / Documents"
print("After copying file:")
print(os.listdir(path))

# Print file permission
# of the destination
perm = os.stat(destination).st_mode
print("File Permission mode:", perm)

# Print path of newly
# created file
print("Destination path:", dest)
Posted by: Guest on April-27-2021

Code answers related to "how to pull images from android device from usb in python"

Python Answers by Framework

Browse Popular Code Answers by Language