使用变量指定打印文件名 [英] Specifying the filename of print using a variable

查看:96
本文介绍了使用变量指定打印文件名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道我如何使用print来打印具有基于变量的文件名的文件吗?
目前,如果我这样做:

Does anyone know how I can use print to print out a file with a filename based on a variable?
At the moment if I do:

filename = 'pressure';
print -despc filename

它将文件另存为"filename.eps"

it saves the file as 'filename.eps'

推荐答案

像这样:

print('-despc', filename)

顺便说一句,开关-tiff可以用于保存eps文件的tiff预览.
回答评论:

btw, switch -tiff can be useful to save tiff previews of an eps file.
to answer comment:

print('-despc', '-tiff', filename)    # saves eps file with tiff preview

这篇关于使用变量指定打印文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