Book contents
- Frontmatter
- Contents
- Image Credits
- Introduction
- Downloading Python
- Some Tips
- Part I Learning Python
- Challenges 1–11 The Basics
- Challenges 12–19 If Statements
- Challenges 20–26 Strings
- Challenges 27–34 Maths
- Challenges 35–44 For Loop
- Challenges 45–51 While Loop
- Challenges 52–59 Random
- Challenges 60–68 Turtle Graphics
- Challenges 69–79 Tuples, Lists and Dictionaries
- Challenges 80–87 More String Manipulation
- Challenges 88–95 Numeric Arrays
- Challenges 96–103 2D Lists and Dictionaries
- Challenges 105–110 Reading and Writing to a Text File
- Challenges 111–117 Reading and Writing to a .csv File
- Challenges 118–123 Subprograms
- Challenges 124–132 Tkinter GUI
- Challenges 133–138 More Tkinter
- Challenges 139–145 SQLite
- Part II Chunky Challenges
- What Next?
- Glossary
- Index
Challenges 105–110 - Reading and Writing to a Text File
from Part I - Learning Python
Published online by Cambridge University Press: 28 May 2019
- Frontmatter
- Contents
- Image Credits
- Introduction
- Downloading Python
- Some Tips
- Part I Learning Python
- Challenges 1–11 The Basics
- Challenges 12–19 If Statements
- Challenges 20–26 Strings
- Challenges 27–34 Maths
- Challenges 35–44 For Loop
- Challenges 45–51 While Loop
- Challenges 52–59 Random
- Challenges 60–68 Turtle Graphics
- Challenges 69–79 Tuples, Lists and Dictionaries
- Challenges 80–87 More String Manipulation
- Challenges 88–95 Numeric Arrays
- Challenges 96–103 2D Lists and Dictionaries
- Challenges 105–110 Reading and Writing to a Text File
- Challenges 111–117 Reading and Writing to a .csv File
- Challenges 118–123 Subprograms
- Challenges 124–132 Tkinter GUI
- Challenges 133–138 More Tkinter
- Challenges 139–145 SQLite
- Part II Chunky Challenges
- What Next?
- Glossary
- Index
Summary
Saving data to an external file is an essential skill allowing programs to have multiple practical real-world uses. This chapter shows the reader how to save data to text files as well as import data from text files into Python so it can be manipulated. By working through the six challenges the reader learns how to implement these important new skills.
- Type
- Chapter
- Information
- Python by ExampleLearning to Program in 150 Challenges, pp. 86 - 90Publisher: Cambridge University PressPrint publication year: 2019