Questions tagged as 'python'

2
answers

Why does grid layout only show me one button?

I'm trying to interface with PyQt5. I have copied an example of the internet where it shows how to make a grid and add widgets, but when I add 3 buttons it only shows me 1. What am I doing wrong? This is the code: import sys from PyQt5 impo...
asked by 26.07.2018 / 11:10
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

Indicate data in bar graph with matplotlib

I am working with a table that indicates the number of the day, the time of day and a number of visits And I want to create a bar graph that indicates the number of visits per hour (like the one in the image) But, how can I als...
asked by 14.08.2018 / 16:59
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
2
answers

I want to verify in Python if a word of an input exists in a vector

Here's the code I was trying: print("Prueba para determinar palabras") #El vector insultos con las palabras que deseo verificar claves=['hambre', 'comida'] mensaje=[] msj = input("Digita una oracion: ") #Esto separará las palabr...
asked by 07.08.2018 / 15:51
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
1
answer

How to format a string in a fixed position?

My program tries to search links on web pages And when the page is valid the application writes [+] Found [+] and if the link is not valid write [+] Error [+] but each link does not have the same length . Here is an example of how the applicatio...
asked by 26.07.2016 / 06:33
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