上一页 1 2 3 4 5 6 7 8 ··· 16 下一页
摘要: Sockesever模块 阅读全文
posted @ 2016-03-17 10:57 gopher-lin 阅读(136) 评论(0) 推荐(0) 编辑
摘要: # Written by Vamei # A messy HTTP server based on TCP socket import socket # Address HOST = '' PORT = 8080 text_content = ''' HTTP/1.x 200 OK Content-Type: text/html WOW Wow, Python Server F... 阅读全文
posted @ 2016-03-17 10:56 gopher-lin 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 我们写出一个HTTP服务器端: 如我们上面所看到的,服务器会根据request向客户传输的两条信息text_content和pic_content中的一条,作为response文本。整个response分为起始行(start line), 头信息(head)和主体(body)三部分。起始行就是第一行 阅读全文
posted @ 2016-03-17 10:50 gopher-lin 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 在Python中,我们使用标准库中的socket包来进行底层的socket编程。 Client Sever 阅读全文
posted @ 2016-03-17 10:46 gopher-lin 阅读(132) 评论(0) 推荐(0) 编辑
摘要: http://www.cnblogs.com/coser/archive/2011/12/17/2291160.html 阅读全文
posted @ 2016-03-17 10:26 gopher-lin 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 在 java web 领域,支持 servlet API 的 java application 都可运行在支持 servlet API 的 web server (http server) 上。随着 web 不断发展,python application/framework 也如雨后春笋般涌出,如: 阅读全文
posted @ 2016-03-17 10:14 gopher-lin 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 并发 当有多个线程在操作时,如果系统只有一个CPU,则它根本不可能真正同时进行一个以上的线程,它只能把CPU运行时间划分成若干个时间段,再将时间 段分配给各个线程执行,在一个时间段的线程代码运行时,其它线程处于挂起状。.这种方式我们称之为并发(Concurrent)。 并行: 当系统有一个以上CPU 阅读全文
posted @ 2016-03-17 10:07 gopher-lin 阅读(197) 评论(0) 推荐(0) 编辑
摘要: def fab(n): if n==1: return 1 if n==0: return 0 else: result=int(fab(n-1))+int(fab(n-2)) return resul 阅读全文
posted @ 2016-03-17 09:54 gopher-lin 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 程序并不能单独运行,只有将程序装载到内存中,系统为它分配资源才能运行,而这种执行的程序就称之为进程。程序和进程的区别就在于:程序是指令的集合,它是进程运行的静态描述文本;进程是程序的一次执行活动,属于动态概念。 在多道编程中,我们允许多个程序同时加载到内存中,在操作系统的调度下,可以实现并发地执行。 阅读全文
posted @ 2016-03-16 18:04 gopher-lin 阅读(130) 评论(0) 推荐(0) 编辑
摘要: #coding:utf-8 def demo(data,temp): for i in range(len(data)-1): if data[i] == temp : print i break else: print u'没有满足条件的数字' if __name__ == "__... 阅读全文
posted @ 2016-03-16 17:11 gopher-lin 阅读(85) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 16 下一页