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
-
0
votes2
answers223
viewsMy print function does not work at windows command prompt
I’m starting to study programming. I downloaded version 3.8.3 of Python and to write the programs I downloaded the Sublime text that allows running the programs on the platform itself. When I…
-
0
votes1
answer93
viewsFunction return
Good afternoon, I have these two cases: I have a modal with <form action="{{url_for('rota')}}" and on this route I am giving an update on the information, my problem is in the return of this…
-
0
votes2
answers668
viewsProblems in the automation of sending messages on Whatsapp through the Python Selenium library
I’m with an automatic messaging project via Whatsapp that consists of sending messages provided with special characters (emojis and other symbols) saved in files . txt, however, whenever I use the…
-
0
votes1
answer1179
viewsTypeerror: '>' not supported between instances of 'tuple' and 'int'
I am making a table with name, grade and situation of each student import pandas as pd lista_nome = list() lista_nota = list() index = list() while True: print("=" * 10) nomes = str(input(f"Nome:…
pythonasked 4 years, 4 months ago user190926 -
0
votes1
answer118
viewsTypeerror: fetchall() takes in Arguments (1 Given)
When running the code below I get the title error, I tried to use a different code structure by assigning the results of select to a ma variable, tried tbm just bring a bank line with fetchone() and…
-
0
votes1
answer31
viewsHow to show the path of Filefields linked to a specific object in the template?
Good afternoon! I have a web application being made in Django, and I don’t know how to show in the template the path of all Filefields that are linked to an object. I own two models. One for a…
-
0
votes2
answers431
viewsI’m trying to write a program that calculates the monthly percentage of a distributor
I tried to solve it in Python but it did not happen I am already so many hours in that I can not think anymore so I decided to raise my hand. This is the exercise: Given the monthly billing value of…
-
0
votes1
answer47
viewshow to trigger a function via another function
i am making an app with Tkinter and need to trigger a function using another: import pynput import datetime import tkinter from tkinter import * import pyautogui import time from pynput.keyboard…
-
0
votes1
answer146
viewsSerialize in flask-marshmallow with relationship
I’m using the flask-marshmallow to make the serialize in my project. Along with it I am using flask-sqlalchemy for mapping my tables. Follows the structure: models/Area.py: config.database import db…
-
0
votes1
answer85
viewsA looping does not end to start another. How to solve? (Python)
Hello, I’m new to the forum and I’m still learning how to use the interface. If I posted in the wrong place or something like that, I’m sorry. I created an account to ask a question about a problem…
-
0
votes1
answer14
viewsPygtk + Glade: No handler button fires click another button
Hello, everyone! I am developing a Python application using Pygtk+ 3.0 with Glade 3.22.2 (and Python 3.8.1). Everything was working fine, but suddenly my program started to show strange behavior. I…
-
0
votes1
answer172
viewsHow to use os.system with Python and Django
I’m a beginner in Django and I got caught up in the following problem: I’d like to execute the command: os.system("blastp -query " + proteina.name + " -subject " + multi_fasta.name + " -outfmt=6…
-
0
votes1
answer53
viewsHow to move the title from one column to another?? (web scraping-python)
I’m trying to make a web scraping, but if you view the site you notice that certain titles are on certain columns. What my program does is take the table, create two full columns of Nan and assign…
-
0
votes1
answer42
viewsTypeerror in Python, I need to modify a string
I’m making a very simple chessboard with no rules, just changing the positions to play. I made a list of the available houses on the board and with the move function I change the positions, anyway,…
-
0
votes1
answer72
viewsChange boolean Django
would like to do an update field that changes the boolean value to true or false inside a modal so you don’t have to create a page just to edit boolean. I have the following code: in the model class…
-
0
votes1
answer71
viewsDownload file setting the header
good afternoon. How can I download a file from a site in the URL by setting the header? For example, I have a file on a site and I want to download in python, just returns me a 403 error, so how do…
-
0
votes1
answer44
viewsCreate links that can be copied or clicked on Tkinter
I created a script basically to replace links by removing some special characters. It’s functional. The problem is only the data output, because I am putting to present a label, with the link…
-
0
votes1
answer48
viewsHow to save data to a file?
I am consuming a Facebook business API and need to put the data in a TXT or CSV file. When I print the result with print, comes out as expected, but I can’t put the lines in a txt file. Exit with…
pythonasked 4 years, 4 months ago Vagner Matos 11 -
0
votes1
answer72
viewsDjango HTML does not update in browser
I believe that the structure of my project is somewhat complex. As it is a framework, I did not start it from scratch. My problem occurs when I try to make changes to the text content of HTML files…
-
0
votes2
answers102
viewsrotate a "for" loop with 5 variables together
Use a program to create audio files called stem which combines vocals, drums, melody, bass and an audio guide into a single file. I am trying to create a loop that stores these files and so the…
-
0
votes0
answers43
viewsCreate fields dynamically
I’m learning Python created a screen and inserted some fields, but when I try to create a routine to automate, make more generic I can’t. follow the code, if you can help me, thank you. from Tkinter…
-
0
votes1
answer49
viewsuser error prevention, python code
well, I have some exercises in python because I am studying, I learned to format strings and use the other tools, however, I could not find a solution not to let the user make a mistake while…
-
0
votes2
answers87
viewsI do not understand the error None in this function
I cannot understand why in the end this function does not return a string. The error is in fptr.write(result + '\n'), as if the function returns an object of type None. def dnaComplement(s):…
-
0
votes2
answers132
viewsInherit boot modules and variables in a Python script for another Python script with Gtk3
Good night! I am working with Gtk3 and Python3 and am structuring my project to build an ERP for GNU/LINUX platform. I’m using Glade to build the GUI and using Gtk Builder to manipulate the GUI…
-
0
votes1
answer62
viewsHow to place the value of an input inside a "cell" of a SQLITE3 table, with Python?
Hello, I’m a beginner in programming and, learning about the SQLITE3 library, in Python, I came across a problem and even after a lot of research I did not find the solution. I would like to be able…
-
0
votes2
answers118
viewsHow to delete a specific PYTHON file
I’m learning Python and I’m trying to make a code where I list two folders, compare the items in common. Getting the result I have to delete the item from the old folder and move the item from the…
-
0
votes1
answer89
viewsPython Selenium capturing only 1 link
Good afternoon to everyone, I’m starting to learn Selenium and have already passed me a project to do that I’m half lost. I need to capture all the URL summaries…
-
0
votes3
answers819
viewsUpdate content of JSON file
I am trying to manipulate a JSON file using Python but whenever I run the program it erases the JSON file causing me to miss the last change, has how to make it just add to the file? Filing cabinet:…
-
0
votes1
answer73
viewsPython - Error: SQLCODE=-30082r] SQL30082N Security Processing failed with Reason "24" ("USERNAME AND/OR PASSWORD INVALID"). SQLSTATE=08001
Hello! I need help with the following problem: I made a script in python to collect data from a DB2 table and generate a spreadsheet. I’m in the testing phase, but the idea is that the script will…
-
0
votes1
answer137
viewsHow do I login to the database?
I am creating a study application for a simple login screen, on the same black screen. I created 2 files, one where I create the database query and the other with the application code itself. It has…
-
0
votes1
answer879
viewshow to copy a file name using cmd and rename another using copied text (Clipboard) only with cmd windows commands
Hello. I am looking forward to facing a situation at Windows 10 CMD command prompt of "dynamic name", so to speak. SITUATION EXAMPLE: I have in my directory the following file: .../DADOS/teste.csv…
-
0
votes1
answer23
viewsDjango: imported class is not being called
Hey, guys, I created a view to return a HttpResponse simple importing a class from the models folder as follows: from .models import Album and then creating the view function: def index(request):…
-
0
votes1
answer61
viewsVariable returning value that was declared initially and not what the user reported
cont = soma = maiorv = media = 0 r = 'S' menorv = 0 while r in 'Ss': n = int(input('Informe um número inteiro: ')) cont += 1 soma += n if n == 1: maiorv = menorv = n else: if n > maiorv: maiorv =…
-
0
votes0
answers100
viewsHelp to translate captcha by using the python, csv and Tesseract language [closed]
I’m trying to make the recognition of these images, I’ve tried several types and I can’t identify with the tesserat because of the lines and scratches I get the site information below and can’t…
-
0
votes1
answer63
viewsloop in json in flask using render_template
Hello, I have the following json: {"movies": "[{\"title\":\"Hercules\",\"rep\":99.96},{\"title\":\"In the Dark\",\"rep\":98.12},{\"title\":\"Titas\",\"rep\":96.61}]"} and would like to scroll…
-
0
votes3
answers112
viewsRestart application - Python
Good morning guys, all right? I’m still learning to code in python, I’m a beginner. I’m making a simple calculator to calculate weight and cost of raw material. I wanted it to restart if a response…
-
0
votes3
answers380
viewsLoop to determine the smallest entered value
I’m having trouble creating repetitions to get the lowest value out of a given situation. For example, a program that registers price of products in which I have to report the lowest value and the…
-
0
votes3
answers269
viewsHow to Restart a Python Program?
I have to make a program that calculates the finite sum of a geometric progression, so I did: a_1 = float(input('Primeiro Termo: ')) a_2 = float(input('Segundo Termo: ')) n = int(input('Número do…
-
0
votes3
answers110
viewsBubble Sort algorithm error in Python
Currently I have studied a little Python and, amid the studies I am trying to perform a challenge where I need to implement a Bubble Sort algorithm in Python. The criteria are: The algorithm…
-
0
votes1
answer92
viewsHow to disregard keys inside a python formatted string
Hello, this is my first question here, I have a string and in it I need for a random value, however, when making it formatted, other keys inside become a placeholder, but that’s not what I want.It’s…
pythonasked 4 years, 3 months ago Thunder - 41 1 -
0
votes0
answers74
viewsDetect an image area at the right time (python)
I am developing a system for level detection in Ambar bottles (Beer/Soda), and I have the following problem: Whenever the bottle appears in the image the script already performs the reading but with…
-
0
votes0
answers82
viewsHow to plot bar graph with matplotlib + Counter()
Hello! I’m trying to plot a bar graph from Data Science from Zero, but it’s very different from the book. Note: the book is in Python 2 and I am using Python 3 In the book, is: from collections…
-
0
votes2
answers172
viewsPython Generate txt layout from a txt file
I have a txt file that I am doing treatment to generate a layout in another txt file. When I use the command print the same generates correctly, but when I put to write in another file it generates…
-
0
votes0
answers27
viewsI would like to make a relational query with sequelize type right Join
I need to perform this type of query with sequelize, for a specific data return. "SELECT p.id, p.nome , p.numero_face, zp.zona_id from pessoa as p right join zona_pessoa as zp on zp.pessoa_id = p.id…
-
0
votes2
answers205
viewsCopy line and write the same line to another file using python
I need to open a file, read a particular line and write that same line to another file. However, at the end of the line need to add a character (an asterisk "*"). leitura = open(arqfasta, 'r')…
pythonasked 4 years, 3 months ago Lucas Palmeira 13 -
0
votes1
answer67
viewsComparing strings
Hello I have a program to check if there is a string inside a file like this: import xml.etree.ElementTree as ET #Bibliotecas…
-
0
votes1
answer241
views(python) Socket does not connect to external network
I’m trying to chat at python, however server only connects with the client.py if the client’s machine is connected on the same network. How can I make the two connect to different networks…
-
0
votes1
answer146
viewssend the value of a variable from one program to another - python
Good afternoon. I am making a program in python that will use the numeric keys to open applications and(or) websites. I created 2 codes: 1 to configure (set the links that the user will want to…
-
0
votes1
answer113
viewsPython hangman
Guys, I’m playing a little python hangman game. My doubt is as follows: how do I order the hits according to the chosen word of the gallows and make it duplicate the letter I typed if there is more…
-
0
votes1
answer63
viewsLooking for string inside another Python string
Hello I have a program to check if there is a string inside a file like this: import xml.etree.ElementTree as ET #Bibliotecas…