上一页 1 ··· 32 33 34 35 36 37 38 39 40 ··· 66 下一页

2015年12月1日

yum 安装软件时报Public key for * is not installed

摘要: 这个是由于没有导入rpm签名信息引起的解决方案:rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release 阅读全文

posted @ 2015-12-01 12:39 蒋乐兴的技术随笔 阅读(463) 评论(0) 推荐(0)

2015年11月20日

MySQLdb-python的安装

摘要: 第一步下载: 第一步:进入https://github.com/farcepest/MySQLdb1/ 第二步:解压 Shell>unzip/root/MySQLdb1-MySQLdb-1.3.zip Shell>cd/root/MySQLdb1-MySQLdb-1.3第三步:安装相... 阅读全文

posted @ 2015-11-20 16:50 蒋乐兴的技术随笔 阅读(327) 评论(0) 推荐(0)

2015年11月13日

python---__getattr__\__setattr_重载'.'操作

摘要: #!coding:utf-8class Person(object): def __init__(self,id): #定义一个名为ID的属性 self.ID=id def __getattr__(self,attr): #__getattr__... 阅读全文

posted @ 2015-11-13 09:18 蒋乐兴的技术随笔 阅读(395) 评论(0) 推荐(0)

2015年11月12日

python----iter\next

摘要: 1、说明:__getitem__\setitem可以迭代,它已经不被推荐了;建议使用__iter__\next。2、python会先去检查__iter__\next然后再去检查__getitem__\__setitem__,也就是说__iter__优先。例子:#!coding:utf-8#!pyth... 阅读全文

posted @ 2015-11-12 19:22 蒋乐兴的技术随笔 阅读(465) 评论(0) 推荐(0)

python--getitme\setitem 支持索引与分片

摘要: 1、想要自己定义的python对象支持索引与分片操作就要重载__getitem__\__setitem__这两个方法。2、__getitme__(self,index) 这里的index参数可能类型有两种int,slice。当它是int类型时对应索引操作,当它是slice时对应分片操作。3、__s... 阅读全文

posted @ 2015-11-12 18:24 蒋乐兴的技术随笔 阅读(398) 评论(0) 推荐(0)

2015年11月10日

linux----ln

摘要: 1、格式 ln source_file_path target_file_path2、执行ln 命令的用户要对source_file_path有写权限,才可以创建软连接。3、souce_file这个文件对ln的执行者要是可达的,也就是说ln的执行者要对source_file的上层目录有x权限。例子:... 阅读全文

posted @ 2015-11-10 17:52 蒋乐兴的技术随笔 阅读(7297) 评论(0) 推荐(0)

linux----suid\sgid

摘要: 1、suid和sgid 都是针对二进制程序来说了,bash脚本不在它的作用范围。2、如果一个二进制文件设置有suid,那么在userA用户执行它时,会以文件所属用户的身份来执行。sgid同理;3、suid的优先级别比sgid的要大,也就是说如果同时设置了这两个话,和只设置suid一样;4、一般说来一... 阅读全文

posted @ 2015-11-10 17:26 蒋乐兴的技术随笔 阅读(334) 评论(0) 推荐(0)

2015年11月9日

python生成随机密码

摘要: import randomstrings=list('qwertyuiopasdfghjklzxcvbnm1234567890QWERTYUIOPASDFGHJKLZXCVBNM')random.shuffle(strings)#改变strings内容元素的排列次序print ''.join(ran... 阅读全文

posted @ 2015-11-09 18:23 蒋乐兴的技术随笔 阅读(251) 评论(0) 推荐(0)

python计算md5值

摘要: from hashlib import md5m = md5('123456')print m.hexdigest() 阅读全文

posted @ 2015-11-09 18:20 蒋乐兴的技术随笔 阅读(174) 评论(0) 推荐(0)

2015年11月5日

python---连接MySQL第五页

摘要: Connector/Python Connection ArgumentsA connection with the MySQL server can be established using either the mysql.connector.connect() function or the ... 阅读全文

posted @ 2015-11-05 12:58 蒋乐兴的技术随笔 阅读(836) 评论(0) 推荐(0)

上一页 1 ··· 32 33 34 35 36 37 38 39 40 ··· 66 下一页

导航