程序员的生活记录

Python获取模块文档


Listen Later

"""
自定义分页的脚本
"""
def more(text,numlines=15):
lines = text.splitlines()
while lines:
chunk = lines[:numlines]
lines = lines[numlines:]
for line in chunk:print(line)
if lines and input('More?') not in ['y','Y']:break

if __name__ == '__main__':
more("OnePage\nTwoPage\nThreePage",1)
...more
View all episodesView all episodes
Download on the App Store

程序员的生活记录By 程序员的生活记录