Questions tagged as 'python'

1
answer

Read file information. txt using Python

Good evening! I have a .txt file that stores a data structure as follows: índice: p1[x1, y1], p2[x2, y2], p3[x3, y3], p4[x4,y4] An example of lines from my file is: 1: p1 = [62.61, 79.47], p2 = [64.17, 75.43], p3 = [58.85, 72.5], p4 =...
asked by 13.11.2018 / 22:24
1
answer

Generate a random combination on each line

I did a number generator that looked like this: import random import math for i in range(10): c1 = (random.choice([1, 2, 3, 4, 5, 6, 7, 8, 9])) c2 = (random.choice([1, 2, 3, 4, 5, 6, 7, 8, 9])) c3 = (random.choice([1, 2, 3, 4, 5,...
asked by 17.11.2018 / 14:22
1
answer

How to save binary files in python?

I'm new to SOPt and would like to know how to save and open binary files in python. If possible I would like to see examples of how this is done and what the parameters mean.     
asked by 13.11.2018 / 21:00
2
answers

I am trying to use an asynchronous function in python-3, but this is giving error

Error: Warning (from warnings module): File "C:\Users\tiago.pereira\Desktop\python\kivy\kivy_teste.py", line 43 pythoncom.PumpMessages() RuntimeWarning: coroutine 'Keyboard' was never awaited TypeError: an integer is required (got type...
asked by 19.11.2018 / 11:46
1
answer

Recursion Problem in Python

It's my first question here, so I'll be brief: I'm having trouble with the code below: def nat(n): if n == 50: return 0 else: return nat(n+1) print(nat(1)) It happens that it's a recursive question in Python, I should print th...
asked by 28.11.2018 / 04:58
1
answer

Change word in frasede according to dictionary

You have an exercise consisting of typing an N number and then typing a word and a quality into N lines. After this I must enter a sentence. If in this sentence there is a word that I had typed before, you should print their respective quality....
asked by 29.11.2018 / 02:15
1
answer

Kanade Optical Flow Algorithm Lucas Tomasi (KLT) in Python [closed]

Hello. I searched all over the internet and could not find it. Does anyone have an alternative to extract features in images with the Kanade Lucas Tomasi (KLT) algorithm in python?     
asked by 02.12.2018 / 14:18
1
answer

How can I improve my gamer gaming code?

What tips would you give to improve this gaming code in Python? In the "course" I'm doing in Python I have not yet learned how to use string methods yet. It's a very simple game, with no graphical interface because I do not know how to do it and...
asked by 12.09.2018 / 21:40
1
answer

Integrate RDStation with Django + Python to send lead

Good morning guys, I have a problem: I have an LP that has to save the lead in the Postgres database and automatically send that lead to the RD platform using their API. Using the curl I do as follows: curl -v \ -X POST \...
asked by 26.09.2018 / 16:12
1
answer

Selecting different intervals in a giant dataframe in RStudio

I have a large CSV with large stock dates and their closing prices, impossible to use Excel. The action name is in the same column as the date and only appears at the beginning of the series, as shown below: I have limited knowledg...
asked by 07.12.2018 / 16:17