Created
September 9, 2019 15:35
-
-
Save l337quez/98e5f9644f35e9c781d8862db25fdbc9 to your computer and use it in GitHub Desktop.
Leer lineas especificas de un archivo de texto
This file contains hidden or 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
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