上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 27 下一页
摘要: 你要是看Python的源码或者相关框架的源码,总是在 __init__.py 或者是源文件的开头看到一个 __all__ 变量的定义,今天就说说它的作用. 问题出处 Can someone explain all in python? 问题 我越来越多的使用Python了,经常看到 __all__  阅读全文
posted @ 2017-08-28 17:51 睡着的糖葫芦 阅读(271) 评论(0) 推荐(0) 编辑
摘要: python作为一种脚本语言,我们用python写的各个module都可以包含以上那么一个累死c中的main函数,只不过python中的这种__main__与c中有一些区别,主要体现在: 1、当单独执行该module时,比如单独执行以上hello.py: python hello.py,则输出 可以 阅读全文
posted @ 2017-08-27 15:51 睡着的糖葫芦 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 打印结果: 2193174953824 2193174953824 2193174953824 旺财 旺财 旺财 2193174953824 2193174953824 2193174953824 旺财 最后附上图便于理解 __new__方法的含义 旺财 最后附上图便于理解 __new__方法的含义 阅读全文
posted @ 2017-08-27 12:32 睡着的糖葫芦 阅读(2439) 评论(0) 推荐(0) 编辑
摘要: 打印结果: a1 a1 a1 a2 a2 a2 a3 a3 a3 3 3 3 hello world hello world hello world 阅读全文
posted @ 2017-08-27 10:56 睡着的糖葫芦 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 记录代码片段 阅读全文
posted @ 2017-08-24 09:59 睡着的糖葫芦 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 通过源码编译安装php环境,按照phalcon官方文档安装扩展,会遇到php-config is not installed的坑。 尝试通过下列命令可以解决: 阅读全文
posted @ 2017-07-13 18:31 睡着的糖葫芦 阅读(2993) 评论(0) 推荐(0) 编辑
摘要: scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 ... [[user@]ho 阅读全文
posted @ 2017-07-11 14:36 睡着的糖葫芦 阅读(262) 评论(0) 推荐(0) 编辑
摘要: 范例一:将整个 /etc 目录下的文件全部打包成为 /tmp/etc.tar[root@linux ~]# tar -cvf /tmp/etc.tar /etc <==仅打包,不压缩![root@linux ~]# tar -zcvf /tmp/etc.tar.gz /etc <==打包后,以 gz 阅读全文
posted @ 2017-07-11 14:34 睡着的糖葫芦 阅读(1590) 评论(0) 推荐(0) 编辑
摘要: 最近开始测试部署ELK, 在部署logstash的时候出现一个故障: logstash在第一次安装完成以后启动正常, 但是之后启动时间越来越长, 5分钟以上甚至10多分钟。以至于怀疑程序错误, 在重装以软件和系统以后问题还是没有解决。 搜索到github上的一个issue, 解释如下: 系统的“熵” 阅读全文
posted @ 2017-06-30 17:12 睡着的糖葫芦 阅读(2535) 评论(0) 推荐(0) 编辑
摘要: #!/bin/sh#获得私有ipip=`ifconfig eth0 | grep 'inet' | awk '{print $2}'` ip1='x.x.x.x' if [ "$ip" == "$ip1" ]; then dir='/home/wwwroot/default/guoyi/Pay/' else dir='/home/web/guoyi/Pay/' fi php ${dir}'i... 阅读全文
posted @ 2017-06-28 19:16 睡着的糖葫芦 阅读(149) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 27 下一页