• MIT人工智能实验室
  • 大数据分析平台
  • 游戏开发《骑马与砍杀》
  • 量化金融分析
  • python爬虫
  • python django web框架
MIT人工智能实验室 大数据分析平台 游戏开发《骑马与砍杀》 量化金融分析 python爬虫 python django web框架
  • python序列操作

    auto 2019-07-13 11:39:20 python

    1926°

    20

    我们主要讨论的是列表和元组2种序列。(1)索引0指向第一个字符,-1指向最后一个字符。例子:months=['J
  • 趣味谈python变量问题

    auto 2019-07-13 11:39:20 python

    1868°

    20

    大家好,今天我和各位交流一下Python的变量问题,我们先来看这些例子, 例子: >>> a=12 >>> b=13 >>> c=a >>> d=b >>> id(a) 10413196 >>> id(b) 10413184 >>> id(c) 10413196 >>> id(d) 10413184 >>>1:
  • cobbler MOD_PYTHON E

    auto 2019-07-13 11:39:20 python

    1981°

    20

    今天在做cobbler的时候所有都做好了,但就是访问不了,报下边这样一个错误: MOD_PYTHONERRORProcessId:370Interpreter:'12
  • Python数组的遍历

    auto 2019-07-13 11:39:20 python

    2018°

    20

    Python的数组是一个好东西啊, 在Python中,我们习惯这样遍历: for item in sequence: process(item) 这样遍历取不到item的序号i,所有就有了下面的遍历方法: for index in range(len(sequence)):     process(sequence[index]) 其实,如果你
  • python的reduce函数

    auto 2019-07-13 11:39:20 python

    2075°

    20

    reduce()函数也是Python内置的一个高阶函数。reduce()函数接收的参数和 map()类似,一个函数 f,一个list,但行为和 map()不同,reduce()传入的函数 f 必须接收两个参数,reduce()对list的每个元素反复调用函数f,并返回最终结果值。例如,编写一个f函数,接收x和y,返回x和y的和:deff(x,y):
  • python的常用模块

    auto 2019-07-13 11:39:20 python

    1873°

    20

    os模块这个模块包含普遍的操作系统功能os.name:获取当前系统平台,Windows下返回'nt',Linux下返回'posix'。os.linesep:获取当前平台使用的行终止符。Windows下返回'/r/n',Linux使用'/n'。os.getcwd(): 获取当前工作目录,即当前python脚本工作的目录路径。os.listdir(path):返回指定目录下的所有文件和目录名。os.r
  • Python_基础_01

    auto 2019-07-13 11:39:20 python

    2021°

    20

    Python特点:字节码,动态语义定义编码:只要符合coding[:=]\s*([-\w.]+)即可。如 #coding= utf-8# -*- coding: utf-8 -*-"双引号内写脚本文档"#这里以后都是单行注释"""这里是多行注释"""pyc字节码文件,和java类似id()sys.getrefcount() 引用默认就有3反斜杠换行p
  • python 遍历目录

    auto 2019-07-13 11:39:20 python

    1749°

    20

    python使用os模块判断文件基础知识#导入os模块 import os #判断路径是否存在(True, False) os.path.exists('/tmp/test') #判断目标是否是文件(True, False) os.path.isfile('/tmp/test/file1') #创建目录(可以递归创建) os.makedirs('d:/assist/set')遍历目录取出其中文件的
  • python使用数据库

    auto 2019-07-13 11:39:20 python

    1692°

    20

    使用python-DB-API,只需要搞清楚Connection、Cursor对象,打开后一定得关闭。Cursor对象执行insert、update、delete,结果由rowcount返回影响的行数,拿到执行结果。Cursor对象执行select,通过featchall()拿到list的结果集,每个元素都是一个tuple,对应一行记录SQL带有参数,需要把参数按照位置传递给execute()方法
  • python中的注释

    auto 2019-07-13 11:39:20 python

    1856°

    20

    一、单行注释 单行注释以#开头,例如: print 6 #输出6二、多行注释 (Python的注释只有针对于单行的注释(用#),这是一种变通的方法) 多行注释用三引号'''将注释括起来,例如:'''多行注释多行注释'''三、
  • python 代码统计文件的行数

    auto 2019-07-13 11:39:20 python

    1971°

    20

    #!/usr/bin/python#encofing:utf8# 统计文件的行数import sysdef lineCount(fd): n = 0 for i in fd: n +
  • python list 循环中remov

    auto 2019-07-13 11:39:20 python

    2030°

    20

    >>> a = [0,1,2,3,0,0,3] >>> for item in a : print item a.remove(item) print a 输出: 0 [1, 2, 3, 0, 0, 3] 2 [1, 3, 0,
  • Python with a modula

    auto 2019-07-13 11:39:20 python

    2128°

    20

    Python with a modular IDE (Vim)http://blog.sontek.net/2008/05/11/python-with-a-modular-ide-vim/ http://blog.sontek.net/2008/05/11/python-with-a-modular-ide-vim/python vim 设置
  • python的os遍历

    auto 2019-07-13 11:39:20 python

    1784°

    20

    使用python遍历目录用到方法一:os.path.walk(top, func, arg)模块方法,该方法需要输入3个参数:top为起始路径,func为回调函数(可以对遍历出的目录文件做处理),arg为回调函数func的参数。见下例子:#!/usr/bin/envpython importos importtime #定义一个回调函数,实现找出路
  • Python支持tab键补全

    auto 2019-07-13 11:37:12 python

    1628°

    20

    Python支持tab键补全
  • python命令行参数

    auto 2019-07-13 11:37:12 python

    1828°

    20

    python 命令行参数 if __name__ == '__main__': if len(sys.argv)<3: print "usage :",sys.argv[0],'random_id_num pre_of_id' &
  • 安装MySQL-python报错

    auto 2019-07-13 11:37:12 python

    1702°

    20

    _mysql.c: 在函数‘DL_EXPORT’中: _mysql.c:3058: 错误:expected declaration specifiers before ‘init_mysql’ _mysql.c:3166: 错误:expected ‘{’ at end of input err
  • 关于python中的IO流

    auto 2019-07-13 11:37:12 python

    1295°

    20

    python IO流
  • python logging 模块

    auto 2019-07-13 11:37:12 python

    1765°

    20

    python logging模块 importsysimportlogging#首先获得一个类logger=logging.getLogger('example')#example为名字logger.setLeve
  • yaml和python关系实例

    auto 2019-07-13 11:37:12 python

    2148°

    20

    一、yaml和python的关系实例: 1、 yaml格式文件:base: - name: wang - age: 33 - site: - web1: http:/www/baidu.com - web2: http://www.163.com2、python解析脚本:#!/u