Questions tagged as 'python'

1
answer

How do I list all the properties of an object?

I wanted to get only the properties of an object, and pass the value of each of these properties as an argument to a function.     
asked by 13.11.2017 / 15:08
1
answer

As per the items in a list in ascending or descending order?

I'm trying to get the numbers in a list in ascending order but the sort () method is putting the 10 and its multiples (20, 30) as being similar to itself divided by 10. For example, in the following code: numeros = ['1', '3', '2', '20', '4', '...
asked by 17.12.2017 / 03:21
3
answers

My String is giving "unicodeescape" error

I'm trying to open a file with .txt data in Python but an error message appears. arq = open('C:\Users\Cintia\Documents\Python\Dados\lbe.txt', 'r') lbe = arq.read() print(lbe) arq.close() The error is unicodeescape .     
asked by 30.10.2017 / 13:20
1
answer

How do I run a command once every hour in python?

I want to run a code / line of code once every hour when running the program in python, how do I run every hour?     
asked by 13.10.2018 / 22:56
1
answer

I want to scrape a page, but I can not get a text that has "& nbsp" in it

Well, the title says it all, I want to get the price of a product from link , which looks like this: / p> <span class="nm-price-value" itemprop="price">R$&nbsp;367,60</span> Using this code: import bs4 import requests def...
asked by 21.10.2018 / 17:13
1
answer

search for depth and width using graphs [closed]

I need a code that does a search in width and depth using graphs for the shortest path search, analyzing these aspects mentioned, but I do not know where to start, I would like someone to help me, Github serves also if someone know it.     
asked by 13.02.2016 / 19:48
1
answer

Bar graph generated with Python has become unreadable. How to improve it? How to work with a dataset of more than 1 million rows?

Friends, The following bar chart was generated (the first column of datasets is UNIX time): ThePythoncode(version3.5)usedwasasfollows:#-*-coding:utf-8-*-importmatplotlib.pyplotaspltimportmatplotlib.datesasdatesfromdatetimeimportdatetime,t...
asked by 26.08.2017 / 16:39
2
answers

Is there a Python command similar to (Catch and Throw) in Ruby?

Is there in Python Something Similar to (Catch and Throw) of Ruby? I would like to jump like this: a = 10 throw :pularparaaqui if a == 10 catch :pularparaaqui do end     
asked by 05.07.2018 / 17:05
1
answer

Python and Selenium: SyntaxError: invalid syntax [closed]

I'm trying to automatically sign in to facebook with the code below, from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait import unittest class LoginTest (unittest.Testcase): def setUp(self):...
asked by 13.01.2016 / 14:45
2
answers

ERROR: My code hangs without any errors

I'm starting to learn python and wanted to create a sort of login, only the code ends without having chosen to finish. from time import sleep print('=='*20) print('=='*8,'LOGIN','=='*8) print('=='*19) print() print('DIGITE 1 PARA SAIR DO S...
asked by 24.11.2018 / 09:50