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
answer666
viewsWord processing in csv file
I have a database with over a thousand opinions (text) in a csv file, however I need only texts that contain more than 5 words to stay in my file. The problem is to make a code that goes through the…
-
0
votes1
answer477
viewsHow to order a dictionary with a key
I have a dictionary as follows: dicionario = {(0,0,0):['alguma informacao']} how can I sort this dictionary from one of the key information? For example: dicionario = {(0,0,0):['alguma…
-
0
votes0
answers1237
viewsHow to add new keys to a dictionary?
Next, I’m doing a program that’s an academic control system, it turns out that when it comes to adding teachers, for example, it’s not creating new keys for teachers in the dictionary. He’s simply…
-
0
votes2
answers659
viewsWhat is the print(' a') function in python
I was told that the function print('\a') of this code produces a beep, but at the time when I run into pycharm there is no beep. I would like to know what this function is for. And if you could send…
python-3.xasked 7 years, 4 months ago Pelicano37R 1 -
0
votes1
answer100
viewsParameter in page URL
Dear, I need to create a Pyramid application for use of API. 1 - "/Quotes/< quote_number>" - Present page containing the quote returned by the API corresponding to < quote_number >. I…
-
0
votes1
answer1027
viewsPrint Format & End in Python
I’m creating an application that connects to db Sqlite, query and returns the column of the table in question, the problem is that the returned result without formatting comes like this : ( u'Field…
-
0
votes5
answers9375
viewsProgram to find MMC in Python
I was doing a basic exercise for the function While, he asked to create a program that found the MMC between 2 numbers... I managed to do, but the program continues to print the answer non-stop on…
-
0
votes1
answer1673
viewsProblem per image on a Tkinter button
I want to put image on buttons,I’ve done this way before,but agr n is working. Can you help me? **Detail: **In the same window of Tkinter is instantiated the screen of a Turtle. def images(self):…
-
0
votes2
answers50
viewsI would like to know why python is saying that I have provided 3 arguments in this role?
Code: print("Jogo do chute...") import random numeroaleatorio = random.randrange(100) chutes = 0 r = True while r: chute = int(input("Digite um número de zero(0) a cem(100): ")) if chute >…
python-3.xasked 7 years, 3 months ago user62320 -
0
votes2
answers920
viewsTurn string into operator
I have the following string '1+1', I have to transform the numbers into integers and perform the operation, have to transform the string '+' into the operator +, or other operators like '*' made a…
-
0
votes0
answers25
viewsconversion of Unittest Python2 to Python3
I have some free time and am updating in Python3. I came across a problem in the execution of the unittest, and I believe you can help me. Error: File…
-
0
votes1
answer845
viewsAutomate reading multiple text files in a Python script
I have a Python script that counts the number of connections contained in a text file and that is working perfectly: with open('1zao.txt') as f: linhas = f.readlines() soma = 0 for linha in linhas:…
-
0
votes3
answers12022
viewsRead 10 whole numbers and get the biggest one among them
Using a function, make a program that reads 10 whole numbers and print the largest of them on the screen. In the case of equal values, print any of the larger ones. If the largest number is multiple…
-
0
votes1
answer57
viewsProblem to show the value in the dictionary that corresponds to the user’s response
bebidas = {'Suco de laranja': 5.99, 'Suco de uva': 5.99, 'Suco de açaí': 5.99, 'Coca Cola(lata)': 6.50, 'Vitamina': 7.50 } simounão = int(input('Olá, gostaria de ver nosso…
-
0
votes4
answers1753
viewsComparing list indexes in python?
Good afternoon guys, I’m having problems with python lists... lateral = [] for i in range(3): lateral = float(input("Por favor, informe o valor de cada lado, seguidamente:" )) if(lateral[0] ==…
-
0
votes2
answers369
viewsHow to focus on ttk screen. Treeview, freezing the previous screens?
I made an application in Python 3.6 that calls another script in python to mount a ttk screen. Treeview with database information and that submitted data can be manipulated (change and deletion).…
-
0
votes1
answer1702
viewsHow to copy a specific data frame line to another data frame
I have following Data Frame: data = { 'País': ['Bélgica', 'Índia', 'Brasil','Índia','Bélgica','Bélgica','Russia','Brasil'], 'Capital': ['Bruxelas1', 'Nova Delhi', 'Brasília', 'Nova…
-
0
votes2
answers569
viewsDictionary file
I am trying to turn a file into dictionary but is giving the following error: Traceback (Most recent call last): File "C: Users taynan Appdata Local Programs Python Python36-32 Project CRUD…
-
0
votes2
answers49
viewsHow to receive more than one user command at once?
For example: nasc= input('INFORME SUA DATA DE NASCIMENTO: ') RESPOSTA= 15112002 How to separate this into DAY/MONTH/YEAR ?
-
0
votes1
answer67
viewsI want my variable to always be whole
People need to get out of a drama where I can’t finalize my logic without getting stuck in condition, the code is part of an old game that I’m perfecting, my condition in the code below says that…
python-3.xasked 7 years, 2 months ago Leandro de Oliveira 23 -
0
votes1
answer2087
viewsHow to accept a list as input?
This is an exercise of a USP course. I will post the statement and the code to make the doubt clear. Write the remove_repeated function that takes as a parameter a list of integer numbers, checks…
python-3.xasked 7 years, 2 months ago Gabriel Stagni Aquino 1 -
0
votes1
answer2725
viewsemoji no Pycharm
I’m using pycharm, I’ve downloaded the emoji module and yet this message appears: Traceback (most recent call last): File "C:/Users/Aspire/Desktop/curso-de-py-gua/aula08.modulos/ex.gua/emoji.py",…
python-3.xasked 7 years ago lucas 1 -
0
votes1
answer250
viewsHow to print a given list from a string of a . csv using python
The first part that is to detect the position of the list I have already managed, the problem is at the time of Else, would like to know a method by which the Else is not printed together with the…
-
0
votes0
answers208
viewsUser plot per week pandas
I have a csv file that basically follows below, I’m trying to separate user iteration number per week and plot a graph for each user. Hora Nome completo 8/08/2017 19:00 Joao 8/08/2017 19:00 Joao…
-
0
votes2
answers2587
viewsDelete a particular line from a . csv using Python
What I would like to do is that when the user typed the name of a person who was inside the file. csv, his line and the lines of movies he evaluated were erased (I used an identifier for this), the…
-
0
votes1
answer1701
viewsDelete certain lines from a python . csv
What would be the easiest way to delete only certain lines from file . csv within several other? No . csv below I would like just the lines of the Client (C) Cleiton and its films (F) that in the…
-
0
votes0
answers29
viewsSearch for a smaller array within a larger one
I have two frequency lists, one observed and one modeled. I happen to want to find all the values closer to those observed within the model. The first has length of 38 and the second of 303. I did…
-
0
votes0
answers319
viewsHow to stop a progressibar in Tkinter
I have always developed in JS to half lost here in Python, if you can help me... I wanted to let the button close without an event until the progress bar is finished, and the progress bar at the end…
-
0
votes1
answer170
viewsParsing NLP with external list
Parsing: An input text that will go through grammar and output are all the inputs that grammar finds in the text. The problem is that my non-terminals are files from external lists and I can’t see a…
-
0
votes1
answer340
viewsPolynomial class - list assignment index out of range
Save people, I’m learning classes in python and created one for application with polynomials, but I’m not able to add two distinct polynomials, always appears the following error: File…
-
0
votes0
answers202
viewsCreate a table in Django’s User models!
Well, I would like to create a column in the User models table of Django, because I would like to get the password before Django turns into sha256, because I want to display it in the browser…
-
0
votes2
answers111
viewsSeparate input value and expected value in pytest.mark.parametrize
How do I separate the parametrize, the input from the expected @pytest.mark.parametrize('entrada, esperado', [(1,0,0,), (1,0,) ]) def testa_raizes(entrada, esperado): assert…
-
0
votes1
answer148
viewsTuples: index out of range - recursion
I have a problem with index out of range in my tuple. The purpose of the code is to create a recursive function that finds a substring inside a tuple with elements of any kind. Someone could help me…
-
0
votes0
answers34
viewsMake a code executable
It is possible to make an executable code without downloading anything and being done in an online IDE?
python-3.xasked 6 years, 11 months ago Lucas Souza 567 -
0
votes1
answer180
viewsProblem with hashlib
I have a problem to use the python hashlib, because I am comparing the hashs generated with the line below, with the hashs generated on the site : 'http://temp.crypo.com/sha512.htm', but when…
-
0
votes1
answer1260
viewspyautogui compare result CTRL+V
I have the following code import pyautogui pyautogui.moveTo(612, 269) pyautogui.doubleClick() copiar = pyautogui.hotkey('ctrl', 'c') colar = pyautogui.hotkey('ctrl', 'v') resultado = colar…
-
0
votes3
answers107
viewsPython - Variable problem
I don’t know where I’m going wrong, but I wrote the following line of code: #variaveis globais fcfs = False #commands def fcfscheck(): fcfs = not fcfs Supposedly this function should alternate the…
python-3.xasked 6 years, 11 months ago Adauto Pinheiro 39 -
0
votes2
answers1292
viewsPython 3 - Birth Date Problems
Good evening, the code below in python3 should return a monthly fee amount according to the customer’s age, I used the time module to get the customer’s age when he informed his birth year, thinking…
python-3.xasked 6 years, 11 months ago Jeferson Silva 65 -
0
votes1
answer9605
viewsExporting data in json or txt, in python?
I need help to learn how to export data from an object. At first I need to export in type "txt" and/or "json", but I could not succeed in either. The code: #coding = utf-8 import json . . . def…
-
0
votes1
answer822
viewsPython CSV How to rewrite only one line of the file?
I have a row that stores within the file the following columns: ID Nome Telefone Descrição DataEntrada HoraEntrada The ID is basically the line number and it is through it that I will seek to know…
-
0
votes1
answer187
viewsFinishing a python project
I have some questions about the projects created in python. If I create a program and need to pass it to someone else, I will need the other computer to have python installed and with all the libs I…
-
0
votes1
answer1394
viewsHow to improve a bar graph whose values are very close in Python?
I am drawing the bar graph using the following Python code: # -*- coding: utf-8 -*- import matplotlib.pyplot as plt import matplotlib.dates as dates from datetime import datetime, timedelta x = [] y…
-
0
votes1
answer1772
viewsHow to use functions that are in a different file? - Python
I’m having a problem using functions that are in a different file than where I’m calling these functions. Basically my project is organized as follows: Lista_I (Pacote Contendo os Arquivos)…
-
0
votes1
answer392
viewsError and music written in Python
I wanted to perform a song in python but when I drag it to my project it gets "written", how can I do to execute it? (I’m new to python)…
python-3.xasked 6 years, 10 months ago Mat4guia 19 -
0
votes0
answers81
viewsName file with sql query data
Hello, I need to name each file created by the script with a data from a single column of my data bank. Follows the code: for index, source in zip(list(range(0, len(self.sources))), self.sources):…
-
0
votes1
answer1720
viewsRead data from an Sqlite 3 database in Python
I’m starting in Python and database and I have three questions! For example, inside my database I have a "name" column. Just to illustrate, say I want to take the contents of the "name" column…
-
0
votes1
answer3728
viewsLogarithmic Scale Graph with Python
Initially I created a Values X tempo (Unix Time) chart with the following code: # -*- coding: utf-8 -*- import matplotlib.pyplot as plt import matplotlib.dates as dates from datetime import…
-
0
votes1
answer819
viewsInvalid syntax message without any apparent error
I am trying to rename a folder that has a set of files, I want to remove all digits of the names of the files. But when I try to run the code the error message appears: "invalid syntax", pointing…
-
0
votes1
answer304
viewsWeb Application for Script Monitoring
What is the best way to monitor the execution of a script? I have a.py script that needs to be running "endlessly", and I would like to know if it is running or not. I would like a web application…
-
0
votes1
answer226
viewsPut N values in order
I need to do a show that reads n numbers (indeterminate quantity) and then put them in order. The stop condition is the number 0. I thought I’d throw those figures into a list and then sort them…
python-3.xasked 6 years, 10 months ago Arthur Satte Alam 1