Questions tagged as 'python'

2
answers

Difficulties with FOR command in Python [closed]

I'm putting together a program that reads information about angles and distances from a text file and draws it according to the information contained therein. The program should also calculate the azimuths, and that's what I did, these variables...
asked by 21.12.2018 / 14:39
1
answer

'str' object has no attribute 'encrypt'

I made a program that generates a public key and another private key, serializes them and saves them to a .key file. Dai I tried to create another program to encrypt and decrypt a message with these two keys generated in the other program, how c...
asked by 19.10.2018 / 21:05
2
answers

Python: How to identify the root of the operating system?

How do I identify the root of the operating system (windows: "C: \", in linux: "/"), exclusively through python commands that apply to both systems?     
asked by 18.10.2018 / 20:47
2
answers

How can I encrypt an input text by the user?

from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import padding from cryptography.hazmat.primitives.asymmetric import rsa #gerando a chave p...
asked by 19.10.2018 / 22:06
2
answers

Concatenating multiple lists with Python

Good afternoon! I have a problem and need help, I'm working with 3 distinct lists that should be added to a dictionary, but so I can capture all the values without one overwriting the other, I need to concatenate those 3 lists. I know that us...
asked by 08.08.2018 / 20:14
1
answer

Linear regression application

I have two lists print(lista) [970084.4148727012, 983104.7719906792, 996164.0, 1006426.5111488493, 1016687.0370821969, 1026941.5758164332, 1037185.9604590479, 1047415.8544247652, 1057626.746645888, 1067813.94679318, 1077972.5805253708, 1088097...
asked by 09.08.2018 / 22:02
1
answer

Archive Keyboard Entries in Python

I am building a code to hold any command made by the keyboard, they will be published in a ROS structure topic to control a mobile robot. I'm not very familiar with Python, the most I've achieved regarding data storage was the code below ... For...
asked by 09.08.2018 / 01:56
1
answer

Pass a given sequence number of times in Python 3

I have the following sequence: {1,4,12,28,45,22} I need a variable for example: seguinte = input(num('Insira um número: ')) According to the number entered, it would pass the last item to the beginning, being informed 2 would be: {45...
asked by 13.12.2018 / 13:20
1
answer

Scraping data using Robobrowser

I'm trying to scrape a form, to insert an attachment and send, using Robobrowser. To open the page I do: browser.open('url') To get the form I do: form = browser.get_form(id='id_form') To insert the data into the form I do: form['...
asked by 12.12.2018 / 16:40
1
answer

Convert date string to ISOFormat with "T" and "Z"

With a date in string in 01/01/2018 13:00:40 format, how could I convert it to iso format using "T" and "Z" , example: 2018-01-01T13:00:40Z I was able to do this as follows; datetime.strftime( datetime....
asked by 04.09.2018 / 19:02