S
S
Stepan2014-01-15 02:21:57
Python
Stepan, 2014-01-15 02:21:57

Why does writing to a file not work when the script runs for a long time?

There is some iterator function:

inc(last):
  with open(last,"r+") as fil:
    i = int(fil.readline())
    fil.seek(0)
    fil.write(str(i+1))
    fil.truncate()
    fil.flush()
    fil.close()
    print i

The problem is that after a long run of the script, this function is not executed due to the inability to open the file. How to overcome it? And with what it can be connected?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
ShamblerR, 2015-02-20
@ShamblerR

1. redirects must come before the CNC
2. https://donatstudios.com/RewriteRule_Generator

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question