Created
August 8, 2019 22:07
-
-
Save parzibyte/724fc02f7c2d3243f8d5a309078ddaf9 to your computer and use it in GitHub Desktop.
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
Hola, escribiendo texto | |
parzibyte.me | |
Podemos llamar a write múltiples veces |
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
""" | |
Escribir datos en un archivo con Python | |
Ejemplo 1: crear archivo y sobrescribir contenido | |
https://parzibyte.me/blog | |
""" | |
nombre_archivo = "readme.txt" | |
with open(nombre_archivo, "w") as archivo: | |
archivo.write("Hola, escribiendo texto\n") | |
archivo.write("parzibyte.me\n") | |
archivo.write("Podemos llamar a write múltiples veces") | |
# No olvides cerrar el archivo | |
archivo.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment