我的python代码中的错误是什么,因为它无限运行?

时间:2017-09-15 12:31:26

标签: python-2.7

Warning: file_get_contents(https://finance.google.com/finance/converter?a=100&from=INR&to=BTC&meta=ei%3DZsa7WeGkE4_RuASY95SQAw): failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in F:\Xampp\htdocs\test\index.php on line 11

Notice: Undefined offset: 1 in F:\Xampp\htdocs\test\index.php on line 16
0

此程序继续运行无限时间,直到我使用ctr + c中断。

1 个答案:

答案 0 :(得分:0)

您的时间将继续循环,直到您在行变量中输入' '个空格。

也许你想在按 Enter 时停止,在这种情况下,while line:已经足够了。