Ask coding questions

← Back to all posts
Problems when writing files
miracle173 (4)

I do some calculations that took rather long ( I alternately write files named statefile1.txt and statefile2.txt- But when I want to view the content of the file and open it by a mouse click, the files are empty.
The purpose of these files is to save the status of the calculation periodically. If the program is interrupted I can start it again and force it to read this state files and the calculation can be continued at the point of the last state saved in the file. This kind of continuation of my program works fine when I run my program on my notebook, but seldom works when I rerun my program at "". Unfortunately it happens often that my is disconnected and I want to recover my program execution from this state files. But most of the time this does not work on

Answered by JustARatherRidi (214) [earned 5 cycles]
View Answer
JustARatherRidi (214)

Not sure what your expected output is, but you should know that writing to files on is a bit wonky. If you have to store your results online, I would recommend using something like Jsonstore.

By the way, you also probably want to make sure that the problem isn't with your code itself, possibly by testing it locally.

Here's a relevant question.

Hope this helped!

miracle173 (4)

Thank you
Both hints were helpful
From the the question you linked to I got the information to use the explorer role.
After this I was able to see the content of the file after refreshing the browser. But this was still not satisfying.
So I use as you proposed. To access this there is a useful Python module described here:

JackyApril (2)

Are you searching for how to find a good essay writing service? One of the best ways to compose an essay is to hire a professional essay writer. However, there are a lot of essay writing services that you can find today and most of them claim to be the best in the industry. So how do you know which one is really the best? Here's an example of a good service -, which you can trust. Be careful when choosing.