file io - Python giving me long strings in a text document -


In my code, I want to open a text document and print an HTML document. I, "" In this

Example of the text in the text document

  By doing so, it gives me a long sentence with : 0.01358324; BTC: 0.00000000; LTC: 0.00000001; BC: 0.00000000; NMC: 0.00000000; DOGE: 63.71131428; Naut: 0.00017886; DR: 0.00000000; VTC: 0.00013866; FTC: 0.00000000; Treatment: 0.00025881; PPC: 0.00000000; Charity: 0.00000000; GHS: 0.00003646; GHSOCT: 0.00000000; GHSAUG: 0.00000000; Scrypt: 200.09600305  

How do I write or edit the file so that every is "," forces a new line. I currently use this row to write a file named File.

  file.write (response.read () .docode ('utf-8'))  

replace a new line with four.

  file.write (replication.read (.) In place of decode ('utf-8') (",", "\ n")) [72]: line = " Total: 0.0,13,58,324; BTC: 0.0,00,00,000; LTC: 0.00000001; BC: .00000000; NMC: 0.0,00,00,000; DOGE: 63.71131428; NAT : 0.00000086; VTC: 0.00010066; FTC: 0.00000000; cure: 0.00025881; ppc: 0.00000000; GHS: 0.00003646; GHSOC: 0.00000000; GHUUG: 0.00000000; SCRYPT: 200.09600305 "in [73]: print (line.replace (", "," \ N ")) Total: 0.01358324 BTC: 0.00000000 LTC: 0.00000001 BC: .0,00,00,000 NMC: .0,00,00,000 DOGE: 63.7,11,31,428 naut : .00017886 D R: .00000000 VTC: 0.00013866 FTC: 0.00000000 Treatment: 0.00025881 PPC: 0.00000000 Charitable: 0.00000000 GHS: 0.00003646 GHSOCT: 0.00000000 GHSAUG: 0.00000000 scrypt: 200.09600305  

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -