Created
April 24, 2018 12:16
-
-
Save Fhernd/3f5b54446e1031b7df113ca52e817875 to your computer and use it in GitHub Desktop.
Formatear el texto de un número particular de columnas. OrtizOL.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import textwrap | |
crimen_y_castigo = "A las demás personas que estaban en la taberna, \ | |
sin excluir al tabernero, las miraba con un gesto de desagrado, con una \ | |
especie de altivo desdén, como a personas que considerarse de una esfera \ | |
y de una educación inferiores para que mereciesen que él les dirigiera la palabra." | |
print(textwrap.fill(crimen_y_castigo, 80)) | |
print('') | |
print(textwrap.fill(crimen_y_castigo, 40)) | |
print('') | |
print(textwrap.fill(crimen_y_castigo, 40, initial_indent=' ')) | |
print('') | |
print(textwrap.fill(crimen_y_castigo, 40, subsequent_indent=' ')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment