python - Why are commands executed via subprocess.call( ) different than commands executed via terminal? -
this question has answer here:
i'm running raspbian on raspberry pi 2 , wrote simple python script copy .png
files home directory (~/
) predetermined usb drive.
the command run in terminal works:
cp -r *.png /media/kingston/
in python have following:
from subprocess import call # code call(['cp', '-r', '*.png', '/media/kingston/'])
but when run script says
cp: cannot stat `*.png' : no such file or directory
i'm in right directory when try copy it. pwd
gives correct results , ls
shows correct .png
files.
Comments
Post a Comment