06 2016 档案
摘要:在习题—41遇到这个模块/库, 有兴趣的参考下面这个网址: http://blog.sina.com.cn/s/blog_b369b20d0101kb7m.html # coding: utf-8 import urllib # 导入urllib模块 baidu = urllib.urlopen('
阅读全文
摘要:自觉不才,使用def语句时容易出现以下错误, 参考: 习题—25 http://www.2cto.com/shouce/Pythonbbf/ex25.html def add(): print "A true man does what he will, not what he must!" add
阅读全文
摘要:这个程序的核心内容就是def语句,if语句和while语句循环的重复使用。 参考: 习题—35 Q^Q 2个多月了,没想到还会回来再修改这个程序,实在是世事难料呀! from sys import exit 这句可以不用,因为系统本身就自带这个函数,不信你在命令行或控制台 (powershell)
阅读全文
摘要:1. 说是从一个文件复制到另一个文件, 其实还是读写啦,参考:习题—17 http://www.2cto.com/shouce/Pythonbbf/index.html # coding: utf-8from sys import argv # 导入argv模块from os.path import
阅读全文
摘要:1. 先读后写,逐行输入,同样是先open()再read(), 'r':(read)只读,'w':(write)写,'a':(append)追加。 参考: 习题—16 http://www.2cto.com/shouce/Pythonbbf/index.html # coding: utf-8 #
阅读全文
摘要:1. 利用open()打开文件后再用read()读取。 以下示例分别是对两个文件进行读取! 参考:习题—15 # coding: utf-8 from sys import argv # 导入变量参数 script, filename = argv # 将变量参数解包给script和filename
阅读全文

浙公网安备 33010602011771号