This code always gives a infinity loop in while:
pos1 = 0
pos2 = 0
url_string = '''<h1>Daily News </h1><p>This is the daily news.</p><p>end</p>'''
i = int(len(url_string))
#print i # debug
while i > 0:
pos1 = int(url_string.find('>'))
#print pos1 # debug
pos2 = int(url_string.find('<', pos1))
#print pos2 # debug
url_string = url_string[pos2:]
#print url_string # debug
print int(len(url_string)) # debug
i = int(len(url_string))
I tried everything without results.
More info:
- Python 2.7.5+ (default, Sep 19 2013, 13:48:49)
- [GCC 4.8.1] on linux2
- Ubuntu 13.10
- Run in GNOME Terminal 3.6.1 (also tried in Emacs and PyCharm without a solution to the infinity problem)