Questions tagged as 'python-2.x'

3
answers

Delete space between two print

How can I eliminate the space between 2 print different in Python? For example: num = raw_input() num = float(num) result="" while num>=1000: result+= "M" num = num - 1000 if num>=900: result+= "CM", num=num-900 if...
asked by 16.05.2018 / 23:49
1
answer

It does not show the images

I'm practicing with Python 2 and Tkinter, the problem is that when I try to add an image it does not appear. The code is this: image= tk.PhotoImage("1473185883EMBW_07.gif") image=image.subsample(1,1) label=tk.Label(image=image) label.place(...
asked by 16.05.2018 / 00:14
1
answer

Problem with Fibonacci recursion

Hello, very recently we started with recursion and I do not understand it very much, they ask to create a program that makes the fibonacci succession but in several cases it gives me another value #Fibonacci def fibonacci(n): if n==1 or n...
asked by 16.10.2018 / 01:18
1
answer

global name 'K_ENTER' is not defined

That error comes to me when I try to press the enter or even when I want to press the space I get the same error ... def Menu(): #Llama a la variable global dificultad global dificultad #Carga y guarda la imagen de la carpeta dibujo...
asked by 10.10.2018 / 09:32
0
answers

What does "libpng warning: iCCP: known incorrect sRGB profile" mean?

The game works and everything but once you lose or win this message seems to you in the compiler (In my case I use spyder) libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iC...
asked by 10.10.2018 / 01:39
1
answer

How does self work in python? [duplicate]

I would like to know how self works in python, I know that it has to do something with the classes but I do not have it so clear and I need to know to convert it into an arrangement, here there is little of the code class Button(pygame.sprit...
asked by 07.10.2018 / 06:44
0
answers

UnicodeDecodeError: 'ascii' codec can not decode byte 0xc3 in position 18: ordinal not in range (128)

Well no idea what happened, change the code to another folder to send it and I have given these errors No se puede cargar imagen: mmempty.png Traceback (most recent call last): File "C:\Python27\lib\site-packages\IPython\core\interactiveshell...
asked by 08.10.2018 / 23:28
1
answer

Create menu and difficulty in pygame

I have everything ready, I just need to create the menu and I do not know where to put it, the complete code is this import pygame, sys, os, random from pygame.locals import * pygame.init() #Se crea la ventana y le damos un titulo screen = py...
asked by 09.10.2018 / 01:55
0
answers

graph = Graph (g) NameError: name 'Graph' is not defined. HOW DO I RESOLVE IT?

introducir el código#TAD DE DIJKSTRA, algoritmo de caminos mínimos. #es un algoritmo para la determinación del camino más corto. #dado un vértice origen. #hacia el resto de los vértices en un grafo que tiene pesos en cada arista. ############...
asked by 28.06.2018 / 17:11
1
answer

Read csv data double quote in python

I'm trying to read data from a csv file, especially numbers but I'm getting an unexpected result. example: csv: "17.913,92";"17.913,92"; import csv with open('eggs.csv', 'rb') as csvfile: reader = csv.reader(csvfile, delimite...
asked by 15.06.2018 / 20:32