Python列表函数和方法python列表中主要有以下函数:cmp(list1,list2)比较两个列表的元素len(list)列表元素的个数max(list)返回列表元素的最大值min(list)返回列表元素的最小值list(seq)将元组转换成列表---------------------------------我是华丽的分割线--------------------..
分类:
编程语言 时间:
2014-08-14 21:01:49
阅读次数:
200
1.系统必须安装MySQL-python软件,否则python没有连接的模块(在Linux系统)yuminstallMySQL-python2.安装mysql数据库yuminstallmysql-servermysql[root@AY140528120357495c4bZ~]#/etc/init.d/mysqldrestartStoppingmysqld:[OK]Startingmysqld:[OK][root@AY140528120357495c4bZ~]..
分类:
数据库 时间:
2014-08-14 21:00:50
阅读次数:
264
相信各位对堡垒机(跳板机)不陌生,为了保证服务器安全,前面加个堡垒机,所有ssh连接都通过堡垒机来完成,堡垒机也需要有身份认证,授权,访问控制,审计等功能,笔者用Python基本实现了上述功能。架构:后端主要技术是LDAP,配置了LDAP集中认证服务器,所有服务器的认证都是由l..
分类:
编程语言 时间:
2014-08-14 20:56:10
阅读次数:
328
因为有 “用户上传脚本,动态运行”的需求,所以要动态地import用户上传的模块
所以写了个函数动态地import
# -*- coding: utf-8 -*-
import os
import sys
import os.path
import Queue
import commands
def test(rootDir):
#判断传入的路径下是否有“__ini...
分类:
编程语言 时间:
2014-08-14 20:52:29
阅读次数:
259
在python的main函数中的变量默认为全局变量,而其他的def函数中的变量则默认为局部变量。
当然,局部变量会优先于全局变量,在执行formal_print(t_global)语句时便可看出。
测试代码如下:...
分类:
编程语言 时间:
2014-08-14 20:52:19
阅读次数:
201
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path....
分类:
其他好文 时间:
2014-08-14 20:50:59
阅读次数:
192
Given a collection of integers that might contain duplicates, S, return all possible subsets....
分类:
其他好文 时间:
2014-08-14 20:42:59
阅读次数:
196
Given an array of strings, return all groups of strings that are anagrams....
分类:
其他好文 时间:
2014-08-14 20:39:29
阅读次数:
219
关于EF中ApplyCurrentValues和ApplyOriginalValues区别:两者都是编辑数据时使用。// // 摘要: // 将 System.Data.Objects.ObjectStateEntry 的 System.Data.Objects.ObjectStateEntry.C...
分类:
移动开发 时间:
2014-08-14 20:27:59
阅读次数:
178
Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.For example, If n = 4 and k = 2, a solution is:[ [2,4], [3,.....
分类:
其他好文 时间:
2014-08-14 20:26:49
阅读次数:
202