python
jhy2
这个作者很懒,什么都没留下…
展开
-
Chapter 9 Dictionaries Assignment 9.4
name = raw_input("Enter file:")if len(name) fh=open(name)counts =dict()ww=list()for line in fh: line=line.rstrip() if not line.startswith('From '):continue w=line.split()原创 2016-04-25 21:27:09 · 2104 阅读 · 0 评论 -
Python for Everybody-Using Python to Access Web DatExtracting Data With Regular Expressions
coursera 公开课 python 使用Python访问网络数据 Python for Everybody-Using Python to Access Web DatExtracting Data With Regular Expressions原创 2016-04-18 14:36:39 · 1403 阅读 · 0 评论 -
Coursera Chaptereight:Lists Assignment 8.5
8.5 Open the file mbox-short.txt and read it line by line. When you find a line that starts with 'From ' like the following line:From stephen.marquard@uct.ac.za Sat Jan 5 09:14:16 2008You wi原创 2016-04-18 14:40:32 · 6043 阅读 · 0 评论 -
Coursera Chaptereight:Lists Assignment 8.4
8.4 Open the file romeo.txt and read it line by line. For each line, split the line into a list of words using thesplit() method. The program should build a list of words. For each word on each li原创 2016-04-18 14:42:50 · 1606 阅读 · 0 评论 -
python Django 同步mysql数据库
python Django 同步mysql数据库时未生成 models.py中的表python manage.py syncdb 注意:Django 1.7.1及以上的版本需要用以下命令python manage.py makemigrationspython manage.py migrate原创 2016-04-19 22:06:13 · 807 阅读 · 0 评论 -
Using Database with Python -Basic Structured Query Language-Email Database Demo
import sqlite3conn = sqlite3.connect('emaildb.sqlite')cur = conn.cursor()cur.execute('''DROP TABLE IF EXISTS Counts''')cur.execute('''CREATE TABLE Counts (org TEXT, count INTEG原创 2016-04-24 20:00:42 · 352 阅读 · 0 评论