Skip to content
← Back to Community
Problems when writing files
Profile icon
miracle173

I do some calculations that took rather long (https://repl.it/@miracle173/ponder201905). 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 "repl.it". Unfortunately it happens often that my repl.it-session is disconnected and I want to recover my program execution from this state files. But most of the time this does not work on repl.it.

Answered by JustARatherRidi [earned 5 cycles]
View Answer
Voters
Profile icon
QuintecMusic
Profile icon
miracle173
Comments
hotnewtop
Profile icon
JustARatherRidi

Not sure what your expected output is, but you should know that writing to files on repl.it 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!

Profile icon
miracle173

@JustARatherRidi
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 https://www.jsonstore.io/ as you proposed. To access this there is a useful Python module described here: https://repl.it/talk/share/NEW-Python-Lib-for-wwwjsonstoreio-DONT-LOOSE-YOUR-D-AGAIN-WITH-JSON-STORE-NEW/10956

Profile icon
JaneJLocane

Thanks for the information. I recently took up programming and wanted to enroll in courses. But because of the load at the university, I had to abandon this idea for a while. Friends advised me a residency personal statement writing services for my assignments. Thanks to this, I was able to pass my essays and coursework on time. I think now I will have time to learn programming.

Profile icon
JackyApril

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 - https://wowgrade.net/, which you can trust. Be careful when choosing.