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
answer334
viewsHow to do a file search using Python
Problem: Implement the function search(), which accepts as input the name of a file and the path of a folder, to search for the file in the folder and in any folder contained therein, directly or…
-
0
votes1
answer108
viewsFunction statement within Python FUNCTION
I’m trying to declare a function that shows a line below the result of another function. This line adapts to the size of the returned result in the 'main' function. Follow the code and error message…
-
0
votes1
answer146
viewsRead binary file using struct created in C++
Good afternoon to all, I would like to read a binary file created in C++ using the following structure: struct STRUCT_MOB { char MobName[NAME_LENGTH]; // The name of the mob // 0 - 15 char Clan; //…
-
0
votes1
answer141
viewsUse Python to import locally saved htm file information
I have an htm file with the following code: <html> <head> </head> <body bgcolor="#FFFFFF"> <p><strong><big><big><font face="Arial"…
python-3.xasked 4 years, 9 months ago Gilson 13 -
0
votes1
answer35
viewsDict with repeated Python attributes
Good afternoon! I’m putting together a formdata for a post, formdata = { 'data': '', 'controle': 'ADMIN', 'g-recaptcha-response': recaptcha_response } for numero in nDams: formdata['nu_dam[]'] =…
-
0
votes1
answer84
viewsHow to work with super accurate Python values?
I’m creating an algorithm and I’m encountering a strange problem, I have a set of precise values and an unknown goal, basically a neural network. I used several tactics to optimize weights and now…
-
0
votes1
answer52
viewsThe URL responds only with the open site
I need to scrape the information from this page here. In the developer tools, I found this link with the necessary answers. The problem is that the link with the answers opens only if the site is…
-
0
votes1
answer82
viewsI want to put 2 exceptions for my program validate data
a = (''' Escolha a conversão que você deseja realizar: 1) Celcius-Fahrenheit 2) Fareheint-Celcius 3) Celcius-Kelvin 4) Kelvin-Celcius 5) Fahrenheit-Kelvin 6) Kelvin-Fahrenheit ''') try : a =…
-
0
votes1
answer973
viewsCould you create a function to decrease the number of if’s in the program?
There is a way to make a function that can reproduce that amount of if’s in the program so that they do not appear ? mensagem = (''' Escolha a conversão que você deseja : 1) Celcius-Fareheint 2)…
-
0
votes2
answers107
viewsSave manipulated audio files keeping the original name
I’m using an algorithm I found to perform noise cleaning of WAV files, but I need to run this algorithm in more than a thousand files and I need to keep the original name of the file that will be…
-
0
votes1
answer59
viewsDoubt about the replace() method
The replace() method is a method of the str class, correct? Follows a code that 'rotates' perfectly where the object is an integer (or at least in my interpretation). Or in the case of interpolation…
-
0
votes1
answer662
views'Nonetype' Object has no attribute 'groups'
I’m using a function in mine Templatetagsdjango that basically checks if the user is in the group that has the permission for the given button. The return 'True or False' works well, IE, it shows…
-
0
votes0
answers919
viewsTypeerror: Imgoriginal() Missing 1 required positional argument: 'self'
I’m creating a program using Python3 and Tkinter. As I am working with classes and the code is giant I cut out only the part that has been error. I set a function to be used as a Scale command in…
-
0
votes0
answers369
viewsPyodbc Error: ('HY000', 'The driver Did not Supply an error!')
I’m having a little trouble using the pyodbc to connect to an MS Access. Until a few days ago, everything was operating normally, but after updating my Anaconda, a persistent error occurred in the…
-
0
votes0
answers125
viewsVCRUNTIME140.dll was not found running cx_freeze executable
A few days ago I developed a Python application and managed an executable using the package cx_freeze with the following code: from cx_Freeze import setup, Executable setup( name = "Minha…
-
0
votes1
answer103
viewsForm Django Loads Values but Not Saved
I did a lot of research on my case on the Internet and I couldn’t find an answer that fits my problem. Following the tip of JACKSON MOURA in this answer you gave me in another case this one: Doubt…
-
0
votes1
answer87
viewsIs it possible, somehow in python, to create attributes in a class that is common to all objects?
Is it possible, somehow in python, to create attributes in a class that is common to all objects? And somehow if it is changed during the execution of the program change to all objects already…
-
0
votes1
answer399
viewsFind equal records in two databases(csv)
In two files .csv, how can I know whether or not a particular user is in the files ? These files have a different number of columns, but they have in common some fields (columns), for example: NOME,…
-
0
votes1
answer466
viewsHow to make a sequence dates in python?
I need to create a date array of 2018-01-01, 2020-01-11, the dates being nay can be continuous (eg 2018-01-01, 2018-01-02, 2018-01-03...) and include the ends. The closest I could get was: import…
-
0
votes1
answer74
viewsError trying to save git repository log to txt (Python) file
Hello, I’m trying to write a code in Python to save a git log from a git repository to a file . txt in a different directory using the function subprocess.Popen(). I know the command line syntax is:…
-
0
votes2
answers954
viewsRead a txt avoiding problems with python accents
I’m trying to read a txt file but using the function below to display colors in the terminal and whenever the file has accents it returns me all messed up. COLORS = {\ "black":"\u001b[30;1m",…
-
0
votes2
answers737
viewsRestarting a Python script with Input
I have the following program below in Python with 2 functions, one to convert real in dollars according to the quotation, and one to convert dollars to real also according to the quotation, plus a…
-
0
votes1
answer164
viewsNamed async Python class
I would like to call a class that does a post for an Endpoint but that this call was not blocking, because it is inside an event that sometimes triggers 5 cohorts in a row and I can’t wait for the…
-
0
votes1
answer65
viewsDuplicated, how to pass more than one parameter?
I have two CSV, I want to compare more than one field using duplicated. Is there a way, or can I just pass one parameter at a time? I followed the direction of Clayton Tosatti and I got here, but…
-
0
votes1
answer93
viewsBasic closures
Sirs, I’ve been studying Python for about four months and now I’m entering the most complex concepts of language. I’m having a little trouble assimilating decoradores but I understood that first I…
-
0
votes2
answers108
viewsDoubt Python with Firebird database query
Hello I have a problem with the Firebird database query. I make the connection with the bank and step this query, but the problem is in return, it returns the name of the normal product only that…
-
0
votes2
answers142
viewsProblems for player play order in Tic-tac-toe
I have trouble with the job players(), because I can’t increment the variable n, the function is only returning "X". I know it sounds pretty simple, but I can’t identify the problem. Can anyone help…
-
0
votes1
answer30
viewsTkinter interface appearing separate
The interface works, but appears divided; part of the code in one window and part in another. The code was originally generated with PAGE, but then I changed to either get rid of the support file or…
-
0
votes1
answer129
viewsPyqt5 Error Installing Pyqtwebengine
Hello, I was trying to create a browser with python and when I installed Pyqtwebengine, my Pyqt5 stopped picking and no longer works, it shows a compatibility error but can not solve, I tried to…
-
0
votes1
answer148
viewsError while trying to create new field in a model in Django
When trying to create a new field in a model while creating an api, I get the following error when running the command runserver: That would be the class: class Person(models.Model): teste =…
-
0
votes1
answer102
viewsCheck WORD style in DOCX via Python
I am trying to verify a document (.DOCX) And pick up the text that is with a certain style. Turns out the code I came up with in my attempts can only get the whole paragraph. I’d like to take part…
-
0
votes2
answers860
viewsCheck if number is equal to the sum of squares of 4 consecutive prime numbers
I need to do a program where I type a number and the program checks if it is the sum of the square of 4 consecutive primes. Example: 2020 has to give 17 2 + 19 2 + 23 2 + 29 2 My code for now is…
-
0
votes1
answer164
viewsTransform column with Nan and string to integer
I have a dataframe with the following column: Years 0 1990 1 1990 2 1990 3 1991 5 NaN 4 1994 6 NaN ... ... Name: Years, Length: 9742, dtype: object I have already performed part of the cleaning of…
-
0
votes1
answer119
viewsHow to join two lines in the same scale of the graph?
Hello! I have the following code: def createGraph(): plt.title("Evolution of COVID-19") plt.xlabel("Days") plt.ylabel("Infected People") countries = ['China', 'Italy'] days = [1,...,63] #Array from…
-
0
votes2
answers64
viewsHow to select methods in a function and add results in a list?
I’m trying with a function of this kind, which is in my main: if __name__ == "__main__": run_experiment(outros_parametros,['LA', 'RF', 'DT', 'ARD', 'PCA']) Cause only a few methods to be selected,…
-
0
votes1
answer119
viewsHow to upload large files to google drive
I’m trying to upload files from 1-4gb to the google drive(v3) , using phyton3.8, but when I always have errors in the execution: Typeerror: 'Preparedrequest' Object is not callable def…
-
0
votes1
answer89
viewsHow to read an array of arrays and save each array[ ] into a different variable to run function with barplot?
How can I read this array of arrays: [45 32 56 57 44 21 36 35 39 23 24 27 25 26 31 28 29 30 20 22 18 8 19 1 33 2 3 4 0 6 7 9 17 10 11 12 49 55 13 14 15 16 52 46 43 34 41 37 40 5 54 51 53 47 38 42 50…
-
0
votes0
answers50
viewsError trying to use a Custom User Model. Attributeerror: Manager isn’t available; 'auth.User' has been swapped for
Hello. Trying to create and use Custom Usermodel when running makemigrations or even running the server gets the error: AttributeError: Manager isn't available; 'auth.User' has been swapped for…
-
0
votes0
answers113
viewsCode error (Python, Pandas and Excel)
I made a code to pick the time and day of the week and so picks up the cell of the excel spreadsheet and should inform me, but it is going wrong when picking up, besides on Tuesday (incicaçao ES)…
-
0
votes1
answer117
viewspython3 Tkinter scrollbar problems to insert
good morning, I was creating a graphical interface with python and for that I used Tkinter and I was trying to create a scrollbar inside my project but it does not recognize the command to connect…
-
0
votes1
answer74
viewsResult in a Python Dataframe
I have the following code: import numpy as np import pandas as pd import psutil as ps names = [] for service in ps.win_service_iter(): info = service.as_dict() listOf = [("Name:%s; "…
-
0
votes1
answer48
viewsError " Indirect fixture" when using pytest with a python factorial function
I’m studying recursion and automated testing and decided to implement a recursive factorial: def fatorial(n): if n <= 1: return 1 else: return n*fatorial(n - 1) import pytest…
-
0
votes7
answers1969
viewsHow to remove repeated numbers from a python list
Hello guys I’m doing a course in python and currently I Completed this exercise. Write the remove_repeated function that takes as a parameter a list of integer numbers, checks whether such a list…
-
0
votes1
answer124
viewsHow to get a person’s friends and followers on Twitter using the tweepy library?
The function getting_friends_follwers() below works if I remove the value 100 from (cursor2.items(100)) . My goal is to take these names (followers and friends) and save in a file "friends.txt". The…
-
0
votes1
answer27
viewsPrintable images with the Pillow library
I am developing an automatic certificate issuance project where I use the pandas to pull the names of a spreadsheet and Pillow to write the names in the certificate. The problem occurs when printing…
-
0
votes0
answers29
viewshow to get the result of multi processes in a list in Python3
I am creating a robot that at a given time needs to make multiple HTTP requests at the same time and, return the result in a list. The code so far is like this: import requests import simplejson…
python-3.xasked 4 years, 6 months ago LeandroLuk 4,989 -
0
votes1
answer64
viewsReduce running time in Python simulation
Hi. I’m trying to solve a problem where I have to create a function that receives a string of 0 and 1 and a list of commands, which can be 'I' and 'Q'. If it is 'I' the program must modify all…
-
0
votes2
answers88
viewsProblem with Python print formatting
This code is to solve a problem of URI,o 1179, it gives error Presentation, because there is a space in the answers, between brackets, the problem is in the prints inside the loops for. Can you…
-
0
votes1
answer33
viewsHow to create a class attribute with predefined Python types?
I consulted at documentation from Python, but I couldn’t find a syntax for how I could create an attribute from a class that has a predefined type. I took as an example this exercise of W3schools:…
-
0
votes1
answer99
viewsI’m creating flap by the pygame and the animation is not working well
So following as I said in the title I am creates a flap Bird , I have not yet implemented physics and the tubes however my problem is being with his animation , What’s happening is that it only…