how can i call mutiple files(bash files) from subprocess.call in python
Question: #i am trying to run all the bash scripts in plugin folder

    
    
    import sys,os,subprocess
        folder_path=os.listdir(os.path.join(os.path.dirname(__file__),'plugins'))
        sys.path.append(os.path.join(os.path.dirname(__file__),'plugins'))
    
        for file in folder_path:
            if file == '~':
               continue
    
            elif file.split('.')[1]=="sh":
              print file
             subprocess.call(['./plugins/${file} what'],shell=True,executable='/bin/bash')
    
        it shows error:
        bash: /bin/bash: ./plugins/: Is a directory
    


Answer: You'll need to actually insert the `file` variable into the subprocess call
string:

    
    
    subprocess.call(['./plugins/%s what' % file],shell=True,executable='/bin/bash')
    

