安迪_963

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
上一页 1 ··· 8 9 10 11 12 13 14 下一页

2016年4月17日

摘要: 3.4 Getting Information About Databases and Tables 获取数据库和表格的信息 如果你忘记了数据库或者表格的名字怎么办?或者给定的表格的结构怎么办?(例如你知道都有哪些列,叫什么名字吗) mysql 有几种方法能解决这个问题 从前文你已经知道,可以通过S 阅读全文
posted @ 2016-04-17 06:57 Andy_963 阅读(563) 评论(0) 推荐(0) 编辑

2016年4月12日

摘要: 3.3.4 Retrieving Information from a Table Select 命令从表格中取回信息 3.3.4.1 Selecting All Data 查找所有资料: 3.3.4.2 Selecting Particular Rows 选择指定的行 从前面的情况可以看到,检索整 阅读全文
posted @ 2016-04-12 09:28 Andy_963 阅读(235) 评论(0) 推荐(0) 编辑

2016年4月11日

摘要: 以下内容是根据官方文档翻译的,执行截图是博主自己实测结果。 3.1 Connecting to and Disconnecting from the Server 连接,断开数据库 要连接到mysql 服务器,你需要用户名,user;密码,password 如果你在别的电脑上远程登陆,那么你还需要主 阅读全文
posted @ 2016-04-11 15:30 Andy_963 阅读(410) 评论(0) 推荐(0) 编辑

2016年4月4日

摘要: def fun(arg,args=1,*arg,**keywords): python 一共有这四类参数,第一类最常见,不用多说,第二类,关键字参数,python能通过关键字找到参数,python函数的这种特性使得函数参数更加灵活,不一定要按顺序来传,第三类:一个星号是将非关键字参数收集起来,以tu 阅读全文
posted @ 2016-04-04 21:01 Andy_963 阅读(839) 评论(0) 推荐(0) 编辑

2016年4月3日

摘要: #!usr/bin/env python 2 #coding: utf-8 3 #Author: Andy 4 5 import threading 6 import time 7 8 def producer(): 9 print('等人来买包子。。。') 10 event.wait() 11 e 阅读全文
posted @ 2016-04-03 17:42 Andy_963 阅读(372) 评论(0) 推荐(0) 编辑

2016年4月1日

摘要: 1 from wsgiref.simple_server import make_server 2 3 def RunServer(environ, start_response): 4 start_response('200 ok',[('Content-Type','text/html')]) 阅读全文
posted @ 2016-04-01 21:12 Andy_963 阅读(15034) 评论(0) 推荐(0) 编辑

2016年3月29日

摘要: python 字典的copy()方法表面看就是深copy啊,明显独立 1 d = {'a':1, 'b':2} 2 c = d.copy() 3 print('d=%s c=%s' % (d, c)) 结果: d={'a': 1, 'b': 2} c={'a': 1, 'b': 2} 修改d,看看c 阅读全文
posted @ 2016-03-29 13:01 Andy_963 阅读(2217) 评论(0) 推荐(0) 编辑

2016年3月27日

摘要: 1 def outer(fun): # f 为用out装饰的函数 2 def inner(): 3 print('装饰器!') 4 fun() 5 print('test') 6 return inner 7 8 @outer 9 def fun1(): 10 print('fun1') 11 12 阅读全文
posted @ 2016-03-27 13:26 Andy_963 阅读(255) 评论(0) 推荐(0) 编辑

2016年3月26日

摘要: 在运行一个小脚本时,脚本从一文本文件读取数据,事实上这个文件只有一行'count:2',并取到这个2,将其转成数字。但运行,总是报错。 代码如下: 1 with open('count.txt', 'r') as file: 2 if not file.readline(): 3 pass 4 el 阅读全文
posted @ 2016-03-26 13:35 Andy_963 阅读(10940) 评论(0) 推荐(0) 编辑

摘要: pickle 有dump ,dumps ,load,loads等方法。区别在于dumps不会写入到文件。 1 import pickle 2 3 string = ['a', 2341, 'adsf'] 4 5 p_str= pickle.dumps(string) 6 print(p_str) 7 阅读全文
posted @ 2016-03-26 10:10 Andy_963 阅读(296) 评论(0) 推荐(0) 编辑

上一页 1 ··· 8 9 10 11 12 13 14 下一页