上一页 1 ··· 6 7 8 9 10 11 12 下一页
摘要: #!/usr/bin/python # -*- coding: utf-8 -*- with open('e:/123.txt') as fp:row = fp.readlines() #打开并读取所有数据行到列表后赋值给变量 row Category = [] [Category.append(row[i]) for i in range(len(row)) if row[i] not in... 阅读全文
posted @ 2017-06-01 16:00 tec2019 阅读(133) 评论(0) 推荐(0)
摘要: import csv f = open('Desktop.txt','r') f2 = open('Laptop.txt','r') f3 = open('UserList.csv','r') num = 0 num2 = 0 num3 = 0 for line in f.readlines()[1:]: print(line) num=num+1 for line2 in... 阅读全文
posted @ 2016-12-02 14:12 tec2019 阅读(186) 评论(0) 推荐(0)
摘要: import sys import xlrd import traceback def ReadData(FileName): try: workBook = xlrd.open_workbook(FileName) sheetsList = workBook.sheet_names() sheetNum = len(sheetsList) ... 阅读全文
posted @ 2016-11-25 15:57 tec2019 阅读(1264) 评论(0) 推荐(0)
摘要: 任务: 用python时间简单的统计任务-统计男性和女性分别有多少人。 用到的物料:xlrd 它的作用-读取excel表数据 代码: 阅读全文
posted @ 2016-11-24 23:06 tec2019 阅读(14240) 评论(0) 推荐(0)
摘要: 显示数据表结构 1、desc(describe) tablename;2、show columns from tablename;3、use information_schema; select * from columns where table_name='tablename';4、show c 阅读全文
posted @ 2016-10-24 11:20 tec2019 阅读(119) 评论(0) 推荐(0)
摘要: 迭代 1 文件操作 我们读取文件的时候,会用到一个readline()方法,其实它就是一个迭代器,它会返回当前的数据,然后自动的调用内置的next()方法来让文件的读取头自动的移动到当前的下面一行,准备下次的读取,到达文件末尾时,就会返回空字符串. 以下方法读取速度快,占用内存小适合读取大文件。 2 阅读全文
posted @ 2016-10-20 11:17 tec2019 阅读(144) 评论(0) 推荐(0)
摘要: 爬虫架构 运行流程 网页解析器 网页解析器-BeautifulSoup-语法 简单解析实例1 简单解析实例2 综合实例-爬取维基百科词条 阅读全文
posted @ 2016-08-18 21:44 tec2019 阅读(322) 评论(0) 推荐(0)
摘要: 1. I am writing to confirm/enquire/inform you... 我发邮件是想找你确认/询问/想通知你 有关…2. I am writing to follow up on our earlier decision on the marketing campaign 阅读全文
posted @ 2016-08-09 14:04 tec2019 阅读(6308) 评论(0) 推荐(0)
摘要: 协程 协程,又称微线程,纤程。英文名Coroutine。一句话说明什么是线程:协程是一种用户态的轻量级线程。 协程拥有自己的寄存器上下文和栈。协程调度切换时,将寄存器上下文和栈保存到其他地方,在切回来的时候,恢复先前保存的寄存器上下文和栈。因此: 协程能保留上一次调用时的状态(即所有局部状态的一个特 阅读全文
posted @ 2016-04-04 19:55 tec2019 阅读(292) 评论(0) 推荐(0)
摘要: configparser 模块用于对配置操作 官方文档地址https://docs.python.org/3/library/configparser.html 导入configparser模块 import configparser 基本的读取配置文件 -read(filename) 直接读取in 阅读全文
posted @ 2016-04-01 17:26 tec2019 阅读(1147) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 12 下一页