Questions tagged as 'python-3.x'

1
answer

How to show a graph with pygal in QMainWindow

I'm trying to show a graph x in a QMainWindow using pygal however the graph is not shown, this is the code I'm using from PyQt5.QtWidgets import QMainWindow,QApplication from PyQt5.QtCore import QDate import pygal class Principal(QMainWindo...
asked by 07.09.2018 / 04:51
1
answer

Use of instance attribute inherited from parent class

I have the following code: from PyQt5.QtWidgets import QMainWindow,QApplication from PyQt5 import uic class Primera(QMainWindow): def __init__(self): QMainWindow.__init__(self) uic.loadUi("Inicio.ui",self) self.pr...
asked by 01.08.2018 / 05:52
1
answer

How to split a .csv file by a field

It turns out that I have a file, in which to save the surveys and questions (columns) for example: opinion|date |¿Tienes coche?|Color coche|¿Tienes móvil?|Tipo_contrato|Seguro hogar Coches |28/08/18| Si |Rojo |...
asked by 29.08.2018 / 15:53
1
answer

Work JSON concrete values of an API

After making a request to an API I get an answer like the one shown below. { "mensaje": "success", "respuesta": [ { "tiempo": 594, "total": 1543419350 }, { "tiempo": 627, "total": 1543425114 }...
asked by 28.11.2018 / 11:01
1
answer

Associate an event double click on a QTableWidget to a slot and get the row

I am trying to double-click on the row of a table to call the method and know which row it is. I tried to do: def Tabla(self): #Boton de exportar a excel toolButton = QtWidgets.QToolButton() icon1 = QtGui.QIcon() icon1.addPixma...
asked by 23.08.2018 / 11:16
1
answer

Send the output of os.system () to a variable

I'm doing a program that uses a socket to send a string from the client to the server and that string is saved in a variable and the following happens: cmd = sock.recv(1024).decode() os.system(cmd) The thing is that I want to send the outpu...
asked by 26.07.2018 / 07:22
1
answer

Resize image with QPixmap

I'm trying to change the size of the image but it does not work, this is the code: pixi = QtGui.QPixmap.fromImage(image) pixi.scaledToWidth(150) pixi.scaledToHeight(150) self.label.resize(150,150) self.label.setPixmap(pixi) but...
asked by 18.07.2018 / 08:01
1
answer

Deactivate QMenu self-selection

A simple question how can I disable the auto-selection of a qmenubar. what I want to deactivate is the option that when clicking on a Qmenu the click action remains when passing to the other buttons     
asked by 19.07.2018 / 04:24
1
answer

How to display an image from the web in a QMainWindow

I would like to know how I can show an image brought from a url destro del qmainwindow. this is the code: from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5 import uic from PyQt5.Qt import * impor...
asked by 16.07.2018 / 06:41
1
answer

Show time in QStatusBar

Good afternoon I am trying to show the time in a statusbar in pyqt. This is my code: from PyQt5.QtWidgets import QMainWindow,QApplication, QDesktopWidget,QLabel from PyQt5.QtCore import * from PyQt5 import uic from PyQt5 import QtCore import t...
asked by 14.07.2018 / 20:36