cnxn = pyodbc.connect("Driver={SQL Server};Server=localhost;Database=reportdb;uid="+v_user+";pwd="+v_pwd)

cursor = cnxn.cursor()
cursor.execute("select * from config where type_id='gh_zhjy'")

users=[]
for row in cursor: 
    users.append(row[3])  

list=[];
filename=file_path;
fp=open(filename,"r",encoding='utf-8');
done=False;
while not done:
   aline=fp.readline();   
   if(aline!=""):
       aline=aline.replace('\n','').replace(" ","");
       if(aline in users):
         list.append('浙江国华浙能发电有限公司:'+aline.replace('\n','')); 
   else:
     done=True;
fp.close();
print(list);

 

相关文章:

  • 2022-12-23
  • 2021-09-05
  • 2022-12-23
  • 2021-12-10
  • 2021-12-10
  • 2021-11-17
  • 2021-11-17
  • 2021-11-17
猜你喜欢
  • 2022-03-08
  • 2022-12-23
  • 2022-03-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-19
相关资源
相似解决方案