DATA STORAGE IN PYTHON - GitHub Pages
DATA STORAGE IN PYTHON
Peter Larsson-Green J?nk?ping University Autumn 2018
WHERE DO WE STORE DATA?
In variables! ? Easy to create. my_variable = 123 ? Easy to read. my_variable ? Easy to update. my_variable = 456 ? Very fast! ? Variables are deleted when program terminates
WHERE DO WE STORE DATA?
In files! ? More complex to create. ? More complex to read. ? More complex to update. ? Slower. ? Continues to exist after the program has terminated
? Until the user manually deletes it by mistake...
HOW TO OPEN FILES
file_object = open("the-filename.txt", "w")
The modes
The mode.
? "w" - create the file if it does not exist,
then use file_object to write strings to it.
? "a" - create the file if it does not exist, then use file_object to write strings to it (at the end).
? "r" - open the file for reading, then use file_object to read strings from it.
? "r+" - open the file for reading and writing, then use file_object to read and write strings to/from it.
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- logix 5000 controllers ascii strings 1756 pm013g
- pymarc introduction to python and
- i have a csv file and need to assign a data type to
- pandas dataframe notes
- programming principles in python csci 503 490
- python regex cheatsheet activestate
- esci 386 scientific programming analysis and
- data storage in python github pages
- python data persistence tutorialspoint
Related searches
- data analysis in research methodology
- data analysis in research pdf
- methods of data collection in qualitative research
- data analysis in qualitative research pdf
- data analysis in qualitative research
- types of data sets in healthcare
- data sets in healthcare definition
- what are data sets in healthcare
- data analysis in quantitative research
- data analysis in research examples
- self storage in kent
- data set in healthcare information