[python] ____ and giggles

Viewer

copydownloadembedprintName: ____ and giggles
  1. import time
  2. import os
  3. import sys
  4.  
  5. def main():
  6.     foundLimit = False
  7.     foundEnd = False
  8.     currentLine = 0
  9.     lastLine = 0
  10.     maxShares = 100
  11.     extraLines = 5
  12.     lastLines = 0
  13.     previousLine = ''
  14.     timer = 0
  15.     highestDiff = 0
  16.  
  17.     while(True):
  18.         time.sleep(1)
  19.         #tick
  20.         timer+=1
  21.         finalLine = ''
  22.         line = ''
  23.         with open(os.path.join(sys.path[0], 'keyout.txt')) as f:
  24.             for line in f:
  25.                 pass
  26.             finalLine = line
  27.         if ('diff=' in finalLine and 'Accepted' in finalLine):
  28.             actualDiff = int(finalLine.split('=')[1].split()[0])
  29.             if (actualDiff > highestDiff):
  30.                     highestDiff = actualDiff
  31.  
  32.         if (timer % 10 == 0 ):
  33.             print(highestDiff)
  34.                 
  35.  
  36. if __name__ == "__main__":
  37.     main()
  38.  

Editor

You can edit this paste and save as new:


File Description
  • ____ and giggles
  • Paste Code
  • 05 May-2021
  • 866 Bytes
You can Share it: