title: How to plot graph in PyQt4 from the output result of the parsing log file wroten with python?
body: <p>I have written with python a parsing file which contains the result of file.log which contains some data of my memory usage and cpu and time and what I want is to make the output result in graph of my PyQt4 interface instead of the terminal display.</p>
  <p>This is my log file before parsing it:</p>
  <pre><code>Memory: svmem(total=4014465024, available=3451576320, percent=14.0, used=1240055808, free=2774409216, active=543842304, inactive=525877248, buffers=82866176, cached=594300928)
  CPU: 35.70 %
  Elapsed execution time: 0.642941951752 seconds 
  </code></pre>
  <p>and this is my parsing file:</p>
  <pre><code>import re
  class Parse(object):
      with open('./perf.log', 'r') as logFile:
          for line in logFile:
      
          # Searching for CPU metric
          cpu_search_result = re.search('CPU: ([0-9.]*) %', line)
          if cpu_search_result != None:
              cpu_metric = cpu_search_result.group(1)
      
          # Searching for Execution time metric
          execution_time_search_result = re.search('Elapsed execution time: ([0-9.]*) seconds', line)
          if execution_time_search_result != None:
              execution_time_metric = execution_time_search_result.group(1)
      
          # Searching for memory metric
          memory_search_result = re.search('\((.*?)\)', line)
          if memory_search_result != None:
              metrics_splited = memory_search_result.group(1).split(&quot;,&quot;)
              for pair in metrics_splited:
                  splited_key_value = pair.split(&quot;=&quot;)
                  metric_name = splited_key_value[0].strip()
                  metric_value = splited_key_value[1].strip()
                  memory_key_value_metrics[metric_name] = metric_value
      
      # --------- end - parsing the file ---------
      
      
      # --------- start - printing the result ---------
      
      # Print all memory metrics if they exist
      if (len(memory_key_value_metrics) &gt; 0):
          print &quot;memory metrics: &quot;
          print &quot;total = &quot; + memory_key_value_metrics[&quot;total&quot;]
          print &quot;available = &quot; + memory_key_value_metrics[&quot;available&quot;]
          print &quot;percent = &quot; + memory_key_value_metrics[&quot;percent&quot;]
          print &quot;used = &quot; + memory_key_value_metrics[&quot;used&quot;]
          print &quot;free = &quot; + memory_key_value_metrics[&quot;free&quot;]
          print &quot;active = &quot; + memory_key_value_metrics[&quot;active&quot;]
          print &quot;inactive = &quot; + memory_key_value_metrics[&quot;inactive&quot;]
          print &quot;buffers = &quot; + memory_key_value_metrics[&quot;buffers&quot;]
          print &quot;cached = &quot; + memory_key_value_metrics[&quot;cached&quot;]
      
      # Print CPU Metric
      if cpu_metric != -1:
          print &quot;CPU = &quot; + cpu_metric
      
      # Print Execution time metric
      if execution_time_metric != -1:
          print &quot;Execution time = &quot; + execution_time_metric
      
      # --------- end - printing the result ---------
  </code></pre>
  <p>I'm struggling to see where I have gone wrong, but then again I am somewhat new to Python.</p>