title: Passing a list as variable to python script from bash script
body: <p>I have a python script like below. </p>
  
  <pre><code># Import necessary libraries and functions
  import sys
  import traceback
  
  y = '2020'
  querysting = "select {} from table where Year={}".format(col_list,y)
  df = pd.read_sql(querystring,db)
  
  
  if __name__ == '__main__':
      if len(sys.argv) != 8:
          print('Invalid number of args......')
          print('Usage: file.py Input_path Output_path')
          exit()
      _, col_list, FinalDB, final_table, host, dsl_tbl_name, username, password = tuple(sys.argv)
  
      data_load(col_list, FinalDB, final_table, host, tbl_name, username, password)
  </code></pre>
  
  <p>Now I am calling this python script inside a shell script like below</p>
  
  <pre><code>#!/bin/bash
  
  col_list='id, name, address, phone_number'
  FinalDB='abc'
  final_table='xyz'
  host='xxxxxx.xxxx'
  tbl_name='test'
  username='USER'
  password='test_pass'
  
  
  python python_script.py ${col_list} ${FinalDB} ${final_table} ${host} ${tbl_name} ${username} ${password}
  </code></pre>
  
  <p>Now when I run this bash script I am getting <code>Invalid number of args......</code> error</p>
  
  <p>I am pretty much sure that it is some thing to do with <code>col_list</code> variable being passed to the <code>python</code> script.</p>
  
  <p>Because instead of having columns in a list if I just pass <code>select *</code> in the query and removing <code>col_list</code> variable then I don't get any errors</p>
  
  <p>What am I doing wrong here and how can I resolve this issue.</p>