Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created July 18, 2018 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fhernd/747dcd436bacd697d1e22d1259e3ae68 to your computer and use it in GitHub Desktop.
Save Fhernd/747dcd436bacd697d1e22d1259e3ae68 to your computer and use it in GitHub Desktop.
Manipulación de descriptor de archivo como objeto archivo. OrtizOL.
import os
# Descriptor de archivo de bajo nivel:
descriptor = os.open('info.txt', os.O_WRONLY | os.O_CREAT)
# Manipulación como objeto de archivo:
archivo = open(descriptor, 'wt')
archivo.write('La era Python ha comenzado.\n')
archivo.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment