ich versuche einen binary string in einem command zu benutzen. Die script ist ungefaehr so:
Code: Alles auswählen
import commands
import Image
# open the image
img = Image.open('1883.jpg')
# create thumbnail
img.thumbnail((128,128))
# now I create a raw string for the image data
thumb = img.tostring()
# now I want to use the raw string in a command.
# this could be any command, in my case I want
# to use setfattr, which sets an extended attribute
# on an XFS file system (I know this works from the
# command line, so this cannot be my problem...)
commands.getoutput('setfattr -n user.some -v ' + thumb + ' "1883.jpg"')
Any suggestions, please???