Questions tagged as 'python-3.x'

1
answer

Finding matlab command in python?

What is the equivalent in python3.6 of the find of matlab command for this expression? The PDF that I have with some equivalences does not have this command pos = find(sn_til>0)     
asked by 13.09.2017 / 06:36
1
answer

Error in html django?

Good morning, I have a small problem to reference my variable in django html. I'm a beginner on the web part, I'm trying to create a website for a project, then during the construction of the html, I tried to make a reference for my view.py, but...
asked by 18.08.2017 / 15:53
1
answer

Mounting table from a csv, grouped per week, with python and pandas

I'm using pandas and I open the following table using the code tst = pd.read_csv('Iteracao.csv',delimiter=",") I'mtryingtogroupasfollows,whereweek1istheweekofthedate2017-02-10/2017-02-16,followingthelogicfortheotherweek,theindexdoesnothave...
asked by 20.08.2017 / 04:16
2
answers

generator

Well, I've been trying to optimize my code and found generator expressions, but I do not understand anything about it. For example: for mCp in mWithoutNone: for ctt in moradasCTT: if mCp[3] == ctt[3]: mWithCp4.append...
asked by 05.07.2017 / 13:49
1
answer

Python wordlist generation problem (2.7)

I'm trying to write a python script that takes n keywords and a number as input. This number will be my maximum range of the string that will be written in the wordlist. 1 ° Problem: You have to make as many combinations as possible between t...
asked by 29.06.2017 / 21:44
1
answer

Put password in a python file

I'm doing a program in which you select the file you want to block using a password, by clicking a button that file is locked with a user-defined password. How can I make this file accessible only with the password?     
asked by 04.04.2017 / 20:07
2
answers

How to extract all td names in order?

I need to extract all the names of people on this site: Camara.gov.br I wrote this code in Python3: from urllib.request import urlopen from bs4 import BeautifulSoup import urllib.request, urllib.parse, urllib.error emendas = urlopen("...
asked by 19.09.2017 / 13:42
1
answer

How to implement a permutation algorithm in Python?

I'm trying to implement a permutation algorithm in Python. It receives as input a phrase and a key (numeric value) that matches the amount of letters each group should have, numerical sequence from 1 to the value of the key. Here is a...
asked by 19.09.2017 / 16:41
1
answer

Storing variable values inside the while function

In one exercise I replied with this code: qntd_alunos = int(input("Digite a quantidade de alunos: ")) qnt = 0 while qnt <= qntd_alunos-1: MB1 = float(input("Digite a média do primeiro bimestre: ")) MB2 = float(input("Digite a média...
asked by 31.08.2017 / 17:50
1
answer

Testing if a String is inside a .txt File

Hello I would like to know how I compare a string entered by the user with the strings contained in a .txt file My last attempt was like this, but I did not get the result I wanted: f = open("Testando.txt","r") r = f.readline() nome = in...
asked by 09.04.2017 / 23:48