Questions tagged as 'python-3.x'

3
answers

FUNCTION (METHOD) IN PYTHON

I'm trying to create a registry program in python, but a simple one only to test what I have learned, but I have a problem, I created a function and I return and then I store in a variable but it executes the function without me want, someone to...
asked by 02.07.2017 / 21:12
1
answer

Python asynchronous generators

With the introduction of the asyncio library, a new syntax has been introduced to define corotines in Python> = 3.5 and with it you can define asynchronous methods, asynchronous iterators, and even asynchronous generators. How can I im...
asked by 20.06.2018 / 19:33
1
answer

How to search the Portuguese summary for the wikipedia API?

How do I get the API to return the string in pt-br? import wikipedia pesquisa=wikipedia.summary(keyword)[0:150] print(pesquisa)     
asked by 12.07.2018 / 21:32
1
answer

How to change a specific word in one TXT by another

I need to change the configuration of the Zabbix server that is in this directory C:\zabbix\conf\zabbix_agentd.win.conf I need to replace the word: hostname= with hostname=192.168.1.1 I did this, but the part under...
asked by 27.06.2018 / 16:21
1
answer

Reading of integers and negatives in phyton

I'm new to Phyton and I do not know how to create all the code required in the statement. The following statement: Read whole numbers on the keyboard until a negative number is a keyboard. Write, if any, the five largest numbers read. If fewer t...
asked by 06.03.2018 / 14:24
1
answer

Error using QLabel class method - PyQt5

I'm trying to create an application that does the following: every time the user clicks on an image that will be inside a QLabel, it will open a dialog for the user to open another image. It happens that you give the following error the setPi...
asked by 12.10.2017 / 00:26
3
answers

Check if value is string or number [duplicate]

10) Make an algorithm that checks if a given value is a String. valor = str(input("Informe um valor: ")) if(type(valor) == str): print("É uma String!") In the IDLE or Python Console of PyCharm, if I type: valor = "João" type(valo...
asked by 08.11.2018 / 16:36
1
answer

Can anyone tell me where the error is, please? You are giving "invalid syntax"

n = str(input("Informe o nome do aluno: ") m = int(input("Informe o numero da matricula do aluno: ") print("O nome do aluno é: %s, o numero da matricula é: %d" %(n,m))     
asked by 22.08.2016 / 21:57
0
answers

Pass query in php to python

I'm trying to pass the php code given by api to make requests to python and I'm having some difficulties. In php the query is done as follows: $query = http_build_query(array( 'domains' => array( 'google.com',...
asked by 18.12.2018 / 15:10
1
answer

Write file in excel within the Scrapy project [closed]

I have a Spider that takes the xlsx links, in the Request I call the files and saved in: def save_file(self, response): f = open("teste.xls", "wb") f = write(response.body) f.close() But it returns the error: f = write(resp...
asked by 09.05.2018 / 17:47