Questions tagged as 'python-3.x'

1
answer

Search for a value in a particular column in a .txt file

I am trying to search for a value in a certain position in the column of a text file and generating another file with these lines, but without success Follow the code: arquivo = open('arquivo.txt', 'r') arquivo2 = open('arquivo2.txt', 'w')...
asked by 16.11.2018 / 01:48
1
answer

Doubts Python libraries [closed]

Good afternoon! I'm new to development using the Python language, I'd like some tips from good libraries to be studying and especially one to "manipulate sites" (currently I only know Selenium WebDriver, but I'd like to know others), I know is...
asked by 27.09.2018 / 17:53
2
answers

create random number in python beginning with the year

Hello, I'm trying to create a variable to return a protocol number by picking up the current year, then 4 houses from the beginning, from the smallest to the largest, for example. 20180001, 20180002 etc. To catch only the year I used def nu...
asked by 26.09.2018 / 18:54
2
answers

Property Override

According to some examples I found I'm trying to implement an override of a property , but the override does not work. I think this is a still obscure topic with few examples and little information about it. Here is my example: from abc...
asked by 08.12.2018 / 13:29
1
answer

Can you write all the paragraphs that the user put only after the loop in sequence? and justifiably?

Can you write all the paragraphs that the user put only after the loop in sequence? and justifiably? import textwrap numero_paragrafos = int(input('Quantos parágrafos tem o texto?\n')) for c in range(1, numero_paragrafos +1): paragrafo =...
asked by 10.10.2018 / 20:49
1
answer

I want to create a calculator in Python with constructor, but when I create an object it says that the class is not defined

class Calculadora: def __init__(self, numero1, numero2): self.numero1 = numero1 self.numero2 = numero2 def soma(self): soma = self.numero1 + self.numero2 print("A soma é: " + soma) def sub(self):...
asked by 02.10.2018 / 00:27
1
answer

How to get Gmail source code using Python3

I am accessing the Email using this code that I have found and adapted: import requests from bs4 import BeautifulSoup form_data = {'Email': '[email protected]', 'Passwd': 'senhaexemplo'} post = "https://accounts.google.com/signin/challenge/sl...
asked by 01.10.2018 / 02:54
1
answer

How can I save the private key and publish it for use later? and the program always generates different keys?

Well, I would like to be able to save the private key and publish it to use later to encrypt and if someone wants to decrypt my message, but every time the program generates a new key. How can I save the keys and then use it later to encrypt or...
asked by 25.10.2018 / 07:41
1
answer

Pyqt5 how can I make a button select a stackedwidget from qt

I'm doing a form in python, but I need to know what I do to make a button select the indexes of stackedwidget just like in c ++ using qt. from PyQt5 import QtCore, QtGui, QtWidgets import sys import os class Ui_MainWindow(object): def set...
asked by 10.09.2018 / 21:56
1
answer

OpenCV error in Python:

Good Afternoon Personal, okay? I'm looking to learn about Face Detection in Python using OpenCV, I installed all the necessary libs, however, when running the file I come across the following error: import cv2 import numpy as np face_casca...
asked by 10.09.2018 / 20:43