Questions tagged as 'python-3.x'

1
answer

How to create a program that multiplies matrices?

I try to make a program that multiplies two matrices given by the user. What I have managed to do is this: def CrearMatrizA (m, n): return [[0.0 for j in range (n)] for i in range (m)] def CrearMatrizB (m, n): return [[0.0 for k in ran...
asked by 10.04.2017 / 02:26
1
answer

Python - Read list within matrix, which has been saved in text file

Greetings. I have a 16 x 8 matrix that, in turn, contains lists in some of its coordinates. I know how to send the matrix to a text file, but I can not take the data from the file and rewrite it in a new matrix as integers, respecting the int...
asked by 26.02.2017 / 02:06
2
answers

File name change script in python 3.5

I have to make a script in python 3.5 to rename the files in a folder, but the script does not run, I do not know why. Thank you for your attention: Here is the code: import os def rename_files (): # 1) Vamos a obtener el nombre de...
asked by 14.07.2016 / 18:14
2
answers

How can I create another object without taking the same values?

I have my graph implementation program. The issue is that I would like to try other graphs with the same classes but to declare more graphs I always print the same. But I have no idea how this is done in Python, could someone advise me? class...
asked by 20.03.2017 / 22:16
1
answer

HOW DO I SOLVE IT? I get an error in line 110, in module Action_List (4) NameError: name 'Activity_List' is not defined?

# importando modulos necesarios import matplotlib.pyplot as plt import numpy as np import seaborn as sns import random as rm #Estados(Nodos)-->4 EVENTOS Estados=["Dormir","Entrenar","Correr","Jugar"] Lista_Actividad=[] #Posibles secuencia...
asked by 14.11.2018 / 01:12
1
answer

problem with functions

Good morning colleagues could tell me what error my code has when executing it always what is in the "except ValueError" I have already tried doing it in other ways and it does not give me this is my code: #-*coding:utf-8-*- '''7. Construir u...
asked by 20.11.2018 / 17:39
1
answer

Problems with treeview Tkinter Python

I have problems so that I print the table data correctly and sorted, it prints only one tuple and it does not show the first record. what could be my mistake. Thanks for the help. import psycopg2 from psycopg2.extras import RealDictCursor from...
asked by 15.11.2018 / 16:10
2
answers

Is there a simple way to convert a list of type str to one of type int?

This is what I try: example1: a=['1','2','3','4'] for m in range(len(a)): int(a[m]) print(a) But then I realized that for example in: example 2: a=['1','2','3','4'] b= [] int(a[0]) b = b + [a[0]] print(b) #Output b = ['1']...
asked by 13.11.2018 / 01:50
1
answer

how to solve two views of the same url (Home) - Django

How is it going? I write because I do not know how to solve the following question in Django (from my condition again in this): I have two apps that must be shown in the same template. That is, they share the url that is the home, and they ha...
asked by 04.11.2018 / 17:48
1
answer

Pager with format 1 2 3

Hello, I'm using the django paginator 1.8 (paginator) works fine, but I would like you to show me the number of my pages in this way I have 21 records that means I have 3 pages and the pager should show: < < 1 2 3 > > but it...
asked by 18.03.2016 / 17:40