FileNotFoundError:[WinError 2]系统找不到指定的文件/tempfi

2024-09-27 19:22:19 发布

您现在位置:Python中文网/ 问答频道 /正文

我需要得到16位摄影测量目标,所以我尝试使用这个网站的代码:https://mpetroff.net/2018/05/photogrammetry-targets/,但当它试图用tempfile创建临时目录时,它给出了错误,我似乎不明白为什么。在

with tempfile.TemporaryDirectory() as tmp_dir:
# Create sheets of targets in temporary directory
pdfs = []
for n in range(math.ceil(len(CODES) / ROWS / COLUMNS)):
    pdf_filename = os.path.join(tmp_dir, str(n) + '.pdf')
    create_sheet(n, pdf_filename)
    pdfs.append(pdf_filename)
# Combine sheets into a single PDF
subprocess.run(['pdftk'] + pdfs + ['cat', 'output', FILENAME])

Tags: 代码inhttps目标pdf网站dirfilename

热门问题