| Reply | « Previous Thread | Next Thread » |
|
I have this script:
Code:
import cx_Oracle
connection = cx_Oracle.connect("USER","PASS","ALIAS")
cursql = connection.cursor()
cursql.execute("select SQL_TEXT,ERROR_MSG from user_resumable")
for column_1,column_2 in cursql.fetchall():
print "Statement:", column_1," Errore: ", column_2
cursql.close()
connection.close()
python test_connect.py name pass db I know there is optparse. But I don't know how to use it. I try with: Code:
from optparse import OptionParser
parser = OptionParser()
parser.add_option('-n',"--nome",action="store")
parser.add_option('-p',"--password",action="store")
parser.add_option('-a',"--alias",action="store")
(options, args) = parser.parse_args()
how can I pass the arguments to the fuction: connection = cx_Oracle.connect("USER","PASS","ALIAS") |
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
gaba88
Offline
Forum Nokia Champion
|
|
never used optparse but i guess that you are simply uploading something why dont you try the code from this article.
Enjoy Pythoning Gaba88 Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60 |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |