Removing images mentioned in a list
<p>I am trying to construct a path for each image defined in images list and remove it if it exists,currently am hardcoding path for each image mentioned in imagelist below..is there an easier way to implement this?</p>

<pre><code>import os
import subprocess
from subprocess import check_call,Popen, PIPE

def main ():
    images=['test1.img','test2.img','test3.img']
    ROOT="/local/mnt/workspace"
    target="wc3123"
    #Construct ROOT + "/out/target/product/" + target + "/test1.img 
    #for each image mentioned in imageslist remove if it exist"
    test1= ROOT + "out/target/product/" + target + "test1.ming"
    check_call("rm -rf %s" %test1,shell=True)

if __name__ == '__main__':
    main()
</code></pre>
