Questions tagged as 'python'

1
answer

How can I pass the value of a variable to the update function of sqlite3 in python

I would like to know how to pass data to the update function of sqlite 3: this is the code: conexion = sqlite3.connect("Db/Users.db") cursor = conexion.cursor() intem = self.lineEdit.text() cursor.execute('UPDATE Usuarios SET Contraseña ='...
asked by 27.07.2018 / 20:53
2
answers

Mutable fields in Dataclasses, prevent them from being shared by all instances

As a practice, I designed a database with two types of objects. Each of them has several fields, and some of them are instances of classes that I have created for use. As I add objects to the database, I realize that these fields, instead of bei...
asked by 04.08.2018 / 12:50
1
answer

Retrieve id in comboBox

I have the following function to fill a comboBox with the data entered in the form by the user, this works correctly. def onTextChanged(self, text): if text: sql = ("SELECT sec.Nombre as Seccion,sec,idSeccion FROM [Lote] lot \...
asked by 06.08.2018 / 12:55
2
answers

Is there any way to configure Python to detect all errors without having to execute the script?

I would like to know if it is possible to configure Python to warn of all the errors without having to execute the script. I already know that at the beginning of the execution it does a syntactic analysis. But I think that is not enough. I m...
asked by 11.07.2018 / 03:23
1
answer

StackedWidget, fails to show interface.ui

I have a problem, I try to use a stackedwidget to change the contents of my main window but not the one in the taskbar. this is my code: from PyQt5.QtWidgets import QMainWindow,QApplication,QMenu from PyQt5 import QtCore,QtGui,QtWidgets fro...
asked by 10.07.2018 / 23:26
1
answer

Calculate and apply probability in python 3.6

I'm doing a script, and I've been stuck in one step. My question is this: Suppose that I have the variable prob = 0.8 , what I want is that prob is the variable that you choose between two objects. Example: prob = 0.8 perro...
asked by 19.06.2018 / 17:06
1
answer

Add rows by pandas names

I'm working with a data framework like this, but bigger and with more areas. I'm trying to add the value of the rows by their names. This is my code but I get an error. The total of the sums of the R or C zones go in the column total and...
asked by 05.07.2018 / 14:38
2
answers

Get value from a list

I need to get the second value from this list ['connections-wfs', 'Prueba', 'url=https://test.com/ows/wfs\n'] The data is not always the same but if you always have the same number of values, in this example it would be    'Test'     
asked by 15.08.2018 / 13:24
1
answer

How to show content in a select that depends on another select?

My question is the following one ... I have a select that is a foreign key, and at the same time it has another foreign key, and what I want to do is select a data of the first select and that the second select changes its content depending on t...
asked by 17.08.2018 / 00:31
1
answer

Failed to decode JSON object when calling GET request with Flask Python

I try to send a GET request after sending a message to a server, but I receive an error. I think it's because @app.route('/chat',methods=["POST"]) def chat(): try: user_message = request.form["text"] response = requests.pos...
asked by 06.06.2018 / 14:53