python 类之间的参数传递,急。
#!/usr/bin/python# -*- coding:utf-8 -*-
import os,sys,string
import socket
import cx_Oracle
import re
class myexec_module(object):
def __init__(self,user_name,user_password,dns):
self.user_name=user_name
self.user_password=user_password
self.dns=dns
def conn_db(self):
try:
db=cx_Oracle.connect(self.user_name,self.user_password,self.dns)
return db
except Exception as e:
print e
def get_collect(self,tableid):
db=self.conn_db()
cursor=db.cursor()
logsql=" and b.type_id=100039"
cursor.execute('select b.SERVICE_NAME,b.DBUSER,b.DBPW from dm_if_table a,dm_if_source b where a.source_id=b.source_id and a.table_id=:table_id'+logsql,table_id=tableid)
a=cursor.fetchall()
return a
print a
db.close()
class MYFTP:
def __init__(self):
pass
def download_file(self,message):
mm=myexec_module()
mc=myexec_module().get_collect(tableid)
message=mc
if __name__=='__main__':
job_set=myexec_module('oracle','oracle','orcl')
job_set=MYFTP()
job_set.myexec_module().get_collect(20)
报错,错误如下:AttributeError: MYFTP instance has no attribute 'myexec_module'