Questions tagged as 'python-3.x'

1
answer

Explain template location in Django

I'm using Django for a project, but I came across a question. In my file settings.py I have the following configuration of templates : TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates',...
asked by 25.07.2018 / 02:13
1
answer

How to check parentheses of an algebraic expression?

I'm trying to solve a problem of a course I'm doing but I can not imagine a way to solve it. I need to create a program where the user type any expression that uses parentheses. My application should look at whether the last expression has...
asked by 10.07.2018 / 16:18
2
answers

Replace list with pattern in regex

Personally I need to transform a string into a list, in a peculiar way. I found in this post what I need to do. But I'm lost to the applied regex. I have numerous string in the following format: ["DECRETO Nº 76.326 DE 23 DE SETEMBRO D...
asked by 08.07.2018 / 20:56
1
answer

How do I add the values stored in the list: pairs?

matriz = [[0, 0, 0], [0, 0, 0], [0, 0, 0]] pares = [] for linha in range(0, 3): for coluna in range(0, 3): matriz[linha][coluna] = int(input("Digite um valor para [{}, {}]: ".format(linha, coluna))) if matriz[linha][coluna] % 2 == 0:...
asked by 04.08.2018 / 19:13
1
answer

Python asyncio and threading

I am studying the module asyncio of Python and there is the function run_coroutine_threadsafe which should be run on a thread other than the event loop. Here's my script: #!usr/bin/python3 # -*- coding: utf-8 -*- import asyn...
asked by 15.08.2018 / 02:53
1
answer

Doubts about Python methods and classes

I have the Login class and created an instance of it in the Main class, with the instance I'm calling the start method, however in the start method when clicking the 'Log in' button the method 'show_entry_fields' is not executed correctly. When...
asked by 22.08.2018 / 00:33
1
answer

Questions about type Python3

I wanted to know if I could use type like this: media = input("Digite o numero: ") média = input("Digite outro numero: ") if media == type('str'): print("oi") else: print("Tchau") That is, to check if the variable media...
asked by 07.07.2018 / 19:53
1
answer

Python - Doubt about imports in creating libraries

If I'm creating a library, and I put import json , in my main (my main file) would I have to import json or just give import from my same library? Thanks in advance for your help.     
asked by 07.09.2018 / 16:50
1
answer

Create a mini CRUD (basic) in tkinter with python

My name is Victor, I already researched the Treeview but could not do anything, but my goal is this one: I did an illustrated example followthecode:fromtkinterimport*classprincipal:def__init__(self):janela_principal=Tk()janela_principal.geom...
asked by 17.07.2018 / 03:40
1
answer

Buy list values

I'm having a problem with a list. I have a txt with some information (log failure of a system) and I wanted python to print to me these faults with the "translation" of them example: If cod_erro == '1':    print ('Invalid password') and...
asked by 11.07.2018 / 19:43