Questions tagged as 'python-3.x'

1
answer

Why do not you print the number of capitals of the chain?

The program must return the number of capitals that a string entered by the user has. def eva_cadena(): contador = 0 cadena = input("ingrese una cadena: ") for i in cadena: if i == i.upper(): contador += 1 p...
asked by 27.07.2018 / 23:24
1
answer

Problem with eventFilter and Key_Return in a QDialog with buttons

I have the following code where I try to use eventFilter : class Ticket(QDialog): def __init__(self): QDialog.__init__(self) uic.loadUi("ticket.ui",self) self.D_Aceptar.clicked.connect(self.productos) #QPushB...
asked by 30.07.2018 / 20:00
3
answers

Consultation of two Models in Django

I have these two models: class Pacientes(models.Model): nombres = models.CharField(max_length=50) apellidos = models.CharField(max_length=50) numero_identificacion = models.CharField(max_length=10) fecha_nacimiento = models.DateField(blank=Fal...
asked by 05.07.2018 / 22:03
1
answer

Sum of a sequence using recursion

The idea of the code is to take a function with the following parameters: start , stop , step . start indicates the first number, stop the last and step the difference between each number and the idea is t...
asked by 28.06.2018 / 18:55
1
answer

Execute sqlite3 operation in python before displaying data in a QTableView

Good evening community. I have a query in sqlite3 that I made in the Sales table which is the following: import sqlite3 fecha ="12/08/2018" conexion = sqlite3.connect("Users.db") cursor = conexion.cursor() cursor.execute("SELECT * FROM...
asked by 24.08.2018 / 05:09
1
answer

error in execution of the main class

Good thing my problem is that when wanting to execute a class from the main I have problems to print and execute it class Persona(object): #Definimos un constructor que recibe nombre y edad def __init__(self,nombre,edad): self.nombre=nombr...
asked by 31.05.2018 / 20:51
1
answer

Filter information in python dictionaries dynamically

First of all, I want to say that I am understanding how to filter the information in the Python dictionaries from a JSON and then write them in a JSON file. I take a normal workflow on the basis that we do not always know exactly what we should...
asked by 24.07.2018 / 18:28
1
answer

threads in PyQt - TypeError: function () missing 2 required positional arguments:

Good afternoon, I hope someone can help me with this error: The code is executed but it throws me an error: from PyQt5.QtWidgets import QMainWindow,QApplication, QTableWidgetItem from PyQt5 import uic import firebase_admin from firebase_admin...
asked by 20.07.2018 / 07:52
1
answer

print SyntaxError: invalid syntax

Good morning! I am currently learning Python and in a simple application of practice I found the following error: File "ruta_fichero", line 9 print(num2, "es menor que ", str(num1)) ^ SyntaxError: invalid syntax The code that...
asked by 15.10.2018 / 23:33
1
answer

Filter an exact word in a dataframe (Pandas)

Code: texto = ['El', 'enfermo', 'grave', 'habla', 'de', 'trasplantes', '.'] for palabra in texto: filtro = data[data['palabra'].str.match(palabra, case=False )] print(filtro) An extract of the answer I get from the dataframe is:...
asked by 16.10.2018 / 01:19