上一页 1 ··· 67 68 69 70 71 72 73 74 75 ··· 280 下一页
摘要: 阅读全文
posted @ 2019-07-26 13:00 樊伟胜 阅读(1191) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-07-26 12:59 樊伟胜 阅读(460) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-07-26 12:58 樊伟胜 阅读(120) 评论(0) 推荐(0) 编辑
摘要: import shutil import os import os.path src = " d:\\download\\test\\myfile1.txt " dst = " d:\\download\\test\\myfile2.txt " dst2 = " d:/download/test/测 阅读全文
posted @ 2019-07-25 14:10 樊伟胜 阅读(512) 评论(0) 推荐(0) 编辑
摘要: import os.path # 常用函数有三种:分隔路径,找出文件名.找出盘符(windows系统),找出文件的扩展名. # 根据你机器的实际情况修改下面参数. spath = " D:/download/repository.7z " # case 1: p,f = os.path.split( 阅读全文
posted @ 2019-07-25 14:09 樊伟胜 阅读(10211) 评论(0) 推荐(0) 编辑
摘要: import os import os.path # os,os.path里包含大多数文件访问的函数,所以要先引入它们. # 请按照你的实际情况修改这个路径 rootdir = " d:/download " for parent, dirnames, filenames in os.walk(ro 阅读全文
posted @ 2019-07-25 14:07 樊伟胜 阅读(577) 评论(0) 推荐(0) 编辑
摘要: 每一个.py文件称为一个module,module之间可以互相导入.请参看以下例子: # a.py def add_func(a,b): return a+b # b.py from a import add_func # Also can be : import a print ("Import  阅读全文
posted @ 2019-07-25 14:06 樊伟胜 阅读(201) 评论(0) 推荐(0) 编辑
摘要: class Base: def __init__(self): self.data = [] def add(self, x): self.data.append(x) def addtwice(self, x): self.add(x) self.add(x) # Child extends Ba 阅读全文
posted @ 2019-07-25 14:05 樊伟胜 阅读(222) 评论(0) 推荐(0) 编辑
摘要: #! /usr/bin/python s=input("Input your age:") if s =="": raise Exception("Input must no be empty.") try: i=int(s) except Exception as err: print(err) 阅读全文
posted @ 2019-07-25 14:04 樊伟胜 阅读(483) 评论(0) 推荐(0) 编辑
摘要: 对比Java,python的文本处理再次让人感动 #! /usr/bin/python spath="D:/download/baa.txt" f=open(spath,"w") # Opens file for writing.Creates this file doesn't exist. f. 阅读全文
posted @ 2019-07-25 14:04 樊伟胜 阅读(350) 评论(0) 推荐(0) 编辑
上一页 1 ··· 67 68 69 70 71 72 73 74 75 ··· 280 下一页