解析包含一些 Python 的文本文件(类似于 PHP)

问题描述 投票:0回答:1

我使用 PHP 解析包含嵌入脚本(在 php 标签之间)的文本文件,如下所示:

This is a text file
I can include some PHP scripting like <?php echo "this" ?>

然后,我只需使用命令“ php file.txt ”对其进行解析即可生成目标文本文件。

我想知道我们是否可以用Python做同样的事情:编写一个文本文件,在标签之间嵌入一些Python脚本,然后解析该文件......? 谢谢你

python php parsing tags embed
1个回答
0
投票

...又是我:)听起来答案就在这里:https://pyscript.net/

© www.soinside.com 2019 - 2024. All rights reserved.