在LaTeX中,有一个名为“input”(https://en.wikibooks.org/wiki/LaTeX/Modular_Documents#Comparing_the_methods:_input_vs_include)的函数,它允许我包含来自另一个文件的LaTeX代码,基本上作为子文档(https://yihui.name/knitr/demo/child/)。这意味着我基本上可以分解文档,而不必担心这些片段在本地的行为
基本上,我希望能够有一个主文件“printExample.py”,如下所示:
documentFileName = "ABCD"
theCommandImLookingFor "childfile.py"
sampleFuncHere()
“childfile.py”可以是这样的:
def sampleFuncHere():
print(documentFileName)
“printExample.py”相当于:
documentFileName = "ABCD"
def sampleFuncHere():
print(documentFileName)
sampleFuncHere()
我试图以类似于LaTeX或R标记的方式使用Python包“Python docx”,但在LaTeX或R标记的子文档中找不到与“input”函数等效的代码
目前没有回答
相关问题 更多 >
编程相关推荐