文章分类 -  Python Base

python db
摘要:http://www.cnblogs.com/fnng/p/3565912.html 阅读全文

posted @ 2014-11-27 12:49 ukouryou 阅读(88) 评论(0) 推荐(0)

Python resource
摘要:https://docs.python.org/3/tutorial/index.htmlhttps://docs.python.org/3/library/index.html#https://docs.python.org/3/reference/index.htmlhttp://blog.cs... 阅读全文

posted @ 2014-10-24 18:09 ukouryou 阅读(315) 评论(0) 推荐(0)

Python3 tutorial day5
摘要:Standard LibraryOSimport osos.getcwd()os.chdir("/home/andy")os.system("mkdir today")>>> import shutil>>> dir(shutil)['Error', 'ExecError', 'ReadError'... 阅读全文

posted @ 2014-10-24 18:07 ukouryou 阅读(127) 评论(0) 推荐(0)

Python3 tutorial day4 part 2
摘要:Classes__author__ = 'andy'def scope_test(): def do_local(): spam = "local spam" def do_nonlocal(): nonlocal spam spam = "no... 阅读全文

posted @ 2014-10-23 17:30 ukouryou 阅读(120) 评论(0) 推荐(0)

Python3 tutorial day4
摘要:Errors and ExceptionsSyntax ErrorsExceptionsHandling Exceptionswhile True:... try:... x = int(input("Please enter a number: "))... ... 阅读全文

posted @ 2014-10-23 12:19 ukouryou 阅读(179) 评论(0) 推荐(0)

Python3 tutorial day3
摘要:ModulersA module is a file containing Python definitions and statements. The file name is the module name with the suffix.pyappended. Within a module,... 阅读全文

posted @ 2014-10-23 11:33 ukouryou 阅读(170) 评论(0) 推荐(0)

Python3 tutorial day2
摘要:listcount(item)返回item的出现次数insert(index,x)在位置index插入xappend(item)在尾部添加itema = [66.25, 333, 333, 1, 1234.5]>>> print(a.count(333), a.count(66.25), a.cou... 阅读全文

posted @ 2014-10-22 15:28 ukouryou 阅读(144) 评论(0) 推荐(0)

Python3 tutorial day1
摘要:An Informal Introduction to Python¶https://docs.python.org/3/tutorial/index.htmlNumbers>>> 17/35.666666666666667>>> 5 ** 225>>> 5**225>>> 17//35String... 阅读全文

posted @ 2014-10-21 12:03 ukouryou 阅读(183) 评论(0) 推荐(0)

python post json
摘要:__author__ = 'andy'#!/usr/bin/python3.2# -*- coding: utf-8 -*-from urllib.request import urlopenimport http.clientimport jsonimport osimport timebaseU... 阅读全文

posted @ 2014-06-24 12:03 ukouryou 阅读(1000) 评论(0) 推荐(1)

文件处理
摘要:open('filename')file('filename','mode')mode:a,w,r,a+,w+,r+methods:readline(),readlines()write('')seek(n)truncate(n) 阅读全文

posted @ 2013-09-07 18:00 ukouryou 阅读(77) 评论(0) 推荐(0)

Python 数据结构
摘要:split(),join()函数Listcount(''),index('')append(''),insert(index,item),extend('')remove(''),pop(index),pop()sort()if item in List: print itemtuplecount(''),index('')del tupleDictionaryPhone = {'alex':'135','ch':'136 阅读全文

posted @ 2013-09-07 17:19 ukouryou 阅读(153) 评论(0) 推荐(0)

python 控制语句
摘要:1 for i in range(1,10,2): 2 print 'my number is ', i 3 if i == 5: 4 print 'got it!' 5 break 6 else: 7 print 'class is dismiss' 8 9 10 while True:11 input = int(raw_input('input code:'))12 if input == 5:13 print 'success'14 elif input == 0:15 ... 阅读全文

posted @ 2013-09-07 10:18 ukouryou 阅读(122) 评论(0) 推荐(0)

导航