V
V
VVV000xxx2021-12-10 15:00:56
Python
VVV000xxx, 2021-12-10 15:00:56

How to write each result in txt on a new line?

You need to take the result from here:

result = f'{phone} | {seller} | {title} | {description} | {price} | {location} | {district} | {date} | {photo0} | {photo1} | {photo2}'

And write a new line without deleting the previous one.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Karbivnichy, 2021-12-10
@hottabxp

Add a line break to the end of the line. Example:

from datetime import datetime

with open('data.txt','a') as file:
  file.write(str(datetime.now())+'\n')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question