首页 > 编程语言 >python批量自动化工作

python批量自动化工作

时间:2023-07-05 16:32:40浏览次数:41  
标签:术士 批量 python arrList ++ intIndex 自动化 骑士 法师


将下述内容批量转换成指定的格式

复仇之魂,众神之王,魅惑魔女,变体精灵,水晶室女,流浪剑客,娜伽海妖,撼地神牛,隐形刺客,秀豆魔导师,熊德,剑圣月之骑士,矮人火枪手,巨魔战将,暗影萨满,钢背兽,熊猫酒仙,半人马酋长,赏金猎人,龙骑士,敌法师,黑暗游侠,全能骑士,沉默术士,树精卫士,谜团,光之守卫,熊战士,食人魔法师,修补匠,幻影长毛手,先知,山岭巨人,哥布林工程师,圣骑士,兽王,双头龙,练金术士,白虎,蛇法女妖,暗夜魔王,骷髅王,末日使者,地穴刺客,鱼人守卫,痛苦女王,骷髅射手,虚空假面,冥界亚龙,复仇电魂,食尸鬼,灵魂守卫,受折磨的灵魂,巫妖,死亡先知,恶魔巫师,剧毒术士,半人猛犸,死灵飞龙,混沌骑士,狼人,育母蜘蛛,幻影刺客,遗忘法师,潮汐猎人,痛苦之源,死灵法师,屠夫,裂魂人,地穴编织者,影魔,沙王,斧王,血魔,地狱领主,幽鬼,巫医,黑耀石毁灭者,术士,地卜师,暗影牧师,蝙蝠骑士,牛头人酋长



格式

arrList[intIndex++] ="复仇之魂"


arrList[intIndex++] ="众神之王"


arrList[intIndex++] ="魅惑魔女"


arrList[intIndex++] ="变体精灵"


arrList[intIndex++] ="水晶室女"


arrList[intIndex++] ="流浪剑客"



代码:

# -*- coding: utf-8 -*-
  
  

   import sys
  
  

   #hero=u"复仇之魂,众神之王,魅惑魔女,变体精灵,水晶室女,流浪剑客,娜伽海妖,撼地神牛,隐形刺客,秀豆魔导师,熊德,剑圣,月之骑士,矮人火枪手,巨魔战将,暗影萨满,钢背兽,熊猫酒仙,半人马酋长,赏金猎人,龙骑士,敌法师,黑暗游侠,全能骑士,沉默术士,树精卫士,谜团,光之守卫,熊战士,食人魔法师,修补匠,幻影长毛手,先知,山岭巨人,哥布林工程师,圣骑士,兽王,双头龙,练金术士,白虎,蛇法女妖,暗夜魔王,骷髅王,末日使者,地穴刺客,鱼人守卫,痛苦女王,骷髅射手,虚空假面,冥界亚龙,复仇电魂,食尸鬼,灵魂守卫,受折磨的灵魂,巫妖,死亡先知,恶魔巫师,剧毒术士,半人猛犸,死灵飞龙,混沌骑士,狼人,育母蜘蛛,幻影刺客,遗忘法师,潮汐猎人,痛苦之源,死灵法师,屠夫,裂魂人,地穴编织者,影魔,沙王,斧王,血魔,地狱领主,幽鬼,巫医,黑耀石毁灭者,术士,地卜师,暗影牧师,蝙蝠骑士,牛头人酋长"
  
  

   hero=u"复仇之魂,众神之王,魅惑魔女,变体精灵,水晶室女,流浪剑客,娜伽海妖,撼地神牛,隐形刺客,秀豆魔导师,熊德,剑圣月之骑士,矮人火枪手,巨魔战将,暗影萨满,钢背兽,熊猫酒仙,半人马酋长,赏金猎人,龙骑士,敌法师,黑暗游侠,全能骑士,沉默术士,树精卫士,谜团,光之守卫,熊战士,食人魔法师,修补匠,幻影长毛手,先知,山岭巨人,哥布林工程师,圣骑士,兽王,双头龙,练金术士,白虎,蛇法女妖,暗夜魔王,骷髅王,末日使者,地穴刺客,鱼人守卫,痛苦女王,骷髅射手,虚空假面,冥界亚龙,复仇电魂,食尸鬼,灵魂守卫,受折磨的灵魂,巫妖,死亡先知,恶魔巫师,剧毒术士,半人猛犸,死灵飞龙,混沌骑士,狼人,育母蜘蛛,幻影刺客,遗忘法师,潮汐猎人,痛苦之源,死灵法师,屠夫,裂魂人,地穴编织者,影魔,沙王,斧王,血魔,地狱领主,幽鬼,巫医,黑耀石毁灭者,术士,地卜师,暗影牧师,蝙蝠骑士,牛头人酋长"
  
  

   d=hero.split(u",")
  
  

   i=0
  
  

   for x in d:
  
  

       s="arrList[intIndex++] ="
  
  

       s+="\""+d[i]
  
  

       s+="\""
  
  

       print s
  
  

       i=i+1


