码迷,mamicode.com
首页 >  
搜索关键字:python objects all    ( 160304个结果)
Python中的判断、循环 if...else,while
if...else语句:a=3; b=3;if a == b :print(a,b)elif a = 0 and n = 12 and n = 0 and n = 12 and n <= 25): print("hhh")一个字符串也相当于是一个数组,通过for循环可以将每个字符输出for循环,相当...
分类:编程语言   时间:2014-07-03 07:01:19    阅读次数:186
python中json.dumps使用的坑以及字符编码
我们知道,python中的字符串分普通字符串和unicode字符串,一般从数据库中读取的字符串会自动被转换为unicode字符串下面回到重点,使用json.dumps时,一般的用法为:>>> obj={"name":"测试"}>>> json.dumps(obj)'{"name": "\\u6d4b...
分类:编程语言   时间:2014-07-03 06:51:34    阅读次数:544
python怎么处理html中的图片
在使用的是 Template(open(file)) 引入的 html, 在处理静态文件的时候,怎么处理图片?可以这样:def imgFile(environ, start_response): ext = environ['PATH_INFO'].split('.') for n in...
分类:编程语言   时间:2014-07-03 06:39:21    阅读次数:220
linux 下 /bin /sbin 的区别 -- (转)
/bin,/sbin,/usr/bin,/usr/sbin区别/ : this is root directory root 用户根目录/bin : commands in this dir are all system installed user commands 系统的一些指令/sbin: c...
分类:系统相关   时间:2014-07-03 06:29:10    阅读次数:223
python通信串口pyserial安装及常用语句
一、安装1.下载软件包pyserial-2.7.tar.gz 网址:https://pypi.python.org/pypi/pyserial2.8uftp上传至/usr/local/src/目录下3.cd/usr/local/src/4.解压tar -zxvf pyserial-2.7.tar.....
分类:编程语言   时间:2014-07-03 06:05:52    阅读次数:1432
python2.7 print函数
1、输出十六进制,十进制,八进制>>> hex = 0xff>>> print 'hex=%x,dec=%d,oct=%o' %(hex,hex,hex)hex=ff,dec=255,oct=3772、输出浮点数>>> import math>>> print '%f' %math.pi3.1415...
分类:编程语言   时间:2014-07-03 00:24:22    阅读次数:263
ASP.NET MVC与RAILS3的比较
进入后Web年代之后,MVC框架进入了快速演化的时代,Struts等垂垂老矣的老一代MVC框架因为开发效率低下而逐渐被抛弃,新一代的MVC则高举敏捷的大旗,逐渐占领市场,其中的代表有Rails (ruby), .NET MVC (.NET), Django (Python),Symfony (PHP...
分类:Web程序   时间:2014-07-02 23:42:40    阅读次数:282
python入门
现在开始学python。听过过python是一年前的事了。听说之后,安装好了,照着网上的例子写了几个函数,运行运行,看了看效果。对python一直念念不忘。之后的日子都没有往下继续学习,实在可惜。最近又忽然想该好好学这个了,反正闲着也是闲着。就开始吧。看到虫师的博客,然后就照着做了一遍,效果挺好,都...
分类:编程语言   时间:2014-07-02 23:14:02    阅读次数:220
Leetcode Path Sum
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo...
分类:其他好文   时间:2014-07-02 22:34:44    阅读次数:318
Leetcode Path Sum II
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree andsum =...
分类:其他好文   时间:2014-07-02 22:10:42    阅读次数:262
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!