title: How to make connection in python to connect as400 and call any as400 programs with parameter
body: <p>Anyone knows How to make connection in python to connect as400 iseries system and call any as400 programs with parameter.</p>
  
  <p>For example how to create library by connecting as400 through python. I want to call " CRTLIB LIB(TEST) " from python script.</p>
  
  <h1>I am able to connect to DB2 database through pyodbc package.</h1>
  
  <p>Here is my code to connect DB2 database.</p>
  
  <pre><code>import pyodbc
  
  connection = pyodbc.connect(
      driver='{iSeries Access ODBC Driver}',
      system='ip/hostname',
      uid='username',
      pwd='password')
  c1 = connection.cursor()
  
  c1.execute('select * from libname.filename')
  for row in c1:
      print (row)
  </code></pre>