python3 create new empty file

Solution

You need to create an empty file with python3. The proper way to create a new file is by using the pathlib module. Pathlib has the Path object which allows you to manipulate the filesystem.

Here is an example on how to touch a file with python3:

from pathlib import Path
Path('empty_file').touch()

Remember to initialize Path with the path to the file you want to create.