ValueError:不支持的格式字符'

 214812031_88fe08 发布于 2023-02-11 20:10

我从这里获得了以下大部分代码:使用python脚本生成pdf-latex

#!/usr/bin/env python

from __future__ import division
from functions import *
import shlex

#from Utilities import *
import os
import argparse
import subprocess

equation = '\begin{equation*}1 + \gamma\lambda B/2\end{equation*}'

content=r'''\documentclass{article}
\usepackage{graphicx,amsmath}

\begin{document}
\noindent\rotatebox{180}{\vbox{%
    %(equation)s
    }%
}
\end{document}
'''

parser=argparse.ArgumentParser()
parser.add_argument('-e', '--equation', default=equation)

args=parser.parse_args()
content%args.__dict__

print content%args.__dict__

运行此代码会给我以下错误:

Traceback (most recent call last):
  File "latex.py", line 29, in 
    content%args.__dict__
ValueError: unsupported format character '
' (0xa) at index 104

谁知道出了什么问题?我从其他旋转页面的方法中得到了同样的错误.

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有