It can be.
But since format of file path and structure of file system is OS-specific, you should modify your code to support cross-platform feature.
You can choose to do one of these:
1) If you use relative path for read from input or write to output, you can use code like os.path.join("input", "folder", "input.txt") to get the path of input file from the place of your source code. Since implementations of os.path.join in different operating systems are different with each other. So you don't need care about the different format of file path any more.
2) If you use absolute path for read and write, you can use program arguments to let user to specify the absolute path of the input/output file path. Like, in simplest case,
import sys
input = sys.argv[1]
output = sys.argv[2]
print(input, output)
When you run the code (if named with script.py) with:
python3 script.py E:\data\input.txt E:\data\output.txt
Then you will get the output
E:\data\input.txt E:\data\output.txt
So in this way, you give the freedom to users to choose the input and output path, no matter what operating system they are using.