Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
- """
- Created on Sun Mar 17 21:24:54 2019
- @author: jhongesell
- """
- # Abrir archivos TXT para lectura
- archivo01 = open("el_principito.txt", "r")
- z01 = archivo01.read()
- print(z01)
- archivo01.close()
- print("**********************")
- archivo02 = open("arreglo_N01.txt", "r")
- z02 = archivo02.read()
- print(z02)
- archivo02.close()
- print("**********************")
- archivo03 = open("arreglo_N01.txt", "r")
- for linea in archivo03.readlines():
- print(linea)
- archivo03.close()
- print("**********************")
- archivo04 = open("MyADCP.txt", "r")
- for linea in archivo04.readlines():
- print(linea)
- archivo04.close()
- print("**********************")
- file01 = open("MyADCP.txt", "r")
- infile01 = file01.readlines()
- print(infile01)
- file01.close
- print("**********************")
- file02 = open("MyADCP.txt", "r")
- infile=file02.readline()
- file02.close
- print("**********************")
- #Programa contador del número de filas
- filepath01 = "MyADCP.txt"
- with open(filepath01) as fp01:
- line01 = fp01.readline()
- cnt = 1
- while line01:
- print("Linea {}: {}".format(cnt, line01.strip()))
- line01 = fp01.readline()
- cnt += 1
- fp01.close
- print("**********************")
- # Del grupo de programación Python en Telegram
- with open("MyADCP.txt", 'r') as f:
- read_data = f.read()
- for line in read_data:
- print(line, end='')
- f.close
- print("**********************")
- filepath = "arreglo_N01.txt"
- with open(filepath) as fp:
- for cnt, line in enumerate(fp):
- print("Linea {}: {}".format(cnt, line))
- fp.close
- print("**********************")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement