Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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, "
")

# 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)
Comment

PREVIOUS NEXT
Code Example
Python :: Get the first item from an iterable that matches a condition 
Python :: how to show Screen keyboard ubuntu with python 
Python :: resizing windows with background tkinter 
Python :: create matrice 2d whit 3colum panda 
Python :: dividing counter object in python 
Python :: registration url 
Python :: identify color sequence with OpenCV 
Python :: ex: for stopping the while loop after 5 minute in python 
Python :: Math expressions with matplotlib 
Python :: how to download multiple googel images using python 
Python :: factors of a number with memoization 
Python :: python create local list 
Python :: break up word in clomun pandas 
Python :: he escape() function is used to convert the <, &, and characters to the corresponding entity references: 
Python :: python intitialize a 2d matrix 
Python :: java to python conversion 
Python :: MEMORY MANAGEMENT SYSTEM IN PYTHON 
Python :: matplotlib librosa show spectrogram 
Python :: spevify datatype of column 
Python :: check substring frequency in a text python 
Python :: draw line in markdown 
Python :: using django model translation with django rest 
Python :: programação funcional python - append 
Python :: dynamically created queryset for PrimaryKeyRelatedField in drf 
Python :: long press selenium python 
Python :: Check for strings as positive/negative - integer/float 
Python :: def identity_block(X, f, filters, training=True, initializer=random_uniform): 
Python :: python enumerate in list comprehension with if statement 
Python :: Dist/Hist Plot Code in Seaborn 
Python :: importing modules in kv lang 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =