-3

I am trying to add line while doing a file.write adding a line. I am using

with open('CI.txt', 'a+', encoding='utf8') as file:
    file.write(str('CINV'))

and obtaining this:

[['PO: CRZ229728', 'Invoice #: 2561047778']][['PO: CRZ229728', 'Invoice #: 2561047778']]

I want the below result

['PO: CRZ229728', 'Invoice #: 2561047778']
['PO: CRZ229728', 'Invoice #: 2561047778']
blackgreen
  • 34,072
  • 23
  • 111
  • 129
  • There is no way that writing the string `'CINV'` to the file can produce either the desired result or what you claim it is doing. – tripleee Nov 20 '22 at 12:46

1 Answers1

-1

I think , I figured it out.

See below:

with open('CI.txt', 'a+', encoding='utf8') as file:
      file.write('\n')
      file.write(str('CINV'))