Format type

Change format

a = float(b) change to type float

Module String

Replace

importstring
a ='abcde'
b =string.replace(a,'ab','',1)print b

file operation

myfile =open('/srv/www/idehe.com/stock/data.txt','w')
myfile.writelines('\n')
myfile.close()
myfile =open('/srv/www/idehe.com/stock/data.txt','a')# open for output (creates)
myfile.writelines('\n')
myfile.writelines(line1)# write a line of text
myfile.writelines('\n')
myfile.writelines(line2)# write a line of text
myfile.close()