Günlük

Python - String Operations Düzenle


07 Ocak 2016 10:26 tarihinde Mehmet Özgür Bayhan tarafından yazılmıştır.


Fastest way to construct a string :

text = "%d,C100,%s,,%s,V101,%s,0,1,#" % (self.message_counter, str(self.device_id), time_str, data_list[5]))

 

Rounding a float:

'%.5f' % .12345678

 


Yorum Yazın:


Arama

Arşivler

"Even a man who is pure in heart, and says his prayers by night, may become a wolf when the wolfbane blooms, and the autumn moon is bright."

Listen Me!