输出:


Python 2.7 (r27:82525, Jul  4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] on win32
  
  

   Type "copyright", "credits" or "license()" for more information.
  
  

   >>> ================================ RESTART ================================
  
  

   >>> 
  
  

   arrList[intIndex++] ="复仇之魂"
  
  

   arrList[intIndex++] ="众神之王"
  
  

   arrList[intIndex++] ="魅惑魔女"
  
  

   arrList[intIndex++] ="变体精灵"
  
  

   arrList[intIndex++] ="水晶室女"
  
  

   arrList[intIndex++] ="流浪剑客"
  
  

   arrList[intIndex++] ="娜伽海妖"
  
  

   arrList[intIndex++] ="撼地神牛"
  
  

   arrList[intIndex++] ="隐形刺客"
  
  

   arrList[intIndex++] ="秀豆魔导师"
  
  

   arrList[intIndex++] ="熊德"
  
  

   arrList[intIndex++] ="剑圣月之骑士"
  
  

   arrList[intIndex++] ="矮人火枪手"
  
  

   arrList[intIndex++] ="巨魔战将"
  
  

   arrList[intIndex++] ="暗影萨满"
  
  

   arrList[intIndex++] ="钢背兽"
  
  

   arrList[intIndex++] ="熊猫酒仙"
  
  

   arrList[intIndex++] ="半人马酋长"
  
  

   arrList[intIndex++] ="赏金猎人"
  
  

   arrList[intIndex++] ="龙骑士"
  
  

   arrList[intIndex++] ="敌法师"
  
  

   arrList[intIndex++] ="黑暗游侠"
  
  

   arrList[intIndex++] ="全能骑士"
  
  

   arrList[intIndex++] ="沉默术士"
  
  

   arrList[intIndex++] ="树精卫士"
  
  

   arrList[intIndex++] ="谜团"
  
  

   arrList[intIndex++] ="光之守卫"
  
  

   arrList[intIndex++] ="熊战士"
  
  

   arrList[intIndex++] ="食人魔法师"
  
  

   arrList[intIndex++] ="修补匠"
  
  

   arrList[intIndex++] ="幻影长毛手"
  
  

   arrList[intIndex++] ="先知"
  
  

   arrList[intIndex++] ="山岭巨人"
  
  

   arrList[intIndex++] ="哥布林工程师"
  
  

   arrList[intIndex++] ="圣骑士"
  
  

   arrList[intIndex++] ="兽王"
  
  

   arrList[intIndex++] ="双头龙"
  
  

   arrList[intIndex++] ="练金术士"
  
  

   arrList[intIndex++] ="白虎"
  
  

   arrList[intIndex++] ="蛇法女妖"
  
  

   arrList[intIndex++] ="暗夜魔王"
  
  

   arrList[intIndex++] ="骷髅王"
  
  

   arrList[intIndex++] ="末日使者"
  
  

   arrList[intIndex++] ="地穴刺客"
  
  

   arrList[intIndex++] ="鱼人守卫"
  
  

   arrList[intIndex++] ="痛苦女王"
  
  

   arrList[intIndex++] ="骷髅射手"
  
  

   arrList[intIndex++] ="虚空假面"
  
  

   arrList[intIndex++] ="冥界亚龙"
  
  

   arrList[intIndex++] ="复仇电魂"
  
  

   arrList[intIndex++] ="食尸鬼"
  
  

   arrList[intIndex++] ="灵魂守卫"
  
  

   arrList[intIndex++] ="受折磨的灵魂"
  
  

   arrList[intIndex++] ="巫妖"
  
  

   arrList[intIndex++] ="死亡先知"
  
  

   arrList[intIndex++] ="恶魔巫师"
  
  

   arrList[intIndex++] ="剧毒术士"
  
  

   arrList[intIndex++] ="半人猛犸"
  
  

   arrList[intIndex++] ="死灵飞龙"
  
  

   arrList[intIndex++] ="混沌骑士"
  
  

   arrList[intIndex++] ="狼人"
  
  

   arrList[intIndex++] ="育母蜘蛛"
  
  

   arrList[intIndex++] ="幻影刺客"
  
  

   arrList[intIndex++] ="遗忘法师"
  
  

   arrList[intIndex++] ="潮汐猎人"
  
  

   arrList[intIndex++] ="痛苦之源"
  
  

   arrList[intIndex++] ="死灵法师"
  
  

   arrList[intIndex++] ="屠夫"
  
  

   arrList[intIndex++] ="裂魂人"
  
  

   arrList[intIndex++] ="地穴编织者"
  
  

   arrList[intIndex++] ="影魔"
  
  

   arrList[intIndex++] ="沙王"
  
  

   arrList[intIndex++] ="斧王"
  
  

   arrList[intIndex++] ="血魔"
  
  

   arrList[intIndex++] ="地狱领主"
  
  

   arrList[intIndex++] ="幽鬼"
  
  

   arrList[intIndex++] ="巫医"
  
  

   arrList[intIndex++] ="黑耀石毁灭者"
  
  

   arrList[intIndex++] ="术士"
  
  

   arrList[intIndex++] ="地卜师"
  
  

   arrList[intIndex++] ="暗影牧师"
  
  

   arrList[intIndex++] ="蝙蝠骑士"
  
  

   arrList[intIndex++] ="牛头人酋长"
  
  

   >>>



