Questions tagged as 'python-3.x'

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
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
2
answers

Python operation

As I understand it, when creating a variable, we are creating an object, and the name of the variable refers to it. If I do: a = 2 a = "Hola" The garbage collector is responsible for deleting object 2, since it does not need it and no ot...
asked by 20.02.2017 / 13:23
2
answers

Problem when defining time zone using tzinfo on datetime using pytz.timezone ()

I found the following problem when creating an object of type datetime with the constructor parameter tzinfo that defines the time zone. To define a time zone I used the pytz module as follows: import pytz as tz import dat...
asked by 09.08.2017 / 23:02
0
answers

How to call a zeep python service?

I'm trying to connect to a SOAP service with the Zeep library. I have a function that mocks the data and makes the call: def cotizacionGuia(self,valor_declarado): wsdl = 'https://redservipruebas.almalogix.com/distribucion/webservices/ws...
asked by 28.03.2018 / 12:26
1
answer

Obtain opposite polynomial

I know it can be silly but I can not find how to do it. I want to know how I can calculate the opposite polynomial created in Numpy regardless of its degree . Example that does not work for me: import numpy as np p0 = np.poly1d([2., 0.,...
asked by 19.04.2016 / 21:22
3
answers

How to find the most repeated number in a list

I have the following list: [0, 1, 2, 3, 4, 6, 6, 17, 16, 9, 10, 23, 12, 13, 14, 15, 16, 17, 18, 4, 20, 4, 22, 23, 24, 4, 4] I wanted to know how to find the number with the most repetitions without having to use a cycle since I do not see i...
asked by 29.03.2018 / 19:17
1
answer

Can you draw rectangles of Riemann sums with Python 3?

I already drew the graph of the equation x ** 2 with Jupyter with the code: from sympy.plotting import plot from sympy.abc import x eq=x**2 plot(eq,(x,-2,2),ylim=(-1,2),line_color="g") that gives us the image: but it is also necess...
asked by 16.10.2016 / 08:07
1
answer

Why does my Keylogger in Python 3.6 save spaces and not the letters it registers?

The program apparently works fine, it creates the file but in it it only writes blank spaces instead of the characters that I wrote. I really need help with this since I do not know the reason for this, I saved it as .pyw Here the code:...
asked by 22.04.2017 / 03:09
2
answers

Request more than 10 data without using so many variables

I just started with this world of Python and I'm doing personal sample software. But I need to ask for too much data. EXAMPLE: dato1 = float(input("Dígame su peso en kg: ")) dato2 = float(input("Dígame su peso en kg: ")) dato5 = float(in...
asked by 22.04.2018 / 01:01