python - 如何在 Python 中将文本打印到打印机而无需在第一页(或每页)上打印文件名?
问题描述
import tempfile
import os
q=tempfile.mktemp(".txt")
open(q,"w").write("the writing")
os.startfile(q,"print")
运行此代码时,打印机会输出 [“the writing”](没关系),并且在纸的顶部还有一个名为:=“tempsh03uiuc.txt”的文本。帮我解决这个问题,“ tempsh03uiuc.txt ”是无关紧要的事情。
解决方案
推荐阅读
- python - 如何在不删除python asyncio.Queue()中的项目的情况下获取元素
- javascript - 为什么“console.log”在“return”命令后不起作用?
- javascript - JS DOM 问题:未捕获类型错误:无法读取 null 的属性“addEventListener”变为未捕获引用错误
- django - 在 if 语句中传递 django templatetag 返回值
- flutter - 颤振提取人脸并将裁剪后的人脸发送到服务器
- python - ModuleNotFoundError:python3 中没有名为“_tkinter”的模块?
- rust - 当我拥有最新的 rustc 和 cargo 版本时,为什么我会收到解析器功能的构建错误?
- c++ - 重载函数的调用是模棱两可的......但是为什么?模板问题
- node.js - 与socket io heroku node js聊天抛出404错误
- javascript - 如何提取由 NVDA 聚焦的图像的 src?