Created
February 7, 2019 21:01
-
-
Save Maronato/3c49a1d5459e9749ff887795da0b68c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import re | |
def get_aprovados(filename): | |
with open(filename, 'r') as file: | |
aprovados = re.findall( | |
r'(?<=\)\s)(.*?)(?=\s+Engenharia Eletrica)', file.read()) | |
nl = '\n' | |
print(f""" | |
Aprovados: {len(aprovados)} | |
{nl.join(aprovados)} | |
""") | |
if __name__ == "__main__": | |
if len(sys.argv) == 1: | |
print("Erro: Falta o nome do arquivo") | |
elif len(sys.argv) != 2: | |
print("Erro: Argumentos demais") | |
else: | |
get_aprovados(sys.argv[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment