Python
lby978232
这个作者很懒,什么都没留下…
展开
-
如何高效利用GitHub
正是 Github,让社会化编程成为现实。本文尝试谈谈 GitHub 的文化、技巧与影响。Q1:GitHub 是什么Q2:GitHub 风格Q3: 在 GitHub,如何跟牛人学习Q4: 享受纯粹的写作与演讲Q5: 代码帮你找工作Q6: GitHub 还在影响一些什么Q7: 除了 GitHub,还可以选择什么? Q1:GitHub 是什么 A1:一家公司转载 2013-06-15 21:23:59 · 631 阅读 · 0 评论 -
mac 安装django
mac 安装django#tar xzvf Django-1.x.y.tar.gz #cd Django-1.x.y #sudo python setup.py install##django-admin.py startproject mysite#cd mysite#python manage.py runserver原创 2015-02-25 14:49:56 · 682 阅读 · 0 评论 -
Postman 、Newman运行自动API测试
安装Install newmansudo apt-get install npmnpm install -g newman Install node with version > 4.0wget -qO- https://deb.nodesource.com/setup_4.x | sudo bash -sudo apt-get install nodejs运行PostmanPostman原创 2016-08-26 16:22:42 · 647 阅读 · 0 评论 -
Python “SyntaxError: Non-ASCII character '\xe2' in file”
code#!/usr/bin/python# -*- coding: utf-8 -*-CARD_TOTAL_NUM = 54BOTTOM_NUM = 3colors = ("♤", "♥", "♣", "♢")for col in colors: print colErrorGiven encoding at first or second line of the file Pyth原创 2016-09-06 21:15:20 · 2226 阅读 · 0 评论 -
Using example among PyObject_CallObject, PyObject_Call, PyObject_CallFunction
Using example among PyObject_CallObject, PyObject_Call, PyObject_CallFunction原创 2016-10-09 18:00:11 · 6082 阅读 · 0 评论 -
Lighttpd load REST,Websocket
Background系统: 服务器(Lighttpd + Django + rest_framework + corsheaders + REST(应用名字) + Websocket )+ Linux 嵌入式文件系统原创 2016-10-10 14:25:27 · 1275 阅读 · 0 评论 -
Cannot fetch index base URL https://pypi.python.org/simple/
http://www.knowsky.com/886127.html转载 2016-10-10 20:49:30 · 9103 阅读 · 1 评论 -
python decorator实例
1. 两特性 1.1. 在函数调用的前后打印出日志 1.2、decorator支持 @log && @log('execute')原创 2016-11-12 15:06:19 · 206 阅读 · 0 评论 -
curl GET/PUT examples
curl example在shell中发通curl的请求,然后再libcurl中完成这些请求。原创 2016-11-02 19:05:40 · 891 阅读 · 0 评论 -
stop subthread example with Event
BackgroundPython threading模块不同于其他语言之处在于它没有提供线程的终止方法,通过Python threading.Thread()启动的线程彼此是独立的,启动了线程B,B是独立运行的线程。若想终止线程的同时强力终止线程B,更为妥当的方式是通过Event机制, 线程中的资源(打开的文件、数据传输等)可正确的释放。code#-*-coding:utf-8-*-import原创 2016-06-06 16:17:41 · 391 阅读 · 0 评论 -
binary_search() in python
def binary_search(list, val): low, high = 0, len(list) -1 while low <= high: mid = (low + high)//2 if list[mid] > val: high = mid -1; elif list[mid] < val:原创 2016-06-27 09:50:19 · 694 阅读 · 0 评论 -
设计模式
http://blog.csdn.net/uestcyao/article/details/7924865 设计模式:使得人们可以更加简单和方便地去复用成功的软件设计和体系结构,从而能够帮助设计者更快更好地完成系统设计。模式是一条由三部分组成的规则:它表示了一个特定环境、一个问题和一个解决方案之间的关系。每一个模式描述了一个在我们周围不断重复发生的问题,以及该问题的解决方案转载 2015-03-05 14:03:04 · 441 阅读 · 0 评论 -
for
__author__ = 'gate_007'#encoding:utf-8def test1(): for i in xrange(0,5): for j in xrange(0,5): print i, " ", j print print "test1 done "def test2(): for原创 2016-01-02 11:28:51 · 396 阅读 · 0 评论 -
isLeapYear
__author__ = 'gate_007'#encoding:utf-8import timedef isLeapYear(): print "time.localtime() : %s" % time.localtime() year = time.localtime()[0] print '%d' %year if( year %原创 2016-01-02 12:05:05 · 2853 阅读 · 0 评论 -
scienceComputer
__author__ = 'gate_007'#encoding:utf-8import timeimport mathdef scienceComputer(): data1 = 12*34 + 78 -132/6 data2 = (12*34 + 78 -132)/6 data3 = (86/40)**5 print '%d' %data原创 2016-01-03 19:21:52 · 236 阅读 · 0 评论 -
isPrime
__author__ = 'gate_007'#encoding:utf-8# import mathfrom math import sqrtNUM = 50ret = []def isPrime(): for i in range(2, NUM): PRIME = True for j in range(2, int(sqrt(i)原创 2016-01-03 20:11:20 · 1350 阅读 · 0 评论 -
爬虫开始例子
#-- coding:utf -8--#——-PYTHON 获取网页内容————-#import sys, urlliburl = “https://www.zhihu.com/question/20899988” #网页地址wp = urllib.urlopen(url) #打开连接content = wp.read() #获取页面内容fp = open(“E:\python.txt”,”w”)原创 2016-01-21 18:53:01 · 695 阅读 · 0 评论 -
python server and client
python server and clientOverview:They server is run by python3, while client is python2.7.Server:“`pythonWritten by Beckl-- coding:utf-8 --from socket import *ServerUrl = “:9867”def run(): global I原创 2016-05-31 21:33:16 · 548 阅读 · 0 评论 -
Queue.queue 退出与阻塞
Queue 默认的也是阻塞方式读取数据,设置属性,改变成非阻塞方式。或者用 Queue.get_nowait()或 Queue.pet_nowait() 代替。原创 2016-06-03 09:50:22 · 7095 阅读 · 0 评论 -
tkinter 自动刷新高度可控的内容
tkinter 自动刷新高度可控的内容原创 2016-12-04 10:40:36 · 2795 阅读 · 0 评论