Questions tagged as 'python-3.x'

1
answer

Infinite wait for server response using sockets in python

I'm trying to send a message to the API of a server in order to get a response. I'm using the following code: import socket sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server_address = ('h68.p.ctrader.com',5211) sock.connect(serve...
asked by 24.03.2018 / 02:35
1
answer

Use return of a method in another method of the same class

I'm working with the The Guardian API, using two methods, search_content() and data_to_csv() , contained in the The Guardian class. The first method is responsible for searching the Guardian database according to the parameters prov...
asked by 26.03.2018 / 21:17
1
answer

Python - Transform range of rows into columns [closed]

I have a DataFrame with one column and 5,000 rows. What I need to do is pick up 48-line breaks and transpose to 48 columns with the entire dataFrame How are you? 1. 0.35 2. 0.21 3. 0.45 4. ... 5. 0.12 6. 0.34 As required: [0....
asked by 18.03.2018 / 20:53
2
answers

Python - Find Odd Tuple

I'm new to this area and recently, for a college job I could not turn that line of code into a tuple. function code: def encontra_impares(lista): lis = [] if len(lista) > 0: numero = lista.pop(0) if numero % 2 !=...
asked by 12.05.2018 / 19:44
2
answers

2 commands on the same line python [closed]

I would like to know how I can resolve this. input('Acabei de encontrar a receita ') print('voce vai precisar dos seguindos ingredientes') num1 = int('6') print(num1) print('Kg de Farinha') num2 = int('3') print(num2) input('Unidades de ovos')...
asked by 07.05.2018 / 22:43
1
answer

Iteration with variable of type 'TIME'

I'm doing a project in which I need to make a loop that increases minute by minute of a variable from two times. I thought of logic in the following way: vHoraInicial = '13:30' vHoraFinal = '15:00' While vHoraInicial <= vHoraFinal:...
asked by 08.05.2018 / 17:35
1
answer

How to configure Portuguese in kivy? [closed]

My App has two files, * .py and * .kv, but I'm having problems with accents in my GUI. I have already tried to resolve it in the .py file with    #encoding: -*- utf-8 -*- But the problem continues, please help me. Settings: Python...
asked by 08.03.2018 / 21:47
3
answers

List a range of numbers and add one by one

I do not know how to start, I would like to know how to add a number to another in a range for example: 2 = 2 3 = 5 4 = 11 And so on I can not go on, if anyone can help me thank you right away.     
asked by 01.04.2018 / 15:23
2
answers

Doubt with Lists

When I type this command in the console, it returns me an empty list. But if I create a file and have it run, nothing appears, what happens? How should I do it? lista = [] x = 1 while x > 0: x = int(input('digite um numero inteiro: ')...
asked by 23.06.2018 / 01:03
1
answer

How do I disable the text cursor?

I have a project in Gtk which uses a Gtk.Entry text input and I need to disable the text cursor, or leave it invisible. How can I do this? Or if you can not, can you disable the linux system cursor?     
asked by 09.02.2018 / 19:58