Questions tagged as 'python'

2
answers

How do I capture two integers with space between them in python3?

I want to capture two integers, for example:    2 4 I'm not sure how to do this, var = input() lista = [] lista = var.split(' ') n,q = lista n = int(n) q = int(q)     
asked by 02.04.2018 / 00:14
1
answer

How to call a second key in a dictionary using HDF5Matrix?

I'm trying to load a .h5 file using this documentation HDF5Matrix : test_images = HDF5Matrix(train_path+train_file,'images') But I'm getting this error:    KeyError: "Unable to open object (object 'images' does not exist)"...
asked by 13.04.2018 / 16:32
1
answer

I can not download "pygame" or "kivy" through the command "pip install ..."

When I try to download pygame the following appears, remembering that my pc is windows 10 - 64bit. use python 3.7.0b3 (64bit) downloading pygame: Collecting pygame Using cached pygame-1.9.3.tar.gz     Complete output from command python...
asked by 13.04.2018 / 17:25
0
answers

Standard condition in the Gauss-Seidel method in Python

Hello, I'm trying to put a new condition in the Gauss-Seidel method. In the case, A, q and x are three matrices, and w is the number of times the interaction is made: def gauss(A, q, x, w): L = np.tril(A) U = A - L for i in range(w...
asked by 02.04.2018 / 10:18
1
answer

Python transform a number into integer

import math x=9 raiz=math.sqrt(x) print raiz for i in range (raiz,9): #Problema aqui i=i**2 print i I need to create a for with the root of an operation (always integer 2, 3,4,5 ...) but when I try to use it the way I did the error. It says...
asked by 02.04.2018 / 04:14
1
answer

URI Online Judge - 2163 - Python 3

I am having trouble solving the problem The Awakening of the Force of the URI.    Long ago, in a galaxy far, far away ...       Following the decline of the Empire, scrap yards are scattered all over the   universe searching for a saber...
asked by 02.04.2018 / 06:10
1
answer

Regex to match the first occurrence before a word

My string is as follows: \questao{1} \begin{enumerate} todos os tipos de caracteres \end{enumerate} \begin{enumerate} -------> APENAS este deve dar match todos os tipos de caracteres \end{enumerate} \questao{2} I'm trying to mak...
asked by 30.03.2018 / 15:49
2
answers

Request url wikipedia by date

Hello, a great friend made me this code, I'm very new to python: ' from bs4 import BeautifulSoup import requests url = "https://dumps.wikimedia.org/other/pageviews/2018/2018-04/" page_html = requests.get(url).content soup = BeautifulSoup(pag...
asked by 09.04.2018 / 13:20
1
answer

How to print an element from a list of lists in python

I have a list of lists, like this: [('name1', size1), ('name2', size2)] I want to just print the name of each list, how could I do that?     
asked by 31.03.2018 / 15:20
1
answer

E-mail sending with update in the bank

I am developing a code for sending e-mails and, in case the e-mail is sent, the system makes an update in the database table. The emails are being sent, but the update does not happen Here is the code I have: import MySQLdb import smtp...
asked by 06.04.2018 / 16:19