# -*- coding: utf-8 -*-

#BE 00

# 引入 argv 模块
from sys import argv
# 参数解包(unpake)
script,input_life = argv
# 定义函数:打印目标文件所有内容
def print_all(f):
    print(f.read())
# 定义函数:文件读取指针在目标文件重头读起
def rewind(f):
    f.seek(0)
# 定义函数:打印目标行数以及目标行数对应的内容
def print_a_line(line_count,f):
    print(line_count,f.readline())
# 打开目标文件
current_file = open(input_life)
# 给出提示,运行函数:打印脚本所有内容
print("First let's print the whole file:\n")

print_all(current_file)
# 给出提示,运行函数:改变文件读取指针的位置
print("Now let's rewind,kind of like a tape.")

rewind(current_file)
# 给出提示,运行函数:打印对应三行
print("Let's print three lines:")

current_line = 1
print_a_line(current_line,current_file)

#current_line = current_line + 1
current_line += 1
print_a_line(current_line,current_file)

#curent_line = current_line + 1
current_line += 1
print_a_line(current_line,current_file)

# 函数和文件是如何一起发挥作用的?
    # 通过变量传递
# 怎样传递当前行号信息?
    # file.seek(0)

# Dk

## 

b26c2e7c21586467f7f3afcfb9bf23600268ffd4
<mask token>


def print_all(f):
    print(f.read())


def rewind(f):
    f.seek(0)


def print_a_line(line_count, f):
    print(line_count, f.readline())


<mask token>

<mask token>


def print_all(f):
    print(f.read())


def rewind(f):
    f.seek(0)


def print_a_line(line_count, f):
    print(line_count, f.readline())


<mask token>
print("First let's print the whole file:\n")
print_all(current_file)
print("Now let's rewind,kind of like a tape.")
rewind(current_file)
print("Let's print three lines:")
<mask token>
print_a_line(current_line, current_file)
current_line += 1
print_a_line(current_line, current_file)
current_line += 1
print_a_line(current_line, current_file)

<mask token>
script, input_life = argv


def print_all(f):
    print(f.read())


def rewind(f):
    f.seek(0)


def print_a_line(line_count, f):
    print(line_count, f.readline())


current_file = open(input_life)
print("First let's print the whole file:\n")
print_all(current_file)
print("Now let's rewind,kind of like a tape.")
rewind(current_file)
print("Let's print three lines:")
current_line = 1
print_a_line(current_line, current_file)
current_line += 1
print_a_line(current_line, current_file)
current_line += 1
print_a_line(current_line, current_file)

from sys import argv
script, input_life = argv


def print_all(f):
    print(f.read())


def rewind(f):
    f.seek(0)


def print_a_line(line_count, f):
    print(line_count, f.readline())


current_file = open(input_life)
print("First let's print the whole file:\n")
print_all(current_file)
print("Now let's rewind,kind of like a tape.")
rewind(current_file)
print("Let's print three lines:")
current_line = 1
print_a_line(current_line, current_file)
current_line += 1
print_a_line(current_line, current_file)
current_line += 1
print_a_line(current_line, current_file)

# -*- coding: utf-8 -*-

#BE 00

# 引入 argv 模块
from sys import argv
# 参数解包(unpake)
script,input_life = argv
# 定义函数:打印目标文件所有内容
def print_all(f):
    print(f.read())
# 定义函数:文件读取指针在目标文件重头读起
def rewind(f):
    f.seek(0)
# 定义函数:打印目标行数以及目标行数对应的内容
def print_a_line(line_count,f):
    print(line_count,f.readline())
# 打开目标文件
current_file = open(input_life)
# 给出提示,运行函数:打印脚本所有内容
print("First let's print the whole file:\n")

print_all(current_file)
# 给出提示,运行函数:改变文件读取指针的位置
print("Now let's rewind,kind of like a tape.")

rewind(current_file)
# 给出提示,运行函数:打印对应三行
print("Let's print three lines:")

current_line = 1
print_a_line(current_line,current_file)

#current_line = current_line + 1
current_line += 1
print_a_line(current_line,current_file)

#curent_line = current_line + 1
current_line += 1
print_a_line(current_line,current_file)

# 函数和文件是如何一起发挥作用的?
    # 通过变量传递
# 怎样传递当前行号信息?
    # file.seek(0)

# Dk

## 
