Ver Mensaje Individual
  #3 (permalink)  
Antiguo 07/11/2012, 13:55
Avatar de Carlangueitor
Carlangueitor
Moderador ლ(ಠ益ಠლ)
 
Fecha de Ingreso: marzo-2008
Ubicación: México
Mensajes: 10.037
Antigüedad: 16 años, 1 mes
Puntos: 1329
Respuesta: Espacio al principio de string multiline

Tienes algunos errores, pero no veo que deje un espacio como dices:

Código Python:
Ver original
  1. import codecs
  2. textoarchivo = r"""<?php
  3.    header('Content-Description: File Transfer');
  4.    header('Content-Type: text/plain');
  5.    header('Content-Disposition: attachment; filename=trash.txt');
  6.    header('Content-Length: '.filesize('trash.txt'));
  7.    readfile('trash.txt');
  8.    exit();?>"""
  9.  
  10. f = codecs.open('descarga.php','w', 'utf8')
  11. f.write(textoarchivo)
  12. f.close()

Saludos
__________________
Grupo Telegram Docker en Español