title: Strange colour behavior Python
body: <p>I have the following input: </p>
  
  <pre><code>localhost is alive
  54.197.204.2 is alive
  danezu4 172.31.24.178 Disk usage: 14602mb RAM available: 1837mb Uptime: 255mins CPULoad: 0.0% 
  danezu1 172.31.32.230 Disk usage: 14962mb RAM available: 1837mb Uptime: 255mins CPULoad: 0.0% 
  danezu4 172.31.24.178 Disk usage: 14602mb RAM available: 1837mb Uptime: 255mins CPULoad: 0.0% 
  danezu1 172.31.32.230 Disk usage: 14962mb RAM available: 1837mb Uptime: 255mins CPULoad: 0.0%
  </code></pre>
  
  <p>And the following Python code: </p>
  
  <pre><code>import colour
  import fileinput
  class Colour:
     GREEN = '\033[92m'
     RED = '\033[91m'
     BOLD = '\033[1m'
     END = '\033[0m'
  uptime="Uptime:"
  cpuload="CPULoad:"
  f=open('/home/ansible/ansible/playbooks/healthcheckv2/sysinfo/files/ping.txt', 'r')
  filedata=f.read()
  f.close()
  with open('/home/ansible/ansible/playbooks/healthcheckv2/sysinfo/files/ping.txt', 'r') as f:
     for line in f:
         words=line.split()
         for i,w in enumerate(words):
            if w==uptime:
                 if words[i+1]&gt;86400:
                     filedata=filedata.replace(words[i+1], Colour.GREEN+words[i+1]+Colour.END)
                 elif words[i+1]&lt;86399:
                     filedata=filedata.replace(words[i+1], Colour.RED+words[i+1]+Colour.END)
            if w==cpuload:
                 if words[i+1]&gt;80:
                     filedata=filedata.replace(words[i+1], Colour.RED+words[i+1]+Colour.END)
                 elif words[i+1]&lt;79.99:
                     filedata=filedata.replace(words[i+1], Colour.GREEN+words[i+1]+Colour.END)
  with open('/home/ansible/ansible/playbooks/healthcheckv2/sysinfo/files/ping.txt', 'w') as file:
       file.write(filedata)
  file.close()
  </code></pre>
  
  <p>I do not understand the behavior for the color of the text after this Python code is applied. If the CPU is lower than 80 in the text file, the value will be RED. If the value is passing 80% in the text file, will be green. The same thing is applying for the uptime value. What can be wrong here? </p>
  
  <p>The values that are in the text file are rounded in a Jinja2 template file(but I don't think that the behavior is related to this):</p>
  
  <pre><code>Uptime: {{(ansible_uptime_seconds/60)|round|int}}mins CPULoad: {{(cpuload.stdout)|float|round}}% 
  </code></pre>
  
  <p>Best regards,</p>
  
  <p>Romain</p>