Created
February 27, 2020 16:58
-
-
Save CoutinhoElias/d7c064752b12d08f3b335a3e0c84c516 to your computer and use it in GitHub Desktop.
Chamada de funções
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
from DatabaseManager import NewDatabaseManager | |
print('1 - Inserir dados na tabela.') | |
print('2 - Excluir dados da tabela.') | |
print('3 - Listar dados da tabela.') | |
print('4 - Atualizar dados da tabela.') | |
print('\n') | |
funcao = int(input('Digite um dos códigos acima: ')) | |
if funcao == 1: | |
pass | |
elif funcao == 2: | |
pass | |
elif funcao == 3: | |
list_table | |
elif funcao == 4: | |
pass | |
dbm = NewDatabaseManager(server_name='localhost', database='ALTERDATA_BIMER', logger_file_name='log_de_conexao.log') | |
def insert_table(): | |
# FUNÇÃO PARA CAPITALIZAR PALAVRAS | |
p = ['da','das', 'de', 'di', 'do','dos', 'du', 'para', 'com', 'a', 'e'] | |
def cap_name(name): | |
items = [] | |
for item in name.split(): | |
if not item.lower() in p: | |
item = item.capitalize() | |
else: | |
item = item.lower() | |
items.append(item) | |
return ' '.join(items) | |
def list_table(): | |
output = dbm.select_data('SET NOCOUNT ON; SELECT * FROM NATUREZALANCAMENTO') | |
print(output) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment