小编Fle*_*sis的帖子

TypeError:一元的坏操作数类型 - :'str'

我在Windows上遇到Python 2.7.3-32bits的问题.我把这段代码看看有没有人可以帮我解决这个错误.评论是西班牙语,但不影响代码.

 import gtk
 import numpy
 import math
 import os

 #Pedimos el nombre de la imagen de origen
 nombreFich = input("Por favor, introduzca el nombre de la imagen de origen:")

 #Validar que existe el fichero
 imagen1 = gtk.Image()
 imagen1.set_from_file('C:\\Users\\xxx\\Desktop\\xxxx.png')
 pb1 = imagen1.get_pixbuf()
 pm1 = pb1.get_pixels_array()

 #Hacemos una copia de la imagen
 pm2 = pm1.copy()

 #Validamos los puntos de distorsion hasta que sean validos
 puntos = " "
 arrayPuntos = " "
 while(puntos == " " and len(arrayPuntos) < 4):
     print"Por …
Run Code Online (Sandbox Code Playgroud)

python string typeerror python-2.7

6
推荐指数
1
解决办法
4万
查看次数

标签 统计

python ×1

python-2.7 ×1

string ×1

typeerror ×1