new.py
new.py copied to clipboard
Use write_text method from Path and platform check
Print to a file does not close the resource correctly and i get the warning. So since you already use Path, the write_text method is better. Also chmod is not available on windows so check for platform is added.