如何将某些文本复制到Python的某个行中?
好吧,关于将文本复制和粘贴到文件中的帖子很多,但我想将其添加到我将其粘贴到的代码中的特定行中。
例如,我将此文件命名为“ main.leap”,内容看起来完全像这样:
outln "Hello";
我还有另一个名为“ main.py”的文件,并且内容看起来完全像这样:
text_input = """
"""
print(text_input)
我如何使用intimpts suntleil之类的进口来粘贴Main.Main.Leap的内容特别是在第2行中,没有其他行?
Alright, there are so many posts about copying and pasting text into a file, but I want to add it to a SPECIFIC line inside of the code that I'm pasting it into.
For example, I have this file named 'main.leap' and the contents look exactly like this:
outln "Hello";
And I have another file named 'main.py' and the contents look exactly like this:
text_input = """
"""
print(text_input)
How can I use imports like Shutil to paste the contents of main.leap SPECIFICALLY inside line 2 and in no other line?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有封闭式:
Without shutil: