Skip to content

Commit

Permalink
fix: correção para caminho padrão do arquivo amazon-meta.txt seja o r…
Browse files Browse the repository at this point in the history
…oot do projeto
  • Loading branch information
rivailluz committed Jan 5, 2024
1 parent 1b43f08 commit 0352cb8
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions scripts/tp1_3.2.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ def create_database():
if connection is not None:
connection.close()


if __name__ == '__main__':
argumentos = sys.argv[1:]
path = "../amazon-meta.txt"
path = "./amazon-meta.txt"
if len(argumentos) >= 1:
for argumento in argumentos:
if argumento == 'create':
create_database()
else:
path = argumento


print('Trabalho Prático 1 - 2023.2')
print('Criando tabelas...')
createAllTables()
Expand Down Expand Up @@ -241,10 +241,7 @@ def create_database():
cursor.close()
connection.close()
print('Dados inseridos com sucesso.')
end_time = time.time()
print('Tempo de execução com banco: ', end_time - start_time)
print('Tempo de inicio: ', start_time)
print('Tempo de fim: ', end_time)

except (Exception, psycopg2.DatabaseError) as error:
connection.rollback()
print(error)
Expand Down

0 comments on commit 0352cb8

Please sign in to comment.