From the course: Python Theory for Network Engineers

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

File inputs and outputs

File inputs and outputs

- [Instructor] File input and output is one of the most common ways for us to produce data that could be used at a later date. So let's talk about how we could do File I/O in Python. If we think about how we interact with a computer, we generally use some kind of input device. Like keyboards, or a mouse, track pad and receive output in the form of something appearing on the screen, for example. Or, sound coming off from the computer speaker. In terms of interacting with Python, we have been using Python expressions, like assigning values to your variable. Or constructing a loop and then receive the output's printouts from the screen. And furthermore, we also saw that we could modify the output with say, F string, where we substitute the value of that variable before it's printed out on the screen for us. And same thing for File I/O. In particular, for file input, we generally follow the pattern of opening the file,…

Contents