This has only been tested on Windows:
You can do the following:
import os
os.startfile("C:/Users/TestFile.txt", "print")
This will start the file, in its default opener, with the verb 'print', which will print to your default printer.Only requires the os
module which comes with the standard library
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…