Questions tagged as 'python'

2
answers

I have a problem with if, else python

# Viajes TI=raw_input("Tipo de autobus: "); KM=raw_input("Kilometros a recorrer: "); NPR=raw_input("Numero de personas: "); if TI:"A" CK=2000 else: CK=3000 if NPR<20 NP=20 else NP=NPR TO=NP*CK*KM CP=TO/NPR print("La persona pagara: "), CP prin...
asked by 19.05.2017 / 04:12
1
answer

Problems with the pip install

I wanted to install the ttk libraries but it does not let me, the same to install Tkinter, try pip and did not find anything, I also tried to download them with Pycharm but it does not leave me anyway. I'm trying with Python 2.7 and 3.6     
asked by 06.03.2017 / 03:01
1
answer

Django CORS 'Access-Control-Allow-Origin'

I'm trying to redirect a Django View function to a page in PHP, currently hosted on my own computer. The fact is that I've seen that it gives me a crossover error because I'm calling another link from my own team. I have found a module cal...
asked by 29.01.2018 / 10:05
4
answers

How to install and use PyQt5 in Windows?

Good, download PyQt5 from your official website and in some videos I see that it brings an "executable" file called a designer. When downloading it does not bring said file, only a folder called so I do not know what to do with it, so how can I...
asked by 07.05.2017 / 03:33
1
answer

Results of a function in a DataFrame in python

I have a function in python that uses values from two columns labeled as 'POSITION_X' and 'POSITION_Y' in a .csv file (df1) The function calculates the sum |Xn-Xn+N|+|Yn-Yn+N| where n is the row number and N...
asked by 11.05.2017 / 21:31
1
answer

Difference between input and sys.stdin

When saving a data, whatever the type, what are the advantages of input over sys.stdin and / or vice versa? From what I understand, the result is the same.     
asked by 13.01.2017 / 22:33
3
answers

Python. Socket How to receive all data with socket.recv ()?

I have a problem with receiving data from the server to the client. I have the following function on the client side that tries to receive data from the server. The data sent by the Server using the function socket.sendall(datos) is great...
asked by 11.01.2017 / 15:59
1
answer

Set range of values for random.randrange ()

I have a problem in Pygame when trying to get random values within a range with random.randrange , this is my code: import random import pygame WIDTH = 800 HEIGHT = 600 RED = (255, 0, 0) GREEN = (0, 255, 0) BLUE = (0, 0, 255) WH...
asked by 25.01.2017 / 00:43
1
answer

Simplify and optimize a simulator of a game in python

In recent weeks, with the help of the community, I have developed this program that simulates a signal game during two rounds with four participants. The game that simulates is that in each round each participant shows a signal and observes anot...
asked by 30.12.2016 / 18:56
3
answers

Search for words within another

I want to know if you have entered a domain or an ip. I have already tried several things: addr = raw_input('Introduce la ip o el nombre de dominio: ') addrs= [".com", ".es"] if addr in addrs: print "es un dominio" else: print "e...
asked by 24.02.2017 / 19:30