Questions tagged as 'python'

5
answers

music does not play

I have the following code in python #*-coding:utf-8;-* import pygame pygame.init() pygame.mixer.music.load('ex1.mp3') pygame.mixer.music.play() pygame.event.wait() In case, it should play a song when it is run in pycharm, however, it perfor...
asked by 01.04.2018 / 20:50
1
answer

Simple example of blockchain p2p in python, anyone have? [closed]

Hello, I am interested in blockchain technology to track product origin to avoid fraud (imported drinks). Someone would have examples and how to start in python. Thanks.     
asked by 19.05.2017 / 19:02
4
answers

Repeat to call variables

I have four variables [t1, t2, t3, t4], and each of them has been defined as a string before. t1 = 'A vida vai ficando cada vez mais dura perto do topo.' t2 = 'A moralidade é a melhor de todas as regras para orientar a humanidade.' t3 = 'Aquil...
asked by 02.04.2018 / 00:12
2
answers

Type of elements in a list - Python

I have two lists of different sizes. The first is a list of lists. Where I need to compare the type of elements in that first list list with another list that contains data type (str, int, float, ..). Example: lista1 = [['a', 'bb', 1.5, 3,...
asked by 08.05.2017 / 19:42
1
answer

How do the elements of a tuple be the arguments of a function in python?

First I'll summarize the problem and then explain what I'm trying to do. If you can answer the problem in a nutshell, you do not even have to see the rest. Is there a way to pass the elements of a tuple as arguments to a function? For example:...
asked by 08.05.2017 / 02:09
3
answers

A list to receive 20 integers and store in a list and print the largest element in the list

n = int(input("digite o número : ") I=0 For i in lista: lista[i].append(input("digite o número" I+=1 else: Print("lista cheia") I'm new to Programming and I can not deploy what the questionnaire wants.     
asked by 10.05.2017 / 19:42
1
answer

Error in easter calendar algorithm

I was messing around with programs that calculate dates, but I found a very precise python algorithm that correctly returns the day that will fall and the Easter holiday has fallen. The algorithm in python is this: #!/usr/bin/env python #co...
asked by 13.08.2017 / 01:50
1
answer

I can not run this giving error of undo what is wrong

def main(): q = Queue() i=1 while(q.isFull()==False): digitado = input ("digite um numero para inserir na fila: ") numLido = int(digitado) q.enqueue(numLido) i+=1 while (True): x = inp...
asked by 14.03.2017 / 03:06
1
answer

Calculate a string in Python

I would like to do a calculation of a string that I get, for example: var = '1+2' I wanted to convert this string into an account, to return 3 for the variable var and not '1 + 2', but this would not only be added, would have subtrac...
asked by 16.03.2017 / 15:50
1
answer

PyQT calling file created by QtDesigner

I developed a dialog in PyQt with Dialog with Buttons Right template, but when calling in my main class it returns an attribute error. I saw in the YT video that the guy used the Main Window as a template and he just installed Main_principal cla...
asked by 08.02.2017 / 16:30