How to use Files in Python - #FirststepsinPython part 13
Today I learned a bit more about Python, and how I can use Files to store information, permanently.
Basically, I can save Variables, Lists or Dictionaries to a actual file, so it can be stored in the Hard Drive/SSD instead of the RAM, so you can create permanent Databanks.
I can create a File very easily:
File = open("Databank.txt", "w")
here I just created a .txt File called Databank, and every time I want to use it, I can use the thing I define it to, which File. the W is for Write, as I am creating a file, and I need to close it if I need to alter it
File.close()
I can also Alter the file ("a") or Read the file ("r"), when altering I keep the information inside, and if I create a file with the same name it will replace the existing file name info.
The course link (it's in Portuguese): https://on.fiap.com.br/local/salavirtual/conteudo-digital.php
If you have any question or suggestion on other topics, feel free to comment down below or ask me in Facebook or Instagram!
Visit my Facebook Page in: http://fb.com/teteusbionicoficial
Visit my Instagram: https://www.instagram.com/teteusbionic/
Visit my Website: http://www.teteusbionic.com.br