R
R
Ruslan Mordovanech2021-12-17 15:17:54
Python
Ruslan Mordovanech, 2021-12-17 15:17:54

What type of file should be used so that three scripts read and append the file at the same time?

with open("filename", "r+") as f:
    text = f.read()
    f.write("stuff to append")

The idea is that one script writes information to the file for the request, the second script reads this information, checks against the list and when there is a match and adds to the request, answer and then the third script at the end of the day sends the answer to the person who sent the request the answer and so on for several users. What type of file is suitable for permanent text appending?
All these processes take place at different times.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Shumov, 2021-12-17
@Hery1

No. Files are not suitable for this, a database is needed

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question