一、python的环境设置1.输出path列表:pi@raspberrypi:~$ pythonPython 3.4.0 (default, Jul 1 2014, 09:37:01) [GCC 4.6.3] on linuxType "help", "copyright", "credits" ....
分类:
编程语言 时间:
2014-07-25 16:46:51
阅读次数:
618
1、__name__属性 一个模块被另一个程序第一次引入时,其主程序将运行。如果我们想在模块被引入时,模块中的某一程序块不执行,我们可以用__name__属性来使该程序块仅在该模块自身运行时执行。示例:#!/usr/bin/python# Filename: using_name.pyif __.....
分类:
编程语言 时间:
2014-07-25 16:46:21
阅读次数:
189
1.环境:windows72.版本:Python 2.7.8 Django 1.6.5 Apache 2.2 http://httpd.apache.org/(download-binaries-win32下) mod_wsgi.so http://www.lfd.uc...
分类:
其他好文 时间:
2014-07-25 16:34:51
阅读次数:
183
当我们须要调用系统的命令的时候,最先考虑的os模块。用os.system()和os.popen()来进行操作。可是这两个命令过于简单,不能完毕一些复杂的操作,如给执行的命令提供输入或者读取命令的输出,推断该命令的执行状态,管理多个命令的并行等等。这时subprocess中的Popen命令就能有效的完...
分类:
编程语言 时间:
2014-07-25 14:20:11
阅读次数:
270
转自网络的方法,经实践可行。 1、安装 Python 2.7 https://www.python.org/download/ 2、配置环境变量 Path :C:\Python27 3、检验python是否安装配置成功,打开cmd,输入python,如果出现以下界面,则说 明你的python安装成功...
分类:
其他好文 时间:
2014-07-25 14:15:01
阅读次数:
789
python的元组、列表、字典数据类型是很python(there python is aadjective)的数据结构。这些结构都是经过足够优化后的,所以如果使用好的话,在某些area会有很大的益处。元组 个人认为就像java的数组,python中的元组有以下特性:任意对象的有序集合,这条没啥说的...
分类:
编程语言 时间:
2014-07-25 14:01:01
阅读次数:
246
=================================================简单的实现IEnumerable接口------------------------------------Person.csusingSystem;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Threading.Tasks;
usingSystem.Collections;
na..
分类:
其他好文 时间:
2014-07-25 11:36:32
阅读次数:
200
通过一个例子来看-------------------------------------------------------Student.csusingSystem;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Threading.Tasks;
usingSystem.Collections;
namespaceConsoleApplication6
{
publiccla..
分类:
其他好文 时间:
2014-07-25 11:36:22
阅读次数:
214
windows下安装模块错误
1)Unable to find vcvarsall.bat :
打开“\Lib\distutils\msvc9compiler.py”
找到 toolskey = “VS%0.f0COMNTOOLS” % version,
直接修改为 toolskey = “VS100COMNTOOLS” (如果是vs2012或者vs2013则要从100改成120)
2...
分类:
编程语言 时间:
2014-07-25 11:17:01
阅读次数:
240
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
思路:笨办法是每个节点再开辟一个属性存放是否访问过,这样遍历一遍即可知道是否有环。但为了不增加额外的空间,可以设置两个指针,一个一次走一步,另一个一次走两步...
分类:
编程语言 时间:
2014-07-25 11:09:21
阅读次数:
206