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
votes0
answers19
viewsProblem extracting web page data with Beautiful Soup in python
I made a script in python to access the portal of records of the Inmetro to make a search among the existing certificates. In this case, my script accesses this link and takes all records from the…
-
0
votes1
answer45
viewsList Deletion and Return
Will be passed as entry list with the current information of a contact, and the phone you want to delete: • if the phone is in the contact’s phone list, it must be removed. • if not, no update will…
-
0
votes1
answer54
viewspython, list logic - remove item
I’m developing a game based on zombie Dice, in Python. I’m having trouble with the use of the list specifically copo[] , where I need to remove the played dice and then put them back into the game…
-
0
votes0
answers12
viewsPIPENV - local - different folder directory for package-related files
This is my first post here I’d like to ask for a help. I currently program in python and use Conda(anaconda) and/or virtualenv to manage/isolate my packages in python, using Pycharm and/or Vscode as…
-
0
votes1
answer70
viewsHow to Validate User Input within a . txt file
I have a registration program that receives the user’s data (e-mail and password), this data goes to a file . txt, with the function Open() python, example: txt file [email protected], senha1234…
pythonasked 3 years, 2 months ago Luiz Henrique 9 -
0
votes0
answers22
viewsFFMPEG cannot read filename that contains "..."
I have a problem reading videos that contain two or more "." points followed in the name of one of the folders or in the name of the video itself. Ex: C://pasta 1/pasta 2/meuvideo1... parte2.ts. The…
-
0
votes0
answers45
viewsIs there any way to pass a Python variable to a javascript script?
I have a Javascript code that is triggered from another python code, in python I created a variable that pulls a json object of the database, and I need to consult this variable to know which report…
-
0
votes1
answer43
viewsFind string fields with python regular expressions
I am logging into a device and giving an ifconfig on it, the generated information is: ['ifconfig'] ['>ifconfig'] ['br0 Link encap', 'Ethernet HWaddr A4:33:D7:53:5E:08 '] [' inet addr',…
-
0
votes1
answer47
viewsHow to use a variable of an X function in a Y function in Python?
I am a student of the first period of Eng. of Computing I’m having some problems to understand how I could (if possible) use the variable of one function within another, the two being executed…
-
0
votes0
answers7
viewsTreating exceptions "Staleelementreferenceexception" from Selenium in Python
I am developing a web automation to insert a list of numbers in a field on a website platform and click recurring within a "for" loop n times according to the dimension of the list. At first the…
-
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
votes1
answer52
viewsHow to install modules from a Python project with Flask?
I’m used to working with Javascript, and it’s common to download a Github project and run the command yarn to download all the modules that that project uses so that I can run the project. However,…
-
0
votes0
answers12
viewsI need the userReba an entire list,Can anyone say?(Python)
So, this program serves to separate a list into three priority options(a,b and c),my goal is that it takes a list of user elements and asks the priority of each element, but I can’t get it to…
pythonasked 3 years, 2 months ago Adriano Conceicao 1 -
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…
-
0
votes0
answers6
viewsWhich Tkinter method. Entry is responsible for setting the value of the textvariable?
I created the following Customentry to implement a placeholder: class CustomEntry(tk.Entry): def __init__(self, master=None, placeholder="", cnf={}, fg="black", fg_placeholder="grey50", *args,…
-
-1
votes3
answers304
viewsCrawler that detects changes on a page and saves screenshots
How to make a Crawler that allows you to list all ads placed on a website as custojusto.pt (for example, on the furniture part…
pythonasked 10 years, 9 months ago user3289645 23 -
-1
votes2
answers160
viewsUnittest Django Views: I can’t log into the system by unittest
I need to give a post in a "request creation" view of mine, but when I try to give the post, I am redirected to my login screen, I am trying to log into the system to then give the post in this…
-
-1
votes1
answer666
viewsImport: cannot import name Certs
I am running some exercises that I find on the internet. One of them is to use the module requests I installed the module in /site-Packages, but when I try to import it, the shell returns me the…
-
-1
votes1
answer182
viewsDepending on the seed I put the print of the capacities does not occur. How to tidy up?
import random semente=int(input("por favor, digite a semente do gerador aleatório:")) print(" ") print("Início da simulação") random.seed(semente) cap_inicial_1 = random.randrange(20,51)…
-
-1
votes1
answer220
viewsOpen python text set to apply functions (Len, set, colocations, etc.). Unicodedecorror
>>> import nltk >>> from nltk.corpus import PlaintextCorpusReader >>> meucorpus='C:\Users\dudu\Desktop\Artigos sem acentos' >>>…
-
-1
votes2
answers187
viewsPython code error
I have a MAC and everything worked perfectly, I decided to install the anaconda to see if it would help me in something and now I no longer run my codes, I get the following error message: File…
pythonasked 9 years, 2 months ago Claytontey 19 -
-1
votes1
answer323
viewsHow do I add entries from a Tuple and return a Tuple with an entry that has the sum of the previous Tuple entries? add by columns
22 entries of a Tuple that must return in a Tuplo the sum of each value in the corresponding column…
pythonasked 9 years, 1 month ago João Machado 27 -
-1
votes3
answers320
viewsI can’t fix this bug in Python, I’m a beginner
Well I need to do this multiplication but give the following error: Traceback (most recent call last): File "C:\Users\Guilherme\Desktop\dasdsa.py", line 17, in <module> conta = (trans1) *…
pythonasked 9 years, 1 month ago Guilherme Castello 11 -
-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
votes2
answers92
viewsFind the first line in the matrix with all positive elements, and the sum of these elements. Reduce all elements to that sum
Find the first line in the matrix with all positive elements, and the sum of these elements. Reduce all elements to that sum. Here is my attempt, but in this way add up the positive elements: matrix…
-
-1
votes1
answer2404
viewssearch for depth and width using graphs
I need a code that does a wide and deep search using graphs for the shortest path search, analyzing these aspects mentioned, but I don’t know where to start, I would like someone to help me, serve…
-
-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
votes1
answer226
viewsHow to use python files
I am still finishing a program as work of Project I and I have a lot of difficulty in the part of files. I am unable to insert an array into the file. Does anyone know how to do this? The program is…
-
-1
votes1
answer93
viewsWhy does the following code not work?
The code should receive a number of student grades, print the grade average and how many grades are 10% below and 10% above average. The code is like this: quantidade = int(raw_input()) inicio = 0…
-
-1
votes1
answer73
viewslist indexes
My two initial lists have repeated values: B_I=[Cab, Bou, Bou, RFF, RF1, Rf2, Color] Ba_f=[Bou, Zez1, Zez2, Praca, Sro, Sro, Falag] I eliminated the repeaters, leaving with: Final=[Cab, Bou, RFF,…
-
-1
votes1
answer2155
viewsHow to read two whole variables on the same line?
How to read two integer variables on the same line with Python? a= int(input()) b = int(input())
-
-1
votes1
answer290
viewsPorting Java code to C++ or Python
I’m working on a project that was originally written in Java. I want to learn more about the mathematics and the logic behind the code, and I had the idea of porting the code to another language. I…
-
-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
votes2
answers1224
viewsHow to transfer data from tables to python?
Hello, I have a table with a lot of data, a lot of data even from Astrophysics, are tables with approximately 20 columns and more than 1000 rows. I need to send this table with this data (contained…
-
-1
votes4
answers810
viewsPython, How to let the person put a number and with this number put that same amount of questions
Is it possible to make a system like this in Python, like let’s assume in a college system, if I put materias = print(input("Digite o número exato de matérias que há nesta série: ")) what it takes…
-
-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
votes1
answer213
viewsProblem with CIELO certificate using Django
I am trying to implement a transparent checkout for my online store using CIELO for such. data: Django 1.9.5 Python 2.7.6 Ubuntu 14.04 Nginx uwgsi digital Ocean link api python Cielo:…
-
-1
votes1
answer319
viewshelp with Qlocale and Brazilian currency format
in c++ I used to convert an integer value to the Brazilian currency format as follows: QLocale loc = QLocale::system(); QLocale brasil(QLocale::Portuguese);…
-
-1
votes2
answers323
viewsSyntax error in file . py
I looked for a code . py on the internet and at the time of executing it comes out the following message: File "C: Users Valnei Desktop Xatexploit.py", line 26 print "Trying password => " +…
-
-1
votes1
answer1242
viewsPython - How to print multiple variables in a loop?
I’m collecting 7 different values through a while. Every time the while wheel, a value is assigned to the variable valor and is printado, but would like to save each valor in a variable for later…
-
-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
votes1
answer691
viewsRemoving elements from a Python list
Basically I want to remove the elements from a list by one criterion. For example: I have a room with N students, I will store the grade of these students in a list and compare these grades with the…
-
-1
votes2
answers2029
viewsPYTHON - NIM game (problem with computer fix starting or not)
Goal You must write a program in the Python language, version 3, that allows a "victim" to play the NIM against the computer. The computer, of course, must follow the winning strategy described…
-
-1
votes1
answer194
viewsScraping in Python. Mounting an Insert
I would like to extract this table using maybe Scraping in Python:…
-
-1
votes1
answer1152
viewsCreate visual loading screens in python
Like this: |----- | 90% Where it loads in the seconds I specify. For visual use only, because I want to make an aesthetic effect only :) Where the lines are the loading bar ends and the dashes…
pythonasked 7 years, 5 months ago Dyefferson Azevedo 129 -
-1
votes1
answer107
viewsPython Handle API
I want to use the following API response: https://cex.io/api/ohlcv/hd/20160228/BTC/USD Then I want to divide it into blocks like this: [1456617600,434.3867,434.3867,433.781,433.781,4.15450000] and…
-
-1
votes1
answer729
viewsPygame - How to solve the image’s phantom effect
I am doing some tests in pygame and created a "character" that moves, but it creates a ghost effect on the screen. I’d like to know how to solve. (This land is what the character would be) The…
-
-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
answer303
viewsProblem when migrating with Python and Django: no such column: forum_thread.Slug
I have this problem in my code: OperationalError at /admin/forum/thread/ no such column: forum_thread.slug I’ve tried to make a million changes and I couldn’t. When I turn the command python…
-
-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…