码迷,mamicode.com
首页 >  
搜索关键字:python long string    ( 244880个结果)
Euler_problem_18 for python
如下所示 给出2个解法 def euler_problem_18_1():     """     this problem spend my half-day but noting to finished ,so bad     """     rows = '''     3     7 4     2 4 6     100 5 9 3     '''     ...
分类:编程语言   时间:2014-06-07 01:28:18    阅读次数:261
projecteuler---->problem=4----Largest palindrome product
title: Largest palindrome product Problem 4 A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 99. Find the l...
分类:其他好文   时间:2014-06-07 01:24:27    阅读次数:398
python 装饰器与AOP
无高见 1.缓存 from functools import wraps lineseq = '==' * 20 def memo( func ): cache = {} @wraps( func ) def wrapper( *args ): result = cache.get( args ) if resul...
分类:编程语言   时间:2014-06-05 11:07:06    阅读次数:324
python中多线程调度机制以及GIL
总结下python中线程调度机制. 对于线程调度机制而言,同操作系统的进程调度一样,最关键是要解决两个问题: 1.在何时选择挂起当前线程,并选择处于等待的先一个线程呢? 2.在众多等待的线程中,选择哪一个作为激活线程呢? 在python多线程机制中,这个两个问题是有两个层次解决的。 如,进程间的切换,当发生了时钟中断,操作系统响应时钟中断,并在这个时候开始进程的调...
分类:编程语言   时间:2014-06-05 10:07:35    阅读次数:314
Android 读取网络数据
通过HttpResponse  实现 首先在AndroidManifest中配置允许网络访问     然后实现代码    示例代码如下   String url = "http://www.baidu.com"; HttpGet request = new HttpGet(url);                 try {                      Ht...
分类:移动开发   时间:2014-06-05 08:30:08    阅读次数:226
ThreadPool原理分析
看下ThreadPoolImpl的构造函数: /** * This constructor is used to create an unbounded threadpool */ public ThreadPoolImpl(ThreadGroup tg, String threadpoolName) { inactivityTimeout = ORB...
分类:其他好文   时间:2014-06-05 07:41:45    阅读次数:386
StringBuffer与StringBuilder的区别
二者区别,简而言之,在于StringBuffer内部实现了线程同步,而StringBuilder没有。 二者均继承自AbstractStringBuilder。 JDK源码中可以看得更清楚些。 ============================= 从源码中可以看出,子类AbstractStringBuilder已经实现了所有的操作,String...
分类:其他好文   时间:2014-06-05 06:47:58    阅读次数:220
Python打包成exe
有个好网站http://www.lfd.uci.edu/~gohlke/pythonlibs/ , 这个网站可以下载许多非官方的python库的安装包。 1.首先去这个网站下载cx_freeze安装包后安装。 2.在C:\PythonXX\Scripts\ 下可以看到cxfreeze-quickstart.bat, XX为版本号 3.运行cxfreeze-quickstart.bat...
分类:编程语言   时间:2014-06-05 06:24:55    阅读次数:350
用Python socket实现一个简单的http服务器(post 与get 的区别)
预备知识: 关于http协议的基础请参考这里。 关于socket基础函数请参考这里。 关于python网络编程基础请参考这里。 废话不多说,前面实现过使用linux c 或者python 充当客户端来获取http 响应,也利用muduo库实现过一个简易http服务器,现在来实现一个python版的简易http服务器,代码改编自http://www.cnblogs.com/v...
分类:编程语言   时间:2014-06-05 04:17:57    阅读次数:463
Python:file/file-like对象方法详解【单个文件读写】
IO中读写文件操作方法(file-like对象)汇总!----The_Third_Wave的学习笔记!...
分类:编程语言   时间:2014-06-05 01:05:48    阅读次数:612
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!