Questions tagged as 'python'

1
answer

Import a UI schema in PySide

I have a PyQt StyleSheet scheme in a separate document that I want to import into a UI. I'm doing the following: style_sheet_file = qc.QFile(os.path.join(os.path.dirname(__file__), 'stylesheets', 'scheme.qss')) style_sheet_file.open...
asked by 17.07.2017 / 14:18
2
answers

Get several values in a query

I have this code: cursor.execute('SELECT nom FROM productes WHERE listacompra = 1') rows = cursor.fetchall() for row in rows: print(row[0]) In the SQL database, I have two rows with something like this: id 1, nom Custard, list purc...
asked by 06.09.2017 / 19:42
2
answers

Dice launch simulator in Python

I am trying to create a function that every time it is called, generate a list of 100 random launches of a die using the random library. import random def dice(): dado = [] for i in range(100): dado.append(random.choice(range(...
asked by 04.09.2017 / 08:38
1
answer

Regular expression for django url with slug containing "/"

The idea is to create a regular expression to configure the url I have 2 models, category and articles. The article model has a FK to category and the slug makes the join correctly slug (category) / slug (article). I want to use the separator...
asked by 23.08.2017 / 05:13
1
answer

Use stylesheet in a qtablewidget to send properties of a cell

I'm trying to change the color of the text and background of an item in a qtablewidget with this code: tabla.item(0,0).setStyleSheet("QTableWidget::item {border: 1px solid red;}") Where table refers to a QTableWidget. However, it does no...
asked by 13.09.2018 / 07:34
1
answer

Python using tkinter Figure on top of another

Hi, I am new to this page and programming, I have a project where I have to make a bubble collection program, either circles or images of these, where I must click and generate a fractal figure for each click. The fractal has to be generated...
asked by 29.06.2017 / 08:37
2
answers

Iterate list and return PYTHON index

Good, as an example in a list with a cycle for example. And the for variable will return the index of the list in that iteration instead of the element. An example here goes. array_1=["1","2","3"] for i in array_1: print(i) I know that...
asked by 30.06.2017 / 03:36
1
answer

Utility of "" .join ()

I would like to know the usefulness and functionality of this method (actually I do not know if it is a method) ".".join . I have seen it in several examples and forums but its concept has not yet become clear to me. If you could give me a...
asked by 24.09.2017 / 19:41
1
answer

Help to send AJAX with NippleJS

I'm using nippleJS: link I'm not 100% sure if it's possible to send the joystick information but I'd say yes. I want to send an AJAX form with the position of the joystick and I want it to be in real time to control some engines. I can not...
asked by 06.10.2017 / 22:43
2
answers

data entry with (input) in 3x python

I have this class code that runs without any problem, I want to do the data entry using input function and then visualize it with print or return , but I could not do it, it is unconfigured when I try. I would appreciate g...
asked by 26.05.2017 / 18:16