Questions tagged as 'python-3.x'

1
answer

Change a field of the parent class in the Django models

I have a parent class where I have an attribute that I want to modify according to the child class: class Service(models.Model): # otros atributos SERVICE_TYPE = { 'None': 'Unknown service type', 'visa': 'Visa', } ser...
asked by 09.11.2018 / 20:53
0
answers

'NoneType' object has no attribute '_nserie' - Python Collections

I have the following classes: class Contenedor: def __init__(self, nserie, categoria, peso): self._nserie = nserie self._categoria = categoria self._peso = peso @property def categoria(self):...
asked by 07.11.2018 / 23:17
0
answers

Problem when compiling with kivy with Buildozer

Hi, I'm new with kivy and with Buildozer. I want to compile a button and pass it to Android, phone. but it does not compile me. #!/usr/bin/python import kivy from kivy.app import App from kivy.uix.label import Label from kivy.uix.button import...
asked by 08.11.2018 / 20:28
0
answers

open netcdf files in python

I want to open an .nc file in python but I get the following problem, which I do not understand what it means.         from netCDF4 import Dataset           rootgrp = Dataset ("cdd_ACCESS1-3_OND_1979-2005_2.5bilineal.nc", format="NETCDF4")...
asked by 07.11.2018 / 15:55
1
answer

how do the elements of a list go from one function to another?

I would like to know how to pass the list of the function "repeat_question" to the function "main". I try with "return name" but it does not happen. In what failure? def main(): print('escribe algunos nombres y luego presiona enter:')...
asked by 07.11.2018 / 05:07
0
answers

PermissionError: [Errno 13] Permission denied

I am creating an application in python (3.4) with tkinter and I am compiling it with pyinstaller. The code fragment that brings the error is this: client = paramiko.SSHClient() known_hosts = open(self.resource_path("known_hosts")) # Linea 73 c...
asked by 05.11.2018 / 14:38
0
answers

pd.cut to establish quintiles based on the filtering of a field

I have an excel with three columns, one is the family code, another the product code and the other the price of the product, so I would have something similar to this: 1. Familia Producto Precio 1. -------- --------- -------- 1....
asked by 05.11.2018 / 13:30
0
answers

Diagonal matrix problem

partners could help me with this code I need to print the two diagonals of a matrix and the problem is that it only prints the main diagonal (the one that starts from the left corner) try: matriz=[] matriz2=[] longitud=3 for a in range(3):...
asked by 05.11.2018 / 19:43
1
answer

Update the status of a widget in tkinter

I've been trying to make a button in tkinter update. The thing is that putting what I thought was right and the solutions of other Stackoverflow questions, still does not work. The example: def cambiacolor(): boton.config(bg= "Gray")...
asked by 05.11.2018 / 18:54
1
answer

How can I check that the FTP login has been made?

Is there anything that can help me know if the login has been made or, if it has not been done, send a message to my log? ftp = FTP(dirServer) ftp.login(user=usuario, passwd=passwd)     
asked by 08.11.2018 / 14:17