09 2020 档案
摘要:<https://www.cnblogs.com/gufengchen/p/11038029.html>
阅读全文
摘要:1. 控制你的代码 Head First Python支持网站http://python.itcarlow.ie/resources.html,下载webapp.zip, 解压到硬盘。 点击以下红下划线链接下载。 2. CGI让Web服务器运行程序 用python打开simple_htpd.py并R
阅读全文
摘要:http://python.itcarlow.ie/resources.html
阅读全文
摘要:把文本文件中的数据转换为AthleteList对象实例,存储在一个字典中(按选手索引),然后保存为一个pickle文件。 # Author kevin_hou import pickle from athletelist import AthleteList def get_coach_data(f
阅读全文
摘要:问题:from athletelist import AthleteList出现红色下滑波浪线警告 经过个人网上搜索了解,这个问题是因为python找不到相关的.py文件,无法导入athletelist.py模块。 具体操作如下: 1. athletelist->Refactor->Move->H:
阅读全文
摘要:# Author kevin_hou def sanitize(time_string): #格式化时间 if '-' in time_string: splitter = '-' elif ':' in time_string: splitter = ':' else: return (time_
阅读全文
摘要:# Author kevin_hou def sanitize(time_string): #将时间格式化为统一字符串格式 if '-' in time_string: splitter = '-' elif ':' in time_string: splitter = ':' else: retu
阅读全文
摘要:# Author kevin_hou def sanitize(time_string): #将时间格式化为统一字符串格式 if '-' in time_string: splitter = '-' elif ':' in time_string: splitter = ':' else: retu
阅读全文
摘要:建立4个txt记录数据,james.txt/julie.txt/mikey.txt/sarah.txt with open('james.txt') as jaf: #打开文件 data = jaf.readline() james = data.strip().split(',') #以逗号进行分
阅读全文
摘要:# Author kevin_hou with open('james.txt') as jaf: data = jaf.readline() james = data.strip().split(',') with open('julie.txt') as juf: data = juf.read
阅读全文
摘要:strip() 方法可以从字符串去除不想要的空白符。 print() BIF的file参数控制将数据发送/保存到哪里。 finally组总会执行,而不论try/except语句中出现什么异常。 会向except组传入一个异常对象,并使用as关键字赋至一个标识符。 str() BIF可以用来访问任何数
阅读全文
摘要:names = ['A','B','C',['D','E'],['F']] def print_lol(the_list,indent=False,level=0): # for each_item in the_list: if isinstance(each_item,list): print_
阅读全文
摘要:# Author kevin_hou movies = ["The Holy Grail", 1975, "Terry Jones & Terry Gilliam",91, ["Graham Chapman", ["Michel Palin","John Cleese", "Terry Gillia
阅读全文