News

As you can see, we declare our new variable myFile and then use the built-in open and write commands to open and write to the file. The “w+” tells Python that we will be writing a new file.
Interested in learning Python? Jack Wallen takes you through your first steps in building a simple application to take user input and write it to a file.
Simply create a new .py file in the same folder as your main Python code. Then “import” that file as you now know how to do, then access the functions from within that module.