Skip to content

Instantly share code, notes, and snippets.

@l337quez
Created September 9, 2019 15:35
Show Gist options
  • Save l337quez/98e5f9644f35e9c781d8862db25fdbc9 to your computer and use it in GitHub Desktop.
Save l337quez/98e5f9644f35e9c781d8862db25fdbc9 to your computer and use it in GitHub Desktop.
Leer lineas especificas de un archivo de texto
f=open("lineas.txt","r")
lines = f.readlines()
#leemos la linea 0
ip=lines[0]
#le quitamos el salto de linea al final
ip=ip[:-1]
#leemos la linea 1
puerto=lines[1]
puerto=puerto[:-1]
print(ip)
print(puerto)
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment