Questions tagged as 'python'

3
answers

Difference between input () and raw_input ()

I am informing myself with the functions to interact with the user. I'm with the basics: raw_input() e input() . I have read that input() only takes the intenger data, which does not accept strings, and that we use raw_inp...
asked by 09.12.2016 / 02:38
3
answers

Delete duplicate items in a list

I need to find a more efficient way to remove duplicates from a list in Python. I'm doing it this way: for i in mj: if i not in mj2: mj2.append(i) Where kj is a list as [2, 4, 4, 4, 4, 4, 9, 9] and output mj2...
asked by 18.07.2017 / 20:27
1
answer

Success Juggler in Python

I have to create a program that asks the user for natural numbers or 0 to finish and for each number that the user enters, the program must create a juggling sequence and display them on the screen. In turn, when the program ends, you...
asked by 29.11.2018 / 15:43
1
answer

How to right an image in python

I've been looking for a way to straighten a scanned image, more accurate a form, I need a function that automatically straighten it, I've tried with import numpy as np import numpy as np import argparse import cv2 img = cv2.imread('D:/Consecu...
asked by 27.02.2018 / 15:35
2
answers

Django Rest Framework without styles or scripts

Once I have the API working, when I enter the graphical environment ( domain.com/API ) of tests I get no styles, meaning that all < a href="/ questions / tagged / css" class="post-tag" title = 'show questions with the tag "css"'> css and the...
asked by 11.05.2016 / 15:45
7
answers

Find the first row of a matrix containing all positive elements and the sum of these elements

Find the first row of a matrix containing all the positive elements and the sum of these elements. Reduce all elements of this matrix to this sum. To achieve the required, you should find the array that has all the positive elements, save the...
asked by 10.01.2016 / 15:22
4
answers

Understanding the absence of pointers in Python

In some simple applications that I have had to write in C / C ++ I have seen the ease with which certain tasks are solved using pointers . Now, more interested in another language: Python, I have noticed the absence of this concept. What is the...
asked by 04.12.2015 / 00:00
1
answer

Detect and destroy colliding objects

This is the code: import pygame,sys from pygame.locals import * from random import randint ancho = 1280 alto = 720 class Snake(pygame.sprite.Sprite): def __init__(self): pygame.sprite.Sprite.__init__(self) self.Image...
asked by 03.01.2018 / 22:42
4
answers

How to duplicate the elements of a list excluding extremes in python

I have the following lists in python lista_x = [2,3,4,5] lista_y = [6,7,8,9] I try to replicate the current element (excluding the extremes) to the next position. So get something similar to this: lista_x = [2,3,3,4,4,5] lista_y = [6,7,7,...
asked by 26.09.2016 / 00:48
1
answer

Obtain the line and column of an XML node

In this project I am defining object configurations in XML format. An example is this is the case of a contextual menu: <?xml version="1.0" encoding="UTF-8"?> <root> <menu name="remates" widget="uiRemates" onshow="showMenu"...
asked by 19.12.2015 / 02:33