导航

2016年5月20日

摘要: 1.#coding=utf-8f=open("D:\BaiduYunDownload\Test.txt",'r+')print(f.tell())f.readlines()print(f.tell())f.write("\nddddddffds")f.flush()print(f.tell())f. 阅读全文

posted @ 2016-05-20 12:53 4565892 阅读(221) 评论(0) 推荐(0)

摘要: #trancuatefw=open("D:\BaiduYunDownload\\test01.txt","w")fw.write(u"测试吧,中国骚年")fw.write("fsdf\n")print(fw.tell())p=[",,","11","22","\n"]fw.writelines(p) 阅读全文

posted @ 2016-05-20 12:32 4565892 阅读(114) 评论(0) 推荐(0)

摘要: 1.#coding=utf-8#写文件 存在的f=open("D:\BaiduYunDownload\Test.txt","w")f.write("test")f.write(u"中国")f.close()#读文件 存在的q=open("D:\BaiduYunDownload\Test.txt"," 阅读全文

posted @ 2016-05-20 11:45 4565892 阅读(59) 评论(0) 推荐(0)

摘要: 1.pycharm配置 阅读全文

posted @ 2016-05-20 11:29 4565892 阅读(75) 评论(0) 推荐(0)

摘要: 1.如果文件下没有__init__.py文件,程序将不会认为这是一个Python的包。 2.如果要使用from 包 import * 则需要 这样做。 是模块中包含 方法 的文件没有包含类: 在 __init__.py文件下写入 : __all__==['a','b'] 其中 a b 就是这个包下的 阅读全文

posted @ 2016-05-20 10:53 4565892 阅读(141) 评论(0) 推荐(0)

摘要: 1.import Python文件的时候文件名不能跟Python中自带的关键字重复,否则无法使用关键字的方法。 2.Reload(),重载例子 import sysreload(sys)sys.setdefaultencoding("utf-8") 3 pycharm设置默认输utf-8 Setti 阅读全文

posted @ 2016-05-20 10:30 4565892 阅读(121) 评论(0) 推荐(0)

摘要: 类的方法 阅读全文

posted @ 2016-05-20 09:31 4565892 阅读(118) 评论(0) 推荐(0)