0
Python data
Hi, I wish to make an AI that memorize a data insered by the user and remember them when you close and re-open too. Can someone help me?
6 odpowiedzi
+ 1
This and the following lessons might help:
https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2445/
+ 1
2 ways:
open and read it, then pass it as string in exec function.
import it
0
You would need to store the data in files.
0
How can I do it? Thanks
0
Thanks! But if the program save into a file a command, like print("Hello World"), how can it run in a program?
0
After you know how you can handle files, to save data in text you should create a logic for it.
For example to store list [160, 205, 639] in a text file you could create a mechanism where you separate each item by space: "160 205 639" and write it in file as string.
And to read that data you should open the file again and do the reverse.
But doing that by saving Python file: "[160, 205, 639]" and getting the data by running the file is not recommended.