Questions tagged as 'python'

2
answers

Python Timer

I am trying to make a timer that after 10 seconds prints a string . I tried to use time.sleep() and it did not work. Example: def tempo(): #passados 10 segundos print "olá"     
asked by 14.06.2014 / 20:22
1
answer

IDE for Python that has GUI modeling

I would like to know if there is an IDE to program in Python that provides a tool to mount a GUI more easily, preferably with versions for Linux and Windows.     
asked by 04.08.2016 / 14:22
1
answer

Creating a chat program. How to make two converse simultaneously?

# -*- coding: utf-8 -*- #!/usr/bin/python3 import socket # nao tem servidor UDP no google -> vamos usar netcat como servidor UDP! #Programa de chat: so fala um de cada vez #implementar falando ao mesmo tempo client = socket.socket(socket.AF_I...
asked by 16.08.2016 / 00:07
2
answers

View in Django does not return HttpResponse object

I'm doing a simple CRUD in Django for learning purposes, but I'm having a problem. When creating a view to add data to a schedule, the server returns the following error:    The view agenda.views.add does not return an HttpResponse object....
asked by 17.03.2014 / 07:03
1
answer

How to accent in Python

I'm writing a program and it gets giving ascii error. I've already put this on the first line and nothing: # -*- coding: utf-8 -*- On request, it follows edition explaining what is now. now it is variable for datetime and I believe it...
asked by 20.05.2015 / 01:43
2
answers

How to clone a list with Python 3?

From list m : m = [[' # ', ' # ', ' # ', ' # ', ' # ', ' # '], [' # ', ' # ', ' # ', ' # ', ' # ', ' # '], [' # ', ' # ', ' # ', ' # ', ' # ', ' # '], [' # ', ' # ', ' # ', ' # ', ' # ', ' # '], [' # ', ' # ', ' # ', ' # ', ' # ', ' #...
asked by 28.08.2018 / 19:54
1
answer

Differences between __name__ and __qualname__

In Python functions / methods and classes have two attributes that in their most basic use seem to do exactly the same thing, they are: __name__ and __qualname__ , see: def fn(): pass class C(object): pass >>>...
asked by 28.10.2018 / 02:39
1
answer

How to finish executing the code in Python 3?

print('Calcula raizes equação 2º grau') a = float(input('Informe o Valor de A')) while a == 0: print('a equação não é do segundo grau') break b = float(input('Informe o Valor de B')) c = float(input('Informe o Valor de C')) delta = (b **...
asked by 16.09.2018 / 20:05
3
answers

Calling a Python function for the text present in a variable

I'm new to Python and I'd like to know if it's possible for me to call a function by the present text in a variable, for example: I asked the user to enter the name of a function, and save what was typed in 'func' , after that how to call th...
asked by 12.11.2017 / 06:44
2
answers

Word count using dictionary

I need to count the occurrences of words in a text based on a list of predetermined words. I made the text a list of string , the words are in a set ( set ) palavras_procuradas = {'de', 'solução', 'mesa', 'teste', 'acabaxi'} tex...
asked by 22.04.2018 / 13:11