我正在从文件中切出一大块文本。现在块存储在一个变量中。喜欢,
str="from child hood days i liked sweet and savoir. in the early days my mother cooked great deal of sweet meats in home and all my relatives had a nice taste for good sweets. even in remote assam town we thronged miles to procure good sweets. and my sweet eating habit was pretty known. in my childhood i could had as good as 30 to 40 rosgollas at one seating after a full course of lunch. though i was not among the best in my family."
但是我现在想以与我们编写时相同的方式读取每一行
for line in file:
print line
我的问题是我们可以这样做,还是应该写回文件然后执行操作?如果有人可以提供帮助。
问候, Subhabrata Banerjee Gurgaon India