Questions tagged as 'python'

1
answer

How to make the python for the same function as in c ++

python code nx = 5 ny = 2 a=[[0]*nx]*ny for x in range(0, ny): for y in range(0, nx): a[x][y]=x * nx + y print(x * nx + y) print("===========") for x in range(0, ny): for y in range(0, nx): print(a[x][y]) c +...
asked by 20.03.2017 / 05:16
1
answer

Multiprocessing with threads in Python

I'm doing a program to process files by thread but I can not get parallelism. In the program I have the following structure for the creation of the threads, but I work one at a time for all cases. import threading import time def main():...
asked by 17.03.2017 / 02:04
1
answer

Digital stamp with python

Greetings to all! I am preparing some documents in pdf using python, and to give it a formal validity, we want to include a digital seal composed of a text string, where there is a unique key or stamp for each document, basically they are pro...
asked by 09.02.2017 / 03:32
2
answers

'int' object is not subscriptable. Lists in Python

Good afternoon, I'm doing a simple didactic program that is responsible for reaching an X number with certain operations. My code is as follows: ##Los numeros de la persona numeroP1 = [0,0,0,0] numeroP2 = [0,0,0,0] ##Los numeros de la computad...
asked by 22.10.2016 / 20:26
3
answers

Error with Column Name in Django

I have a problem with a database in SqlServer 2008, I'm doing some reports to show them in a Django project from a production database, which is used by another system, I have the following view: class DetalleDeuda(ListView): model = T090D...
asked by 27.07.2016 / 02:20
1
answer

Load folder files and write them to a file?

I would like to know what the script is like to read all the files in a folder and put all the lines together (copy them) into a new file and at the beginning of each line the name of the separate source file appears with a space of the content...
asked by 30.11.2018 / 19:15
2
answers

Convert date to string in date format

I'm trying to convert the date format    November 6, 2018 in    11/6/2018 as follows: datetime.datetime.strptime(fecha_inicio_,'%d-%B-%Y') and I get the following error, I was trying other convinations but I always get the sam...
asked by 01.11.2018 / 17:17
1
answer

how can I do for while to repeat the variable 'name' a certain number of times?

def fun (): re_ingresar = True num_nombres = int(input('cuantos nombres vas a escribir?')) while (re_ingresar): nombre = input('escribe un nombre:') #el output te repite 'escribe un nombre' infinidad de veces, #pero estoy trat...
asked by 05.11.2018 / 02:18
1
answer

My string gives line breaks without I wanting it

TINTA=[''' _ |---| |---| |---| |---| |---| |---| \ / ' '''] TINTA2=[''' _ | | |---| |---| |---| |---| |---| \ / ' '''] TINTA3=[''' _ | | | | |---| |---| |---| |---| \ / ' '''] TINTA4=[''' _ | | | | | | |---| |-...
asked by 16.11.2018 / 19:16
1
answer

Error in Python IndentationError: unindent does not match any outer indentation level

I have this code in Python version 3.6 #! /usr/bin/python #-*- coding: utf-8 -*- import pxssh usuario = open("usuario.txt", "r") for usuario in usuario.read().split("\n"): password = open("password.txt", "r") for password in passwor...
asked by 17.10.2018 / 03:31