python基本操作

import sets

myString="iaslfj"+"asdfasdf"
guess=True
#laskdfjlasdjflasdkfkljljk;
print (myString+"\n")

if True:
    print('i am true');
    
else:
    print('i am wrong');
    

while guess:
    print("ok");guess=False;
    
while True:
    print("break test")
    break
    
while guess:
    print('OK')
else:
    print (guess)
    
#for

for i in range(1, 5):
    print (i)
else:
    print 'The for loop is over'


#set set,intersection,difference
a=[1,2,3,4]
b=[2,3,5]
c=sets.Set(a).intersection(sets.Set(b))
print c
for i in c:
    print i
 cmd   =   "cat   "   +   file1   +   "   "   +   "file2"   +   ">>/home/test/file3.txt";   
  os.system(cmd); 

  
    

 

 

database:

 

 

 

'''
Created on 2009-12-24

@author: jizhong.yang
'''
import cx_Oracle
import sets

myDsn = cx_Oracle.makedsn('*.*.*.*',1521,'oss32')    
conn = cx_Oracle.connect('name', 'pass', myDsn)
cur = conn.cursor()
cur.execute("select * from fc_lognames where rownum<10 and type='billing' and log_date='20091226'")
r = cur.fetchall()
lognames=[]
for row in r:
	lognames.append(row[3])
for m in lognames:
	print m
print lognames
print "=========================================="	
cur.execute("select  * from LOG_FILENAME@BILL_dongguan.CHINACACHE t where rownum<10 and  t.createtime<=to_date('2009-12-26 23:59:59','yyyy-mm-dd hh24:mi:ss') and t.createtime>=to_date('2009-12-22 00:00:00','yyyy-mm-dd hh24:mi:ss')")
rr = cur.fetchall()	
lognames_normandy=[]	
for row in rr:
	lognames_normandy.append(row[1])
for mm in lognames_normandy:
	print mm

	
cur.close()
conn.close()

 

你可能感兴趣的:(oracle,C++,c,python,C#)