Questions tagged as 'python'

2
answers

How to render the form from the template and see it in admin

I'm using Django 1.11.4, root app url(r'^contacto/', include('contacto.urls'), name='contacto'), contact_app / urls.py from django.conf.urls import url, include from contacto.views import contacto urlpatterns = [ url(r'^$',...
asked by 08.05.2018 / 02:12
1
answer

Print output of the console in txt file using Python [closed]

How can the output of a python program be saved in a txt file?     
asked by 05.05.2018 / 22:29
2
answers

Python take value of a string after removing part of it

What I try to do is put as input value a string where I have to remove the word "name:" and take the first value of the one that follows regardless of whether there is space. example: Entry: Name: Pablo exit- > p If you could help me I try...
asked by 04.05.2018 / 18:14
1
answer

Use a list generated in another Python file

I have a Python file with a function where I generate a list. This list will be used in other Python files. I'm doing it by importing the Python function that generates the list. How do I load the list in the other files? Python code that...
asked by 10.04.2018 / 10:52
3
answers

Matrix MxN, fill vector with matrix values.

import random n = int(input("Ingrese el numero de fila: \n")) m = int(input("Ingrese el numero de columna: \n")) #a = n*m matriz = [] for i in range(n): for j in range(m): matriz[i][j] = random.randint(0, 100) print(matriz) I h...
asked by 28.04.2018 / 04:48
2
answers

Pip does not install packages: [Errno 13] Permission denied

I want to install packages for Python 3.6.5 When entering pip install pygame I get this: C:\Users\rayvi>pip install shell Collecting shell Using cached https://files.pythonhosted.org/packages/c1/19/5fc161e830b08bf2b419a04b0105f2dbf0957591...
asked by 27.04.2018 / 00:45
1
answer

Problems with Django, when installing the cymysql plugin to connect to the database

What I am using: Operating system: Debian 9 Database: MySQL 5.5 Django 1.11.4 I execute the command: python manage.py migrate The following error message is displayed in the terminal: django.core.exceptions.ImproperlyConfigured...
asked by 28.02.2018 / 04:46
1
answer

Help with error in a for cycle to obtain a value of an array

I have an array: array = [[1,2,3],[4,5,6]] and I want that with one cycle to print on screen only 2 and 5, for that I did: for i in array: print(array[i][1]) but then I get the following error:    TypeError: list indices must be...
asked by 04.03.2018 / 21:14
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
1
answer

It is possible to define the destination path when saving a .csv file in python3.XX

Without needing to open a .csv file, I need to generate a new csv document. and when scheduled to be saved, it is hosted on a destination path defined by the user.     
asked by 23.02.2018 / 18:28