如果输入的字符串 ID 太长或有段落,则不会全部复制
If an input string too id long or has a paragraphs won't copy it all
我有一个关于 input
的问题
description = input('add description: ')
我正在使用 Ctrl+C 和 Ctrl+[= 添加文本24=]V.
例如:
"The short story is a crafted form in its own right. Short stories
make use of plot, resonance, and other dynamic components as in a
novel, but typically to a lesser degree. While the short story is
largely distinct from the novel or novella/short novel, authors
generally draw from a common pool of literary techniques.
Determining what exactly separates a short story from longer fictional
formats is problematic. A classic definition of a short story is that
one should be able to read it in one sitting, a point most notably
made in Edgar Allan Poe's essay "The Philosophy of Composition"
(1846)"
结果是:
description = "The short story is a crafted form in its own right. Short stories make use of plot, resonance, and other dynamic components as in a novel, but typically to a lesser degree. While the short story is largely distinct from the novel or novella/short novel, authors generally draw from a common pool of literary techniques."
虽然我希望描述包含我复制的整个文本链。
您在此处面临的问题是,一旦按下回车键或(在本例中)开始下一行,输入就会结束。使用 enter 的唯一方法(我只是要这样称呼它,希望你明白我的意思)不是实际写一个新段落只是为了写 \n,因为这是 enter 在字符串中的表示。如果你想解决这个问题,我强烈建议你学习如何使用 TKinter 模型,因为如果你想为前端创建任何类型的应用程序,它是最好的模块之一。这里有一个 link 让你开始 https://www.tutorialspoint.com/python/python_gui_programming.htm
通常 input()
函数在行尾或 \n
处终止。我建议使用这样的设置:
line = []
while True:
line = input()
if line == "EOF":
break
else:
lines.append(line)
text = ' '.join(lines)
它所做的是读取输入并将其添加到数组中,直到您在其自己的行中键入“EOF”并按回车键。 Thsis应该解决多行问题。
我有一个关于 input
description = input('add description: ')
我正在使用 Ctrl+C 和 Ctrl+[= 添加文本24=]V.
例如:
"The short story is a crafted form in its own right. Short stories make use of plot, resonance, and other dynamic components as in a novel, but typically to a lesser degree. While the short story is largely distinct from the novel or novella/short novel, authors generally draw from a common pool of literary techniques.
Determining what exactly separates a short story from longer fictional formats is problematic. A classic definition of a short story is that one should be able to read it in one sitting, a point most notably made in Edgar Allan Poe's essay "The Philosophy of Composition" (1846)"
结果是:
description = "The short story is a crafted form in its own right. Short stories make use of plot, resonance, and other dynamic components as in a novel, but typically to a lesser degree. While the short story is largely distinct from the novel or novella/short novel, authors generally draw from a common pool of literary techniques."
虽然我希望描述包含我复制的整个文本链。
您在此处面临的问题是,一旦按下回车键或(在本例中)开始下一行,输入就会结束。使用 enter 的唯一方法(我只是要这样称呼它,希望你明白我的意思)不是实际写一个新段落只是为了写 \n,因为这是 enter 在字符串中的表示。如果你想解决这个问题,我强烈建议你学习如何使用 TKinter 模型,因为如果你想为前端创建任何类型的应用程序,它是最好的模块之一。这里有一个 link 让你开始 https://www.tutorialspoint.com/python/python_gui_programming.htm
通常 input()
函数在行尾或 \n
处终止。我建议使用这样的设置:
line = []
while True:
line = input()
if line == "EOF":
break
else:
lines.append(line)
text = ' '.join(lines)
它所做的是读取输入并将其添加到数组中,直到您在其自己的行中键入“EOF”并按回车键。 Thsis应该解决多行问题。