- How to repeat Procedures&Control
CS重要概念
1.1 过程procedures
封装代码,代码重用
1.2 控制Control
DEMO
# -*- coding: UTF-8 -*- # procedures过程def get_next_target(page): start_link = page.find('link 1 is a link3')# >>>test1# >>>test2# >>>test3# content = get_page('http://xkcd.com/353/') # print_all_links(content)print_all_links(get_page('http://xkcd.com/353/'))#print_all_links(get_page('https://www.baidu.com/'))