Questions tagged as 'python-3.x'

1
answer

Transcribe program to Python 3.6

You will see I found this code that is very useful to me but it is written in python 2.6 and I need to pass it to python 3.6. someone could help me. import matplotlib.pyplot as plt import scikits.audiolab as audiola **#Este modulo solo esta pa...
asked by 24.03.2018 / 02:56
2
answers

Print list within another list

I have the following statement:    A teacher takes measurements of the heights of his students in his class.   For each of the 10 students, take the measurements twice a year.   We will make a program that allows us to enter 10 height values...
asked by 03.06.2018 / 17:23
1
answer

Print large values with format

As an example, if I have f=10000000 print(f) >>>1000000 but what I'm looking for is that instead of printing 1000000 I printed 1'000,000 I would like to know how I can get what I want. Thanks     
asked by 19.03.2018 / 16:31
1
answer

Problem in the function call in Python 3

I have a code in python 3 and it gives me errors in calls to defined methods. My code: import hormiga import tareas class Colonia: def __init__ (self, tareas, n_iteraciones, evaporacion=0.1, n_hormigas=20): self.__constanteEva...
asked by 03.02.2018 / 14:35
1
answer

get the sum of an attribute django models

Good morning: I have a model Order and I need general a summary of all the orders that have been generated in the last 15 days, then I want to generate the total of all the orders and I do not know how to do it. for the moment I have this: ped...
asked by 18.01.2018 / 09:48
3
answers

How to do an accountant recursively?

I need to do a recursive function that counts from 1 to a number entered by the user. I have this: def contador(num): #caso base if num == 1: return num else: return contador(num) num=int(input("Hasta que número...
asked by 19.01.2018 / 22:28
2
answers

How to emulate the do-while cycle in python?

Some of you could tell me how to emulate the do-while cycle in python, looking for in different pages I found the following code while True: stuff() #que hace esa funcion o alguno puede ser tan amable de darme un ejemplo de uso if f...
asked by 19.02.2018 / 21:24
2
answers

Managing an ImageField in Django - Rendering it in an html template

I have a custom user model in which I want to add a user avatar field: class User(AbstractBaseUser, PermissionsMixin): # email # username # first_name # last_name slug = models.SlugField(max_length=100,blank=True)...
asked by 13.06.2017 / 17:41
2
answers

How to nest splits in Python?

Following this question , I began to think, that it is a fairly common pattern, to interpret a string with "pairs" of values separated by some character, and how to solve it in Python ?. Let's see the example: We have this string: texto =...
asked by 07.09.2017 / 19:09
1
answer

Error pressing QPushButton

Dear I have a small application in pyqt5 and QT DESIGNER. The application works well only when you run the "clean" button the application stops working. I leave the code to see if someone can help me where the error is generated....
asked by 23.12.2017 / 02:08