Persistent Variables in Python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

Persistent Variables in Python

Hey guys, I have been wondering if there is some way to store text data in variables over multiple uses of a python code. This would be epspecially useful on sololearn, as you can’t save .txt files.

4th Jul 2018, 11:25 PM
James Pinder
3 Answers
+ 2
Nope! Persistent storage is exactly what files (txt or other) are made for. If you want to keep data in between sessions, the best you can do is save your data in a database somewhere on the internet, but that's probably a bit complicated and will probably also cost money. Javascript would be able to to that, but it has the benefit of running in the browser, and browsers give you tools to store data, much like in a database. No such luck with python I'm afraid.
5th Jul 2018, 12:25 AM
Schindlabua
Schindlabua - avatar
0
thanks, thats a shame
5th Jul 2018, 1:06 AM
James Pinder
0
what you can achieve with js can be achieved with python (but not natovely in the browser)
5th Jul 2018, 6:50 PM
seamiki
seamiki - avatar