Tengo un código:pitón: no se puede concatenar 'str' y objetos 'tupla' (! Debiera obras)
print "bug " + data[str.find(data,'%')+2:-1]
temp = data[str.find(data,'%')+2:-1]
time.sleep(1)
print "bug tuple " + tuple(temp.split(', '))
Y después de esto mis aplicación muestra:
bug 1, 2, 3 Traceback (most recent call last): File "C:\Python26\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 312, in RunScript exec codeObject in main.dict File "C:\Documents and Settings\k.pawlowski\Desktop\atsserver.py", line 165, in print "bug tuple " + tuple(temp.split(', ')) TypeError: cannot concatenate 'str' and 'tuple' objects
I no sé lo que hago mal print tuple ('1, 2, 3' .split (',')) funciona correctamente.
¡En caso de duda, pruébelo en el intérprete interactivo! '>>>' ftw! – jathanism