
python
Martin201609
这个作者很懒,什么都没留下…
展开
-
ansible详解和批量部署tomcat
ansible详解和批量部署tomcatansible介绍ansible是自动化运维工具,基于Python开发,集合了众多运维工具(puppet、cfengine、chef、func、fabric)的优点,实现了批量系统配置、批量程序部署、批量运行命令等功能。ansible是基于模块工作的,本身没有批量部署的能力。真正具有批量部署的是ansible所运行的模块,ansible只是提供一种框架...原创 2019-12-19 20:54:39 · 1512 阅读 · 0 评论 -
python脚本调用参数处理
python脚本调用参数处理文件deal_args.py# -*- coding: utf-8 -*- # python脚本参数处理# sys.argv[0] 脚本名称# sys.argv[1] 第一个参数import sysdef deal_args(): print type(sys.argv) length=len(sys.argv) print...原创 2019-05-10 17:42:22 · 526 阅读 · 0 评论 -
使用wsadmin.sh创建数据源所映射的数据库用户
创建数据源所映射对应的用户:脚本名称:create_ds_user.py使用wsadmin.sh 调用# list All Auth Users # 输出所有的用户,配置数据源时使用的用户AdminTask.listAuthDataEntries() # create Auther Useraliasname = 'testuser'username='dbtest...原创 2019-04-10 09:50:14 · 529 阅读 · 0 评论 -
python中join函数
Python中的join()函数的用法[摘录自https://www.cnblogs.com/jsplyy/p/5634640.html]函数:string.join()Python中有join()和os.path.join()两个函数,具体作用如下: join(): 连接字符串数组。将字符串、元组、列表中的元素以指定的字符(分隔符)连接生成一个新的字符串 os....转载 2019-04-08 09:06:29 · 2906 阅读 · 0 评论 -
python实现日志检测
python实现日志检测检测特定目录下的日志文件的大小当文件大小超过200M时,发出告警信息环境信息linuxpython2.7实现代码代码如下,记录之: #!/usr/bin/python# -*- coding:utf-8 -*-import osimport commandsimport sys#设置文件编码os.environ['NLS_L...原创 2019-01-23 09:20:21 · 766 阅读 · 0 评论 -
python统计文件中数字加和
使用python实现读取文件并将数字加和系统环境linux 6.3文件读取 2.txt文件python 2.6文件2.txt内容more 2.txt55516413752123396400146396752代码实现#!/usr/bin/python# -*- coding:utf-8 -*-import os import sysimport os.pat...原创 2019-01-24 09:46:38 · 1740 阅读 · 0 评论 -
使用wlst.sh创建一般数据源
环境信息:weblogic创建连接单机oracle数据库的一般数据源详细代码说明 :########################################## Create General DS for oracle DB ############################################ Basic config admin...原创 2018-08-14 15:49:37 · 1221 阅读 · 0 评论 -
使用wlst.sh 修改server端口
环境 信息:weblogicwlst.sh管理命令行修改一个服务的端口信息代码处理:wlst.shconnect('weblogic','weblogic','t3://localhost:7001')edit()startEdit()cd('Servers')cd('mserver1')set('ListenPort',7007)save()stopEdi...原创 2018-08-14 15:40:38 · 515 阅读 · 0 评论 -
python实现文件系统监控
背景: python实现Linux文件系统监控,当某个目录使用达到某个阈值的时候,自动发送文件告警实现工具:python 2.7linux shell ansible 2.5.0原创 2018-01-15 10:43:02 · 1713 阅读 · 0 评论 -
TypeError: 'module' object is not callable错误处理
新手入门,在一个文件中引用其它文件定义的类报错:定义Logger模块 ,文件名为Logger.py# -*- coding:utf-8 -*-'''自定义日志封装类返回logger类型对象,用于记录日志'''import osimport loggingimport timeclass Logger(object): def __init__(self, log原创 2018-01-22 13:30:16 · 6482 阅读 · 2 评论 -
python中的zip函数使用
python中zip函数使用tuplelistzip使用原创 2016-11-22 11:01:17 · 723 阅读 · 0 评论 -
python中的单引号和双引号
python中的单引号和双引号 常用以及作用,简单记录备忘。#python中的单引号和双引号# 单引号做 连行符str1 = 'hello ' \ ' world'str2 = 'hello world'# 单引号中有双引号, 双引号仅表示 字符str3 = 'hello "world"'print str3# 双引号中有单引号,单引号表字字符,则不需要使用转义字符st原创 2016-11-18 11:17:21 · 1119 阅读 · 0 评论 -
python爬取美女图片
python爬取美女图片字符串分割 截取re模块使用字符编码 decode encode文件保存原创 2016-11-21 15:42:46 · 50107 阅读 · 0 评论