Most voted "python-3.x" questions
Python 3 is the latest version of the Python programming language and was formally released on December 3, 2008.
Learn more…3,274 questions
Sort by count of
-
0
votes1
answer30
viewsContext Menu does not appear on tray icon when I click with mouse
I’m creating an app that has a tray icon (QSystemTrayIcon) and I want him to have some options to control the application. For this I created the class below: class QTrayIcon(object): def…
-
0
votes1
answer39
viewsHow to run widgets that use Qtimer from a different Thread?
I created an application where the user presses a certain key combination - using the package pynput - and a message from a "Qtoaster" appears on screen. Below is an example code: from pynput import…
-
0
votes0
answers9
viewsActivate Fields with Radiobutton Qtdesigner
On the main screen, I have a radiobutton with two fields of lineEdit. When the radiobutton is clicked (check), the lineEdit1 needs to be released and the lineEdit2 needs to be blocked. And so vice…
-
0
votes0
answers22
viewsSkip Textinput to kivy
I am developing an application that collects data from the user through Textinput widgets. I can do this task of "taking" user data and storing it. However, my software only accesses the text fields…
-
0
votes1
answer75
viewsHow to add a Qpushbutton to Qtablewidget?
I am creating an application in Pyqt5 with a table, using the classes QTableWidget and QTableWidgetItem. The table has three columns - the first two are just texts and the last one is a button,…
-
0
votes1
answer62
viewsAccessing a Pyqt5 Widget and modules within a package
I am making a program using as GUI the framework PyQt5, using UI files. I’m having trouble accessing the module inside the file .py that I create so that I put the functions inside them and thus…
-
0
votes2
answers75
viewsLoop two functions at the same time
I would like to run two functions at the same time in Python, follow my code: import socket from pyftpdlib.handlers import FTPHandler from pyftpdlib.servers import ThreadedFTPServer from…
-
0
votes0
answers10
viewsPortscanner made with scapy returning None
I have a list with doors like portas = [21,22,23,53,80,443], and I go through this list and send the packages: for porta in portas: resposta = sr1(IP(dst='qualquerendereço.com')/TCP(dport=porta,…
python-3.xasked 3 years, 5 months ago Rafa0712 1 -
0
votes0
answers14
viewsHow to show multiple lines on an output line (output)?
I study in the course of Computer Science. I made a simple encryption using Caesar’s Cipher. I managed to encode, but I have a problem that is that my program shows several lines in output, which I…
-
0
votes1
answer73
viewsPysimplegui - Button Alignment in Columns
Good night, I am trying a problem with the alignment of 2 columns, what happens is that the second column has a button and I would like to leave it aligned to the right (as in the second image)…
python-3.xasked 3 years, 5 months ago DiegoAL 1 -
0
votes0
answers22
viewshello, I would like to understand these two code in Python and what is the function of (self) in the set_name function
hello, I’m new to Python and programming in general, I just got into object orientation and I can’t understand why 'self' in the following code functions; I think because I studied an introduction…
-
0
votes1
answer44
viewsAllow maximize and minimize windows in Pysimplegui
I’m trying to make a text/note program, like Word or notepad in Pysimplegui. Before I started doing it, I needed test programs, and in one of them I have a problem: allow to maximize and return to…
-
0
votes1
answer33
viewsGroup By without merging python data labels
Hello, people, I have the dataframe below and I need to group and add the columns. For this I am using groupby, but in the result the labels are cancatenated, there is a way that this does not…
-
0
votes1
answer88
viewsCount dataframe lines with string according to position in Python text
I have a dataframe with a text column, as follows: import pandas as pd df = pd.DataFrame([["1", "texto com PALAVRA frAse PARAGRAFO", True, "foo"], ["2", "texto com palavra Paragrafo", False, "foo"],…
-
0
votes0
answers15
viewsFlask download multiprocess video
I’m doing a project to download videos from a website and store them in a folder on the computer. Here’s the thing, I got a route @app.route('/baixar', methods=['POST']) who is responsible for…
-
0
votes2
answers60
viewsDoubt in python with Opencv
Hello, I need to display a certain area of the image with the borders, using the Canny, and display it on top of the image itself, as in the example below. My code displays the selected area and…
-
0
votes0
answers40
viewsComparing names from two different lists - ideas on ways to compare
I’m trying to compare company names between two different lists. The case is as follows: both lists may contain different names for the same company, for example: Nome1: Escalar Nome2: Escalar Group…
-
0
votes0
answers30
viewsI want to remove all text that has % of a PDF. but it does not return me the result
I am trying to get back an administration rate of several PDF’s, however these PDF’s do not follow a standard, so I want to bring all the percentages that contain in this PDF, so the final file…
-
0
votes0
answers12
viewsHow to fix a window over others with Tkinter
I would like to leave a fixed window on all others that are also open and maximized, even if the user clicks on other windows. The language is Python with the Tkinter library. Here is a minimally…
-
0
votes1
answer22
viewsIF no pandas returning The Truth value of a Series is ambiguous. Use a.Empty, a.bool(), a.item(), a.any() or a.all()
I have a DS with two columns, one with a month from 1 to 12, and another with a year from 2015 to 2021, and I’m trying to create a column called Fiscal Year. I am creating a function so that when…
-
0
votes1
answer92
viewsDoubt in Python Exercise Logic (Beginner)
Hello, I recently started my study in Python Programming Logic. I have a small base in C. I came across an exercise on the Internet where it says the following: "Make a Program for a paint shop. The…
-
0
votes1
answer20
viewsHow to change what is written on a Tkinter. Text in Python?
In a tkinter.Entry, to change what is written I could put a StringVar in a textvariable and I could change this StringVar there is any moment that would be changed in the tkinter.Entry also But in a…
-
0
votes1
answer41
viewsHow do I send multiple requests to the same URL (same API) in Python?
I’m calling an API that creates table in Hive. I’m developing an automated test script to make 30 requests and be able to create 30 tables in Hive. For this, I put a logic in which the tablename for…
-
0
votes0
answers29
viewsHow to paste with correct indentation?
It’s always a lot of work to fix indentation after copy and paste, but is there a way to paste with correct indentation? For example: x = int(input("0 ou 1? ")) if x == 1: print("ON") if x == 0:…
python python-3.x visual-studio-code ipython-notebook indentationasked 3 years, 3 months ago CrashXY 109 -
0
votes1
answer29
viewsPandas group into groups with a determining range
beauty? I’m trying to group values of a dataframe called df_agenda by age, wanted to group the values in this way in the age: of (0-20),(20-40), (40-60) and so up to the maximum value of the list of…
-
0
votes0
answers16
viewsCx_freeze. Error with Cx_oracle client when running the program on another computer
I developed a GUI program using Pyqt5 for users to feed a "Mysql" database (which is installed on a server on the same network as other computers). However this program needs to get information from…
-
0
votes2
answers45
viewsDjango - No module named 'polls'
Hello, I’m starting to study Django (current version: 3.2.5), and I followed this article in an attempt to configure it (version consulted on 07/29/2021):…
-
0
votes3
answers34
viewsError clicking the Tkinter Python button
Hello I am developing a python application using Tkinter but I don’t know why it is giving me error. I was inspired by an example. My code. from tkinter import * win = Tk() win.geometry("400x150")…
-
0
votes0
answers12
viewsHow to open an external Python file as a subwindow of the main application?
I’m a beginner in Python and I’m developing an MDI application. Knowing that it will be extensive, I thought it would be better to separate the code into files. I already have two: main py. (main…
python-3.xasked 3 years, 2 months ago JC Carmo 1 -
0
votes1
answer22
viewssmtplib.Smtpserverdisconnected: Connection unexpectedly closed
I was trying to send an email with python: import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText host = 'smtp.gmail.com' port = 587 user =…
-
0
votes0
answers22
viewsTkinter error on re-entry
Was using tkinter, I made the code normally, and when I ran the same, everything was working normally, but when I left the program and entered again it gave error: my code: from tkinter import *…
-
0
votes0
answers8
viewspython: cv2.error "NULL window Handler" in linux Mint
I’m running a script to learn how to use trackBar in Opencv within Linux Mint. The problem is that sometimes I run and it works normally, sometimes it gives a "Null window Handler" error and other…
-
0
votes0
answers13
viewsHow to increment a variable in the middle of an sql query in Flask?
Hello, I’ve been trying for a while to receive and insert an image that needs to be BLOB type in Mariadb bank with Flask. However, when I try to insert the image into the bank with flask I get the…
-
0
votes0
answers25
viewsList of 3 positions. Each one contains a list of two positions both integers. Sort by largest integer of 2nd position
listaSupermercados1 = [[1, 10], [2, 20], [1, 15]] def comprarBananas(listaSupermercados): listaSupermercados.append(listaSupermercados) comprimentoLista = len(listaSupermercados) -1 posicao = 0…
python-3.xasked 3 years, 2 months ago Rafael Muinarczyki 1 -
0
votes0
answers27
viewsPython Inverted Index
Problem: I need to create a Dictionary of inverted indexes where I should tokenize the string, remove the stopwords and extract the word root (stemmer) all using the nltk package. The output of the…
python-3.xasked 3 years, 2 months ago marcelim122 21 -
0
votes0
answers24
viewsPYTHON - Create sub-function to monitor main function execution and restart if needed
The following function runs 24 hours a day (every 35 minutes on average), exporting information and clicking on a given system. The problem is that sometimes the fault occurs and the code does not…
python-3.xasked 3 years, 2 months ago Rafael Obregon 1 -
0
votes0
answers13
viewsKernel stuck in "Busy" after cell execution
I’m trying to run the following cell of a Jupyter Notebook: for cada_carteira in range(numero_carteiras): peso = np.random.random(numero_acoes) peso /= np.sum(peso) retorno = np.dot(peso,…
-
0
votes1
answer16
viewsUse of _set in Django framework
I’m following the framework tutorial but I got lost in the use of the command _set of the shell initialized by python manager.py shell. The sequence of commands is as follows:: from polls.models…
-
0
votes1
answer16
viewsPython Pandas - Insert list items in order in a column
That’s the kind of doubt that gets hard to even explain, but let’s try. Follows the code: data = {"Id": ["01", "02", "03", "04",'05'],"Fruta":…
-
0
votes0
answers12
viewsError using find_element_by_tag_name - Selenium python
I am trying to access the following element on a web page: [! [insert image description here][1]][1] The code I’m writing is this: import os import time import bs4 from selenium import webdriver…
-
-1
votes3
answers1472
viewsProblem using if Elif Else (Else error)
n = input ("informe seu nome ") b1 = float(input("informe sua nota em Biologia no 1º Bimestre ")) b2 = float(input("informe sua nota em Biologia no 2º Bimestre ")) b3 =…
-
-1
votes1
answer117
viewsExport data to a file . cfg
Could someone give me an example of how to export my models data by pk to a file . cfg? tried to use Mymodel.objects.get(pk=pk) but it didn’t work out so well.
-
-1
votes2
answers1638
viewsHow to test if a host port is open?
How to find out if a particular port of a network computer is open? The more efficient the method, the better. I will need to scan an entire subnet several times a day.
-
-1
votes1
answer1670
viewsCharacter to binary conversion
I’m developing a little python application that needs character to binary conversion. However, I want to know if there is a specific function for this type of task.
python-3.xasked 8 years ago Cesar Brito 51 -
-1
votes2
answers1377
viewsHow to start a Python application with Windows?(cx_freeze)
Hello, I’m trying to develop an application that starts together with windows, but I’ve tried to get the program to auto copy to the folder "C: Users User Appdata Roaming Microsoft Windows Start…
-
-1
votes1
answer347
viewsKivy importing from the terminal does not work, but in IDLE it usually matters
I had enough difficulty installing the kivy and get it working on Ubuntu. But now I can’t make the kivy work in interactive mode directly from the terminal, but I can do it through IDLE. Can anyone…
-
-1
votes4
answers21505
viewsHow do python select the largest number of a set?
Good afternoon, I’m inputando numbers in python, but I don’t know how to add them to a set and then make python decide which is the largest number in the list. Grateful
-
-1
votes4
answers634
viewsFind and delete different characters between strings
lst1 = ["carro"] lst2 = ["carroa", "carrooao"] How do I check if the word in lst1 exists in any substring of lst2. If it exists delete the excess characters of the word that has the substring,…
-
-1
votes1
answer71
viewsHow to get a correct value using the point?
preco_casa = float (input("Qual o preço do imóvel?")) seu_salario = input("Qual o seu salário mensal?:") anos_a_pagar = input("Quantidade de anos a pagar pelo imóvel:") valor_prestacao = preco_casa…
-
-1
votes1
answer258
viewsScraping data from a website with dynamic filtering
The search platform of the programs conceptualized in Capes has a dynamic filtering for the query itself. I would like to know how I collect data from an output using Python. Why, using only bs4…