感觉非常方便,同时也提高了效率,可以根据不同的需求做简单的修改

标签:术士,批量,python,arrList,++,intIndex,自动化,骑士,法师
From: https://blog.51cto.com/u_15990596/6632888

相关文章

  • python基础 进程、操作系统调度算法、同步异步、开启进程、process类的参数、进程锁、
    进程概念进程、线程都是操作系统中的基本概念,也就是说进程和线程都是操作系统层的东西,专业术语表达就是进程和线程的使用都是由操作系统来调度的‘,而不是由我们来操控的。在操作系统这门课里,进程和线程是操作系统的概念,协程不是操作系统中的概念,而是我们程序层面的......
  • python条件判断语句
    if条件判断语句if条件:(缩进)语句块一语句块二python的条件判断语句是没有括号的,对于所匹配的代码块的精准定位是通过缩进实现的,这是python的一大特色。、if条件:   语句块一else:   语句块二如果还有更多条件的话可以引入elifif条件:   语句块一e......
  • 1 opencv-python图像读写模块
    这个分类记录自己学习opencv的随笔文档,方便以后查询和复习。python-opencv环境配置网上教程很多,此处就不做赘述了,该文档记录opencv最基础的图像读写和显示,工具是jupyternotebook。1opencv中,图像读取函数是imread(filename,flags=None)参数说明:filename:读取图像的路径,通常支......
  • 利用ansible批量部署node客户端,并注册consul,实现主机自动发现
      1.在管理机器上搭建consul并上传 node_exoporter软件包,system服务配置文件,注册脚本 2.利用ansible对指定机器去分发软件包并启动服务,并curl注册到consul  编写为node-exporter.yml 3.prometheus配置consul地址,获取主机信息,自动发现并配合grafana展示  system......
  • python 并发编程
    一、需要了解的概念1、进程和程序的区别程序就是一堆死的东西,没有生命周期进程是有生命周期的,当一个任务进行完毕之后,进程就不存在了2、cpu的工作机制1.当CPU遇到I/O操作的时候,会剥夺CPU的执行权限I/O密集型:inputoutput遇到阻塞,但是不需要占用大量的CPU资源,需要等待,比如:sle......
  • 批量删除后台
      删除一个 删除多个  BrandMapper.xml<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEmapperPUBLIC"-//mybatis.org//DTDMapper3.0//EN""http://mybatis.org/dtd/mybatis-3-mapper.dtd"&g......
  • Java批量操作Excel文件实践
    摘要:本文由葡萄城技术团队于博客园原创并首发。转载请注明出处:葡萄城官网,葡萄城为开发者提供专业的开发工具、解决方案和服务,赋能开发者。前言|问题背景在操作Excel的场景中,通常会有一些针对Excel的批量操作,批量的意思一般有两种:对批量的Excel文件进行操作。如导入多个Excel......
  • python环境问题--import matplotlib.pyplot as plt报错
        python环境配置好后,刚开始没问题,过几天用vscode写python代码的时候,突然导matplotlib包报错:DLLloadfailed:找不到指定的模块。    首先定位报错的具体代码,发现是导入matplotlib包报错,去掉那条命令后程序正常执行,然后继续尝试,importmatplotlib没有问题,但是im......
  • C++、Lua、Python字符串防止转义
    使用场景C++里测试路径需要转义,Windows复制路径里面的斜杠需要加斜杠,每次都需要操作比较麻烦,而且看着也不好看换行,代码里有时候硬编码一些文本、数据,依赖""的自动拼接和行末的斜杠,需要手动写\r\n换行C++Rawstringliteral以前用Lua,里有[[]],防止转义非常方便。后来了解到P......
  • python celery 使用
    目录结构配置点击查看代码fromceleryimportCelery,platformsfromkombuimportExchange,Queueplatforms.C_FORCE_ROOT=Truebroker='redis://127.0.0.1:6380/1'backend='redis://127.0.0.1:6380/2'app=Celery('sxj',b......