上一页 1 ··· 4 5 6 7 8 9 10 下一页
摘要: Python中定义函数时,若想在函数内部对函数外的变量进行操作,就需要在函数内部声明其为global。 例子1x = 1 def func(): x = 2 func()print(x) 输出:1 此时没有使用global关键字,无法对全局变量num进行修改 在func函数中并未在x前面加globa 阅读全文
posted @ 2020-09-04 17:27 chengxuyonghu 阅读(1436) 评论(0) 推荐(0)
摘要: python 模块codecs python对多国语言的处理是支持的很好的,它可以处理现在任意编码的字符,这里深入的研究一下python对多种不同语言的处理。 有一点需要清楚的是,当python要做编码转换的时候,会借助于内部的编码,转换过程是这样的: 原有编码 -> 内部编码 -> 目的编码 py 阅读全文
posted @ 2020-09-04 15:59 chengxuyonghu 阅读(667) 评论(0) 推荐(0)
摘要: TCP在真正的读写操作之前,server与client之间必须建立一个连接, 当读写操作完成后,双方不再需要这个连接时它们可以释放这个连接, 连接的建立通过三次握手,释放则需要四次握手, 所以说每个连接的建立都是需要资源消耗和时间消耗的。 1. TCP短连接 模拟一种TCP短连接的情况: clien 阅读全文
posted @ 2020-09-03 13:47 chengxuyonghu 阅读(690) 评论(0) 推荐(0)
摘要: 1、 打开命令行窗口 #db2cmd 2、 打开控制中心 # db2cmd db2cc 3、 打开命令编辑器 db2cmd db2ce 操作数据库命令 4、 启动数据库实例 #db2start [5、 停止数据库实例 #db2stop 如果你不能停止数据库由于激活的连接,在运行db2stop前执行d 阅读全文
posted @ 2020-09-03 10:24 chengxuyonghu 阅读(645) 评论(0) 推荐(0)
摘要: os.system('cat /proc/cpuinfo') output = os.popen('cat /proc/cpuinfo') print output.read() 通过 os.popen() 返回的是 file read 的对象,对其进行读取 read() 的操作可以看到执行的输出。 阅读全文
posted @ 2020-09-02 15:24 chengxuyonghu 阅读(626) 评论(0) 推荐(0)
摘要: #####baidu ip #######220.181.38.148220.181.38.133192.168.1.10 #!/usr/bin/python # -*- coding:utf-8 -*-import osimport sys,reimport subprocess #定义正则,排除 阅读全文
posted @ 2020-09-02 11:30 chengxuyonghu 阅读(199) 评论(0) 推荐(0)
摘要: >>> import datetime >>> d1 = datetime.datetime(2005, 2, 16) >>> d2 = datetime.datetime(2004, 12, 31) >>> (d1 - d2).days 上例演示了计算两个日期相差天数的计算 import date 阅读全文
posted @ 2020-09-01 14:16 chengxuyonghu 阅读(1637) 评论(0) 推荐(0)
摘要: 方法1 #!/usr/bin/env bashdate1="$1"date2="$2" echo "date1: $date1"echo "date2: $date2" tempdate=`date -d "-0 day $date1" +%F` enddate=`date -d "-0 day $ 阅读全文
posted @ 2020-09-01 14:10 chengxuyonghu 阅读(478) 评论(0) 推荐(0)
摘要: IBM共享磁盘双机系统的启动 启动cluster 在主机上使用smit clstart 或者运行 # /usr/sbin/cluster/etc/rc.cluster -boot -N -i 命令启动cluster 先启动的节点将成为主节点,将自动获得浮动IP,监控程序等资源 在备机上使用smit 阅读全文
posted @ 2020-09-01 14:03 chengxuyonghu 阅读(1152) 评论(0) 推荐(0)
摘要: 主要查看硬件的永久性报错 #errpt -dH | pg 软件的永久性报错 #errpt -dS | pg 还有系统又没又报警灯(如果不正常,在后面的帖子将会细讲) 第三:机器的序列号:#uname -Mu 第四:操作系统版本:#oslevel -r 注:又时候不能使用是因为系统版本低的原因 第五: 阅读全文
posted @ 2020-09-01 11:39 chengxuyonghu 阅读(1297) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 10 下一页