python - Python根据特定模式在另一行下添加行
问题描述
我创建了一个小 Python 程序来向我的手机发送短信,这样我就可以访问 HTML 网页而无需花费太多钱。它解析代码并将其拆分为多个文本文件(例如:split_file_aa)上的 160 个字符的块,这些名称存储在一个列表中,并通过“while”循环存储例如“split_file_aa”和'split_file_ab' 在一个名为 'smstext' 的变量中,一次一个。
所以这是我的问题:我在 NodeJS 中有一个包含常量(例如:)的程序const message = "__init__"
,就像在这个例子中一样:
// Some JS content above
const message = 'init'
我想要做的是每次执行'while'循环时在文件中添加'smstext'的内容,以const message2 = '<html code here>'
或const message3 = '<html code here>'
等等的形式,等等,所以我之后的代码可能是
// Some JS content above
const message = 'init'
const message2 = '<html code here>'
const message3 = '<another bunch of html here>'
等等。
如果您有任何问题(因为我不确定我是否真的解释了我的问题),请随时提问!
谢谢!
解决方案
推荐阅读
- firebase - 没有特定 Content-Type 的 Firebase 函数返回未定义的 rawBody
- wordpress - 在 wordpress 中通过 cron 作业发送邮件
- amazon-web-services - AWS Lambda函数在执行时给出错误节点js
- elasticsearch - 在 Kibana 和 C# NEST 中使用逻辑 AND 查询
- android - 如何更改材料设计复选框中刻度线的颜色?
- node.js - CSV 到 Cloudant 导入大型数据集
- typescript - Firestore snapshotChanges DocumentChangeType "removed" never sent
- xml - Perl XML 使用 XML::LibXML 获取元素节点
- firebase - Flutter Firebase Reqd 一份文件
- azure - Azure Function 应用程序或 Web API?