ICode9

精准搜索请尝试: 精确搜索
  • day23-1 isinstance、issubclass和反射2019-06-21 21:42:27

    目录 isinstance和issubclass 反射(hasattr,getattr,setattr,delattr) isinstance和issubclass isinstance(obj,cls)检查obj是否是cls的对象,它会检查父类 class Foo: pass f = Foo() print(isinstance(f,Foo)) # f是Foo的实例化对象,所以打印True True class Foo(obje

  • day23(XML,面向对象基础)2019-05-16 17:41:59

    什么是XML  XML与JSON的对比 XML文档格式 使用XML模块解析   一,什么是XML '''XML 全称可扩展标记语言<tag></tag> 双标签<tag/> 单标签 没有文本 一般用于设计文档结构 例如:换行等<tr/>表示换行<tag style='color:red' age='18' >123456</tag>一个标签的完整组成 有三个部分

  • day23 xml模块、面向对象编程介绍2019-05-15 21:39:22

    今日内容: 1、xml模块 2、面向对象编程 一、xml模块 什么是xml? xml是一种可扩展的标记语言 xml语言的语法: <person name="jack">hello i am a person</person> 语法分为三个部分: 标签名(tag): person 属

  • python学习day23 logging模块2019-04-30 16:49:14

    logging&程序目录结构 0.知识点补充 1.字符串格式化 %s #方式1:%s与替换值相对性,构造元组 msg = "我是%s,年龄%s" %('alex',19,) print(msg) #方式2:%s中间加一个变量,最后构造字典匹配值 msg = "我是%(n1)s,年龄%(n2)s" % {'n1': 'alex', 'n2': 123, } print(msg

  • day23单例模式 , 日志处理 , 项目结构目录2019-04-29 08:47:41

    # day23笔记## 一.补充,作业### 1.字符串格式化```pythonmsg = "我是%(n1)s,年龄%(n2)s" % {'n1': 'alex', 'n2': 123, }print(msg)``````python# v1 = "我是{0},年龄{1}".format('alex',19)位置参数v1 = "我是{0},年龄{1}".format(

  • day232019-04-21 22:43:54

    ## 复习   4.类与对象的语法class 类名: 代码块(一堆属性与方法)对象名 = 类名() 变量 | 函数 => 属性 | 方法:前者直接使用,通过所属者.语法调用   类会随所属文件加载而加载(执行内部所有代码),形成类的名称空间3.提前在类中属性的属性与方法,在对象一产生就可以使用这些属

  • SHELL训练营--day23_shell练习56-602019-01-17 20:55:26

    #文件增加内容 #!/bin/bash n=0 cat 1.txt |while read line do n=[$n+1] if [ $n -eq 5 ] then echo $line echo -e "#This is a test file.\n#Test insert line into this file." else echo $line fi done #备份/etc目录 #

  • shell实战训练营Day232019-01-17 19:00:25

    在文本文档1.txt第5行(假设文件行数大于5)后面增加如下内容:#This is a test file.#Test insert line into this file. #!/bin/bashn=0cat 1.txt |while read linedon=$[$n+1]if [ $n -eq 5 ]thenecho $lineecho -e "# This is a test file.\n# Test insert line into this file."else

  • shell训练营Day232019-01-16 15:56:59

    练习56在文本文档1.txt第5行(假设文件行数大于5)后面增加如下内容: This is a test file. Test insert line into this file. #!/bin/bashn=0cat 1.txt |while read linedon=$[$n+1]if [ $n -eq 5 ]thenecho $lineecho -e "# This is a test file.\n# Test insert line into this file

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有