title: how to use variable as placeholder in python
body: <p>i need help with variables in python, where they will be taken during run time, if i give the actual table name in the select query it works but when i am trying variable it fails.</p>
  
  <pre><code>import cx_Oracle
  import csv
  import sys
  tablename = sys.argv[1] # pasing it as input at runtime
  host = 'server.com'
  port = 7111
  SERVICE_NAME = 'gtpts'
  login = 'USER'
  passwrd = 'password'
  SID = 'server.com'
  dsn = cx_Oracle.makedsn(host, port, SID).replace('SID','SERVICE_NAME')
  con = cx_Oracle.connect(login, passwrd, dsn)
  
  cur = con.cursor()
  
  cur.execute('select * from table') # direct table name works but variable doesnot
  row = cur.fetchall()
  </code></pre>
  
  <p>Getting error as below:</p>
  
  <pre><code>[20020663]:20020663&gt; python oracleconnect.py employee
  Traceback (most recent call last):
    File "oracleconnect.py", line 16, in &lt;module&gt;
      cur.execute('select * from tablename')
  cx_Oracle.DatabaseError: ORA-00911: invalid character
  </code></pre>
  
  <p>I could do the same by using $variable in perl do we have anything in python for same.</p>