Home > Enterprise >  Loop keeps freezing midway through the code
Loop keeps freezing midway through the code

Time:09-22

I'm trying to create a code that cleans up a file I have so I can use it as data, but every time I run it, it freezes mid way, at "173529" every single time. The only reason I can think of is that I'm overworking my laptop and the console can't catch up or something. I can't see any reason or error that would cause such an issue, so I'm hoping somebody can identify it for me...

(Before all this is just a bunch of variables that edit the code and clean it up a bit before the main filtering process. The print codes are just there for debugging purposes. 'cn' is character number value, and 'nil' is number in list value)

import time
import re
import is
os.system("color")

 def spamp2():
    userList = []
    countertls = 0
    counterpus = 0
    a = open(document, "r ", encoding='utf8').read().replace("[breaker]", "")
    b = a.replace(" ","\n")
    c = b.replace(":heart:", "")
    d = c.replace(r":\w :", "")
    e = d.replace(":", "           
  • Related