python - Why are commands executed via subprocess.call( ) different than commands executed via terminal? -


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

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -