- 博客(29)
- 资源 (3)
- 收藏
- 关注
转载 python字典和列表各种嵌套排序
转载自http://m.zgxue.com/167/1676555.html一: 字典排序解析: 使用sorted 方法, 排序后的结果为一个元组. 可以字符串排序(那数字肯定更没问题了!) 1: 按照键值(value)排序a = {'a': 'China', 'c': 'USA', 'b': 'Russia', 'd': 'Canada'
2015-09-21 10:20:15 3541
转载 docker删除None镜像
参考:百度知道(http://zhidao.baidu.com/link?url=javNZS-LbUTn4ba4zWuul2QvKLz9cm08hpYCmwCQZulGNXh51oGjOex5Y8dpdGGahbJbv0K6hRw_WTxPH1B5BT0NtSb61kiYt_8ozodzBEu)1、停止所有container: 2、删除所有container: 3、删除
2015-08-04 16:59:38 570
原创 Ubuntu下apt-get安装软件时缺少依赖包解决方法
如果是debian/ubuntu可以使用build-dep命令来自动安装依赖包。 sudo apt-get build-dep python-mysqldb
2015-06-18 10:37:57 20462 2
原创 Django-模型
django的models负责数据库层的交互。老方法: from django.shortcuts import render_to_response import MySQLdb def book_list(request): db=MySQLdb.connect(user=”me”,db=”mydb”,passwd=”secret”,host=”localhost”)
2015-04-14 15:00:16 525
转载 Django学习-template和view的交互
模板的使用: from django.conf import settings settings.configure() from django.template import Template, Contextt = Template(‘hello,{{name}}’) c = Context({‘name’:’San’})#里面是字典类型 t.render(c)p = {‘name’
2015-04-14 11:31:16 564
原创 salt的python接口调用
salt的python api:http://docs.saltstack.com/en/latest/ref/clients/ python脚本调用salt命令 脚本要在master机器上执行,执行用户需要是master用户 (1)获取master配置文件: salt.config.client_config(path, env_var=’SALT_CLIENT_CONFIG’, defa
2015-04-09 11:02:06 7982
转载 docker搭建私人仓库
docker pull samalba/docker-registry docker run -d -p 5000:5000 samalba/docker-registry
2015-03-25 16:53:25 707
转载 ubuntu使用python setup.py install出现No module named setuptools
缺少setuptools模块。 安装setuptools: wget “https://bitbucket.org/pypa/setuptools/get/default.tar.gz#egg=setuptools-dev” –no-check-certificate tar -xzvf default.tar.gz cd pypa-setuptools-955311ac301a //依据你
2015-03-24 15:51:42 3393
转载 ubuntu12.04和centos安装salt
【master和minion安装】 IP:172.16.154.237 刚开始安装时找不到salt-master包,原来是没有添加相应软件源。 apt-get install python-software-properties add-apt-repository ppa:saltstack/salt apt-get update apt-get install salt-maste
2015-03-21 16:07:08 844
转载 ubuntu下python升级
下载python2.7http://www.python.org/ftp/python/ ,选择需要的版本安装pyhon2.7下载好了以后,解压并安装 $ bzip2 -d Python-2.7.tar.bz2 (-d参数表示解压bzip2压缩包)$ tar -xvf Python-2.7.tar (参数x表示解压缩,v在压缩时显示文件,f使用档名作为解压文件夹名)$ cd
2015-03-20 10:22:17 570
转载 Ubuntu下安装pip,并安装docker第三方包
安装pip的方法: Install pip and virtualenv for Ubuntu 10.10 Maverick and newer $ sudo apt-get install python-pip python-dev build-essential sudopipinstall–upgradepip sudo pip install –upgrade pip sudo
2015-03-19 15:35:58 1659
原创 Docker安装学习
【docker安装】系统:ubuntu12.04 server amd64(1)首先更新内核到3.8.0-25sudo apt-get install linux-image-3.8.0-25-genericsudo apt-get install linux-headers-3.8.0-25-generic然后重启电脑,通过命令uname -r查看内核版本是否更新成功(2
2015-03-16 20:05:58 538
转载 python--socket中异常处理
try: sock.connect(('192.168.1.1', 1024))except: (ErrorType, ErrorValue, ErrorTB) = sys.exc_info() print "Connect server failed: ", ErrorValue**************************************
2015-02-10 14:04:57 1251
转载 get localtime by python
thanks for :http://www.cnblogs.com/wanpython/archive/2010/08/07/1794598.htmlimport timeprint time.time() #the result is : 1421977714.39print time.localtime(time.time()) #the result is
2015-01-23 09:51:39 510
原创 php学习记录
PHP中包含文件:include和require用法。include引用某个文件时,若无法找到该文件,则脚本会继续执行;require引用若无法找到文件,脚本不会继续执行。$ffile = fopen("mytxt.txt","r") or die("unable to open the file!");echo fread($ffile,filesize("mytxt.txt"));
2014-12-01 18:51:13 298
转载 通过获取系统进程快照获取进程pid以及杀进程(win下获取进程名和linux下获取进程路径)
主要使用CreateToolhelp32Snapshot获取
2014-11-25 09:27:53 819
原创 python 10-22遇到的问题
def test(): config = "appid=508627e4,server_url=dev.voicecloud.cn/index.htm, coding_libs=speex.dll, vad_enable=true" ret = class_msc.ISR.mspQISRInit(config) if ret!=0: print "m
2014-10-22 21:43:19 455
原创 python HTTPlib &&find,seek
import httplibconn = httplib.HTTPConnection('server_url','port',False,10)
2014-10-17 16:23:32 501
原创 python调用dll文件时传入参数是int*,返回值是char*,对传入的char*所指的内容的修改
首先若调用的dll中的函数的参数是int型的指针:在
2014-09-25 10:17:01 3758 1
boson netsim
2012-10-24
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人