Exemplo n.º 1
0
def makeExecutableTempFile(content, directory, prefix="script"):
    # TODO: Mejorara la generacion de temp, se borra no se borra que onda
    #tempFile = tempfile.NamedTemporaryFile(prefix='pmx', dir = directory)
    descriptor, name = tempfile.mkstemp(prefix=prefix, dir = directory)
    tempFile = os.fdopen(descriptor, 'w+')
    tempFile.write(encoding.force_text(content))
    tempFile.close()
    os.chmod(name, stat.S_IEXEC | stat.S_IREAD | stat.S_IWRITE)
    return name
Exemplo n.º 2
0
def qbytearray_to_hex(qbytearray):
    return encoding.force_text(qbytearray.toHex().data())