import subprocess
from subprocess import *
import re
#-------------------- Funções --------------------------------
# Retorna os processos que estão atualmente rodando no Windows
def get_processes_running():
	tasks = subprocess.check_output(['tasklist'])#.split("\r\n")
	tasks = str(tasks).split('\\r\\n')
	for i in range (3):
		del tasks[0]
	p = []
	for task in tasks:
		m = re.match("(.+?) +(\d+) (.+?) +(\d+) +(\d+.* K).*",task)
		if m is not None:
			p.append({"image":m.group(1),
				   "pid":m.group(2),
				   "session_name":m.group(3),
				   "session_num":m.group(4),
				   "mem_usage":m.group(5)
				   })
	print("get_processes_running.. OK")
	return p
@@ -656,8 +656,441 @@
 return p
+%0A# Cria tabelas para guardar os processos de 'excess%C3%A3o'%0Adef criarTabela():%0A%09print(%22criarTabela...%22)%0A%09with sqlite3.connect(%22processos.db%22) as conex%C3%A3o:%0A%09%09with closing(conex%C3%A3o.cursor()) as cursor:%0A%09%09%09cursor.execute('''CREATE TABLE processos(%0A%09%09%09%09id integer primary key autoincrement,%0A%09%09%09%09image text,%0A%09%09%09%09pid integer,%0A%09%09%09%09sessionName text,%0A%09%09%09%09sessionNum text,%0A%09%09%09%09memUsage text)''')%0A%09%09conex%C3%A3o.commit()%0A%09print(%22%5CtTabela processos.. OK%22)%0A

add function to create table (exception list)