Questions tagged as 'python-3.x'

1
answer

Capture KeyboardInterrupt

I'm doing a aplicación cli and I need to capture a KeyboardInterrupt at any point in the execution of the program.    My intention is to delete some folders / files that could have   be generated. Is there any solution cr...
asked by 20.10.2017 / 18:48
1
answer

Counters in files

I have created a function that will be part of a small working script with files but I can not get some characters that I am identifying in this function. By the error messages of the shell I deduce that it is a matter of variables that are not...
asked by 20.10.2017 / 13:39
1
answer

how to convert a pdf to jpg

I need to make a program that takes a pdf file that has some data and two graphics and convert it to jpg to insert it into another pdf with additional information or add a second page with the additional information to the pdf. I have been re...
asked by 24.10.2017 / 17:04
1
answer

Bakcup Django Database

Good afternoon, I have an application in Django 1.10 in which today I need to create a backup of the bd, this copy must be made when the user clicks on a button that will be placed in a template and download the copy on the user's computer. I...
asked by 18.10.2017 / 18:40
1
answer

Obtain coordinates of an element in a two-dimensional array based on X and Y

I have the following list: laberinto = [ ['*', '*', '|', '|', '|', '|', '|', '|', '|', '|'], ['|', '*', '*', '*', '|', '|', '|', '|', '|', '|'], ['|', '|', '|', '*', '|', '|', '*', '*', '*', '|'], ['|', '|', '|', '*', '|', '|',...
asked by 13.10.2017 / 00:52
1
answer

Modify global variables

I was doing a very simple program that consists of the user choosing a number between one and one hundred and the computer tries to guess it. If the computer does not guess, you should tell it if the number you chose is a number higher or low...
asked by 21.09.2017 / 22:43
1
answer

how to omit values in python

I try to get an array of averages from a list but there are some gaps then as a condition that I do not use that empty values list = [1, "", 1,2,4, ""] how to add an if wing instruction so that it does not use the NoneType and exit error...
asked by 21.08.2017 / 22:13
1
answer

break does not break the client listening cycle on server when receiving keyword

I have two codes: one the server and the other the client: The server: import socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind(("127.0.0.1", 9999)) s.listen(5) print ("Servidor de Chat\n") while True: pri...
asked by 16.12.2017 / 20:23
1
answer

How can scraping be done on a web page that has javascript with python 3?

Hi, I would like to know how I can scrap a web page that has Javascript using PyQt5, the page from which I want to extract information is this: link From this page I want to take the name of the series and the chapters. This is what I have...
asked by 16.08.2017 / 22:44
2
answers

I do not get a raise with ValueError

I have the following code: def sum_digits(s): r = ''.join(x for x in s if x.isdigit()) newList = list(r) try: result = sum(int(i) for i in newList) except: raise ValueError return result print(sum_digits(...
asked by 28.07.2017 / 17:26