file.tell()
tell() 메서드는 파일 스트림에서 현재 파일 위치를 반환합니다.
매개변수
매개변수는 없습니다.
리턴값
파일 스트림에서 현재 파일 위치를 반환합니다.
예제1
f = open("demofile.txt", "r")
print(f.tell())
결과
예제2
f = open("demofile.txt", "r")
print(f.readline())
print(f.tell())
결과
Hello! Welcome to demofile.txt
32
python
강좌
파일
abcde
2022-05-20 15:46