Most voted "python" questions
Python is a dynamic and heavily typed programming language whose design philosophy emphasizes usability. Two similar but incompatible versions of Python are in use (2 and 3). Please mention the version you are using when asking a question about Python.
Learn more…8,642 questions
Sort by count of
-
-1
votes1
answer104
viewsDiscord.py error in client.send_message(), need help
I am very beginner and started making a bot with the Discord.py library, but when using this code: @client.event async def on_member_join(member): canal = client.get_channel("50694371938855479491")…
pythonasked 4 years, 5 months ago Leandro Furtado 11 -
-1
votes1
answer84
viewsDiscord.py client.join_voice_channel() has changed but I try to match the new documentation and it still doesn’t work!
Hello! I’m starting to practice Python in addition to the videos classes I try to practice creating some bots for DISCORD and trying to understand the library that is used. But my code to add the…
pythonasked 4 years, 5 months ago Leandro Furtado 11 -
-1
votes1
answer29
viewsListbox with synchronized selection
Hello! I am studying about Tkinter and I would like to know if it has how to make the two Listbox that I create, have synchronized selection, and also if it is possible to do the same thing with the…
-
-1
votes1
answer218
viewsHow can I call an SQL query function in Python?
Hello, I am creating an application for studies and a question has arisen. It is divided into 3 files, a main, a database and another app. In the main I put the main menu so that the user choose the…
-
-1
votes1
answer42
viewsFor some reason I don’t know, this code is ignoring the complex part of the graph being that I need it. Could someone help me?
from qutip import* import numpy as np import matplotlib.pyplot as plt import cmath #Definitions omega=4 gamma=omega/4 #parameters E1=-1/2 E2=5/2…
-
-1
votes2
answers7986
viewsMake a Program that reads three numbers and shows them in descending order. Python
Hello, I’m trying to make an algorithm that reads three numbers in Python and delivers them in descending form. The code is right, but I know you can write better only using logic... a =…
-
-1
votes1
answer371
viewsPicking up texts within a column within a Python table
I always use variations of this code in other tables and it usually works, but this one I try anyway and it doesn’t work, what I’m doing wrong? url =…
-
-1
votes1
answer293
viewsPython programming (calculating average with shares, average case less than set value)
I need your help to solve an issue of my programming course, I have an initial activity and do not know where to continue, I need to create a program that gets 2 grades, disappear and divide by two…
-
-1
votes1
answer45
viewsDisplay other output before input
I’m creating a code to analyze the activities sent by the students of a school. The idea is to make each activity appear, one by one in my notebook and through an input I trigger other codes,…
-
-1
votes3
answers121
viewsPython - Spaces appear out of thin air when printing print()
I have a problem with my function, I am very beginner in python so I do not understand much of the language, so I apologize if it is a very amateur mistake. When I print on the screen the result…
-
-1
votes1
answer578
viewsTrying to create a python Discord bot
Hello! I was programming a bot in python with the following command import discord from discord.ext import commands client = commands.Bot(command_prefix = '-') @client.event async def on_ready():…
-
-1
votes1
answer90
viewsProblems with CSV file (python)
I am using a basic code of a channel, but I would like to remove the data quarterly, so I changed the link of the original code only, but when trying to run the program I have a problem, I am…
-
-1
votes1
answer258
viewsHow to convert multiple columns from Object to Numeric in pandas?
good afternoon. I have a problem in an Aceleradev activity in Data Science, I would like a help. When I call the function . info(), it displays the values below: countries.info() <class…
-
-1
votes2
answers36
viewsArchive being written in several lists!
I am developing a simple program in python, where I need to manage the stock of a store. When I try to have the products saved in a single list, they end up being saved in several, making it…
pythonasked 4 years, 4 months ago PedroPoiate 11 -
-1
votes1
answer142
viewsI cannot use the python chatterbot library
I’m trying to create a bot for personal purposes so I tried to install the python chatterbot but when trying to run the code it accuses an error I already tried to install other versions of Python…
-
-1
votes1
answer103
viewsBuildozer failed to execute last command - Kivy
Hi, I’m trying to create an apk with buildozer,but it’s giving an error, I need help to understand it and solve. I use Xubuntu and have updated absolutely everything. Remote: buildozer android debug…
-
-1
votes2
answers56
viewsvariable is not saved in programming
I’m learning python and I’m trying to program a platform to play table rpg my intention was to assemble a code that would take the name of a character that would be placed in an input and add it…
pythonasked 4 years, 3 months ago Luis Fernando Rodrigues 1 -
-1
votes2
answers865
viewsPython - Pysimplegui - Program error when finished
Hey there, guys! I’m new to programming and I’ve been studying Python for a few weeks. I am working on a program that basically, picks a price whatever you type (in Real) and applies a percentage to…
-
-1
votes1
answer37
viewsBot does not enter values within the def function, using send Keys command with the Selenium driver
I am creating an automated design using the Selenium driver. I’m starting with Python actually, and when I create the def function below, it’s locating the elements but it’s not typing the values.…
-
-1
votes1
answer61
viewsHow to find a variable from another function in the function’s IF?
Good morning, This program that I am practicing, already has other answers, however I decided to increase in another way. The program asks to request the value of the working hour and the amount…
-
-1
votes1
answer452
viewsHow to make the columns of the Floyd Triangle perfectly symmetrical?
I’m developing an algorithm to form and display a Triângulo de Floyd with n lines. The code is just below: n = int(input(f'Digite o número de linhas: ')) m = 1 for c in range(1, n + 1): for i in…
-
-1
votes1
answer28
viewsHow to resolve Templatesyntaxerror in Django?
This is my code snippet, and as you can see, I close the block at the end, but I keep getting the bug {% extends "encyclopedia/layout.html" %} {% block title %} Edit page {% endblock %} {% block…
-
-1
votes1
answer157
viewsHow to add values in excel in python
Good afternoon, I am trying to add values in excel spreadsheet that is creating inside the program, the problem is that when the loop comes back, it does not add but it replaces what was already in…
pythonasked 4 years, 3 months ago Henrique Martinelli 1 -
-1
votes1
answer47
viewsEdit key value in Windows Registry and create rule in windows firewall with Python
I need a python preject to change the port in the windows registry (HKEY_LOCAL_MACHINE System Currentcontrolset002 Control Terminal Server Winstations RDP-Tcp Portnumber) and (HKEY_LOCAL_MACHINE…
-
-1
votes1
answer158
viewsGet a specific XML field
I’m creating a program in python which aims to get data from an XML, I am using xml.etree.Elementtree for this, I am using a for to call the fields cEAN I need, but the for returns an element list…
-
-1
votes3
answers740
viewsProblem with python library - Selenium
Hi, I’m looking to learn a little more about WEB interactions with some languages. The language I’m focusing on is Python (I already have some knowledge). I am using the Selenium library - webdriver…
-
-1
votes1
answer50
viewsDjango: Template not found :(
Good afternoon, you guys! I’m creating a url that will update the information sent in the form. I never worked with a url that pulled an id, and now I’m getting an error that Templatedoesnotexist…
-
-1
votes1
answer322
viewspython emailing with several attachments
Good afternoon, I am new to programming especially in python and I am trying to send all the files of a certain folder as an attachment in an email. And digging on the Internet I managed to get to…
-
-1
votes1
answer41
viewsVariables outside the function
I am using the code below to read Pdfs with the Tkinter interface: import io from pdfminer.converter import TextConverter from pdfminer.pdfinterp import PDFPageInterpreter from pdfminer.pdfinterp…
-
-1
votes1
answer41
viewsDoubt in Python code using Tkinter
I’m reading Head First Programming in Python and presented the following error in the execution of a proposed program: Traceback (most recent call last): File…
-
-1
votes1
answer629
viewsWhy are you giving the error string indices must be integers?
I’m a beginner in python I’m trying to plot a graph by calling the function: def plota_grafico(sistema, resultado, r, variavel) As I have few variables I have created blocks of if depending on the…
pythonasked 4 years, 2 months ago Larissa Gargiulo 9 -
-1
votes1
answer75
viewsf. write (python) writes "None" to the file
Hello, I am beginner and am trying to create a program that generates a text file but each line being random (based on predefined phrase). The code works and does not return errors at the prompt,…
-
-1
votes2
answers95
viewsString inside Python list
Have string in Python stored in a variable and I want to check if it exists within a list. I used the in for that more even with the output equal to that in the list it does not return me correctly…
pythonasked 4 years, 2 months ago user198451 -
-1
votes1
answer98
viewsFunction returning only one value
I am making a program in Python and need to implement a function. The function receives as input two parameters: A dictionary containing as key the name of an employee and as value a list containing…
-
-1
votes1
answer49
views -
-1
votes1
answer219
viewsSeparate list of names according to regex notes
How to resolve this with regex? The archive assets/grades.txt contains a list of people - one per line - containing your notes. Create a regex to generate a list of students who received grade B.…
-
-1
votes2
answers85
viewsAnalyze Data with python
I have a cvs file with two columns, one of a month (January, February, etc.) and another with value (relative to each month), and I want to create a graph (of bars for example), but gives the…
pythonasked 4 years, 2 months ago Guilherme Farias 33 -
-1
votes1
answer55
viewsLoop of python repetition
Hello I have a for that extracts data from an XML file and I wanted to iterate a count to show as for example like this: 1- O EAN é 7897748715180 2- O EAN é None 3- O EAN é 7897748729941 4- O EAN é…
-
-1
votes2
answers74
viewsFind a string inside a python list
Hello I have a spreadsheet xls and a XML where I read this information and my goal is to find information from XMl inside the spreadsheet for this I am using the method IN more can not find THE XML:…
-
-1
votes1
answer57
viewsIndexerror: list index out of range
Can anyone help me? I’m getting the error below, I understand that the program tries to access a non-existent position, but I can not fix... The code is a job I have to complete and increase:…
pythonasked 4 years, 2 months ago samuelsilvaop 1 -
-1
votes1
answer612
viewsFunction to calculate the average of two notes in python
I have difficulty creating two functions: one that calculates the average of 2 grades and another that tells in which situation the student is "approved", "failed", and "recovery". My code is giving…
-
-1
votes1
answer80
viewsRemove characters from python lists
Hello I have a code that le two files one txt and a XML and then checks a string inside a list THE XML: <nfeProc xmlns="http://www.portalfiscal.inf.br/nfe" versao="4.00"> <NFe…
-
-1
votes1
answer39
viewsError reading a python txt file and adding variable
I have a problem with an automation I use. I use a TXT with some information but in IF I don’t 'recognize' the variable I added in TXT. import sys import webbrowser import random import time import…
-
-1
votes1
answer1122
viewsPython/Selenium - no such element
Hello, I’m developing a Python automation with the Selenium library to access the Econet website and retrieve data from a table from an NCM code. At first I wrote the code to open the browser,…
-
-1
votes1
answer53
viewsPython - print blank cells in excel
Hello, I am developing an automation to check in an excel spreadsheet which customers did not make the payment. The code itself works, but only shows me the last column of the spreadsheet, which in…
-
-1
votes1
answer60
viewsChecking for data inside a list of lists
I have a list of lists. So: lista = [['2746', '8512.20.21', '2 - Estrangeira - Adquirida no mercado interno, exceto a indicada no código 7', 'SL-121410', '6949999876781'],['2747', '8512.20.21', '2 -…
-
-1
votes1
answer690
viewsstring indices must be integers
I have a Json that returns this data: "errorCode": 0, "result": [ { "username": "Captain Samafa", "callsign": "24K", "latitude": 39.7100376616406, "longitude": 59.01369415537506, "altitude":…
-
-1
votes1
answer123
viewsI cannot click on the alert using Selenium
When clicking a button, an alert is issued asking me to confirm, it turns out that I already tried using Pynput to confirm with ENTER Key.press. But it didn’t work. The alert is in another window,…
-
-1
votes1
answer463
viewsGoogle Gspread colab and pandas
I started using google colab to do some analysis of the company and it gives the option to instead of reading the csv file, already automatically read the existing file in the google sheets in the…
-
-1
votes1
answer50
viewsSet default location to save file
I am creating a script in python to convert all the files of a folder into another format informed by the user, but I wanted to ask only once the location to save the files. I tried to use…
pythonasked 4 years, 1 month ago peptidoglycan 1