首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏python3

    python基础学习11----函数

    定义函数的参数时请以必须参数、默认参数、带一个星号的不定长参数、带两个星号的不定长参数的顺序定义形参

    35920发布于 2020-01-19
  • 来自专栏python3

    Python基础练习100题 ( 11

    刷题继续 上一期和大家分享了前10道题,今天继续来刷11~20 Question 11: Write a program which accepts a sequence of comma separated num = Test() lst = num.generator(n) print(lst) 源代码下载 这十道题的代码在我的github上,如果大家想看一下每道题的输出结果,可以点击以下链接下载: Python 11-20题 我的运行环境Python 3.6+,如果你用的是Python 2.7版本,绝大多数不同就体现在以下3点: raw_input()在Python3中是input() print需要加括号

    1.1K31发布于 2020-01-03
  • 来自专栏算法工程师的学习日志

    Python基础训练100题-11

    分享一些Python学习题目 实例051:按位与 实例052:按位或 实例053:按位异或 实例054:位取反、位移动 实例055:按位取反 实例051:按位与 题目:学习使用按位与 & 。

    26020编辑于 2022-07-27
  • 来自专栏Python基础、进阶与实战

    Python基础-11 标准库简介(二)

    11. 标准库简介 —— 第二部分 11.1. 日志系统可以直接从 Python 配置,也可以从用户配置文件加载,以便自定义日志记录而无需更改应用程序。 11.6. 弱引用 weakref 模块 11.7. 下面的例子演示了一个以两个字节为存储单元的无符号二进制数值的数组 (类型码为 "H"),而对于普通列表来说,每个条目存储为标准 Python 的 int 对象通常要占用16 个字节: >>> from 模块具有用于操作有序列表的函数: >>> import bisect >>> scores = [(100, 'perl'), (200, 'tcl'), (400, 'lua'), (500, 'python scores, (300, 'ruby')) >>> scores [(100, 'perl'), (200, 'tcl'), (300, 'ruby'), (400, 'lua'), (500, 'python

    54520编辑于 2022-12-06
  • 来自专栏python3

    day10-11-python基础之字符

    (a) 8 print(type(b), b) 9 10 num = "0011" 11 v = int(num, base=16) 12 print(v)     a2:bit_lenght(self = test.isdigit() 7 v3 = test.isnumeric() 8 print(v1,v2,v3)     b11  expandtabs(width)   断句   找到制表符/t ('xa') 7 #v = test.rstrip('9lexxexa') 8 #v = test.strip('xa') 9 #print(v) 10 11 #test.lstrip() 12 6 # break 7 # continue 8 9 # index = 0 10 # while index < len(test): 11 # v = test[index] 12 ) 6 r2 = range(1,10) 7 r3 = range(1,10,2) 8 # 帮助创建连续的数字,通过设置步长来指定不连续 9 v = range(0, 100, 5) 10 11

    61130发布于 2020-01-16
  • 来自专栏Golang开发

    Python基础(11)——迭代器&生成器

    isinstance from collections import Iterable str = "Hello Python" print(isinstance(str,Iterable)) dir 判断是不是含有iter str = 'Hello Python' print('__iter__' in dir(str)) iter()函数 可以被next()函数调用并不断返回下一个值的对象称为迭代器

    33020发布于 2019-05-28
  • 来自专栏技术杂记

    UnrealIRCd 基础11

    访问 下面是使用 IceChat9 访问的界面 下面是使用 mIRC7.4.3 访问的界面 ---- 命令汇总 wget https://www.unrealircd.org/unrealircd4/unrealircd-4.0.2.tar.gz gpg --keyserver keys.gnupg.net --recv-keys 0xA7A21B0A108FF4A9 wget https://www.unrealircd.org/unrealircd4/unrealircd-4.0.2.ta

    43820编辑于 2021-11-29
  • 来自专栏码农帮派

    Python基础学习_11_网页爬虫学习总结

    一.关于爬虫的一些零散知识 1.Robots协议 大多数网站的主页下会有robots.txt文件,标识了爬虫爬取该网站信息时,哪些资源是有限制的,可以使用Python的标准库robotparser 3.查看网站所有者的信息 WHOIS协议可以查询到域名注册者的信息,Python中针对该协议的模块为whois: ? 打印结果: ?

    62230发布于 2020-04-01
  • 来自专栏Linux云计算及前后端开发

    Python基础11-迭代器,生成器

    print(k) for k in dic: print(k) 迭代器总结 优点: 1.提供一种通用的且不依赖于索引的迭代取值方式 2.同一时刻在内存中只存在一个值,更节省内存 ## 在python3 print(next(g)) print(next(g)) print(next(g))  # 统计文件中的字符数量 with open(r'/Users/driverzeng/Desktop/PYTHON print(len(data)) ## 但是这样会出问题,如果文件过大,可能会导致内存溢出 # 使用for循环一行一行的读 with open(r'/Users/driverzeng/Desktop/PYTHON f: res+=len(line) print(res) ## 但是麻烦 # 使用生成器表达式 with open(r'/Users/driverzeng/Desktop/PYTHON

    38520编辑于 2022-09-26
  • 来自专栏技术杂记

    Snort 基础11

    安装报错三 [root@h101 snort-2.9.7.6]# ./configure --enable-sourcefire checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk

    41530编辑于 2022-05-03
  • 来自专栏技术杂记

    RabbitMQ基础11

    [root@h102 rabbitmq]# 日志 =INFO REPORT==== 23-Oct-2015::17:11:19 === Resetting Rabbit forcefully

    29620编辑于 2022-05-04
  • 来自专栏技术杂记

    fio基础11

    rdma The RDMA I/O engine supports both RDMA memory semantics (RDMA_WRITE/RDMA_READ) and channel semantics (Send/Recv) for the InfiniBand, RoCE and iWARP protocols. falloc IO engine that does regular fallocate to simulate data transfer as fio ioengine. DDIR_READ does fallocate(,mode = keep_size,) DDIR_WRITE does fallocate(,mode = 0) DDIR_TRIM does fallocate(,mode = punch_hole) e4defrag IO engine that does regular EXT4_IOC_MOVE_EXT ioctls to simulate defragment activity in request to DDIR_WRITE event rbd IO engine supporting direct access to Ceph Rados Block Devices (RBD) via librbd without the need to use the kernel rbd driver. This ioengine defines engine specific options. gfapi Using Glusterfs libgfapi sync interface to direct access to Glusterfs volumes without options. gfapi_async Using Glusterfs libgfapi async interface to direct access to Glusterfs volumes without having to go through FUSE. This ioengine defines engine specific options. libhdfs Read and write through Hadoop (HDFS). The 'filename' option is used to specify host, port of the hdfs name-node to connect. This engine interprets offsets a little differently. In HDFS, files once created cannot be modified. So random writes are not possible. To imitate this, libhdfs engine expects bunch of small files to be created over HDFS, and engine will randomly pick a file out of those files based on the offset generated by fio backend. (see the example job file to create such files, use rw=write option). Please note, you might want to set necessary environment variables to work with hdfs/libhdfs properly. mtd Read, write and erase an MTD character device (e.g., /dev/mtd0). Discards are treated as erases. Depending on the underlying device type, the I/O may have to go in a certain pattern, e.g., on NAND, writing sequentially to erase blocks and discarding before overwriting. The w

    93940编辑于 2022-04-24
  • 来自专栏技术杂记

    Logstash 基础11

    "_id" : "AVIRvXxq0svkz_zfzuOP", "_score" : 0.06365098, "_source":{"message":"Dec 23 12:11 postfix/smtpd[31499]: connect from unknown[95.75.93.154]\r","@version":"1","@timestamp":"2016-12-23T04:11 :43.000Z","host":"0:0:0:0:0:0:0:1","port":45093,"type":"syslog","syslog_timestamp":"Dec 23 12:11:43",

    26020编辑于 2022-02-10
  • 来自专栏技术杂记

    nginx基础11

    停止 nginx是通过给Nginx主进程发系统信号的方式来停止的 从容停止 [root@h102 logs]# ps faux | grep nginx root 11909 0.0 0

    34410编辑于 2022-05-12
  • 来自专栏Lemon黄

    11 Docker 基础

    下面,我们就来学习一下 Docker 中的一些基础知识及其它在 DevOps 中的重要性。 这就可以消除了“在我的机器上能正常运行”的问题,并未开发人员和运营团队之间的协作提供了一致的基础。 可扩展性和资源效率:Docker 的容器化方法实现了高效的资源利用和可扩展性。 这种可扩展性对于处理高流量负载、优化基础设施使用和实现成本效益至关重要。 快速部署:Docker 通过将应用程序及其依赖关系打包到一个容器中,简化了部署过程。 Docker 基础命令 1 docker run docker run命令用于启动一个新容器并通过命令行与之交互。

    29000编辑于 2023-12-05
  • 来自专栏技术杂记

    etcd 基础11

    条件删除 Compare-and-Delete(CAD) 就是判断删除 Note: CompareAndDelete 不能用于目录,如果测试用于目录,会获得 102 “Not a file” 的错误 Item Comment prevValue 比较当前的值 prevIndex 比较当前的modifiedIndex [root@docker ~]# curl http://127.0.0.1:2379/v2/keys/foo -XPUT -d value=one {"action":"set","node

    43320编辑于 2022-01-20
  • 来自专栏技术杂记

    SQLite 基础11

    table department department 11

    28630编辑于 2021-12-01
  • 来自专栏技术杂记

    memcached基础11

    stats slabs/sizes/resetstats slabsSTAT 1:chunk_size 96STAT 1:chunks_per_page 10922STAT 1:total_pages 1STAT 1:total_chunks 10922STAT 1:used_chunks 4STAT 1:free_chunks 10918STAT 1:free_chunks_end 0STAT 1:mem_requested 305STAT 1:get_hits 21STAT 1:cmd_set 19ST

    26610编辑于 2022-06-26
  • 来自专栏Lemon黄

    11 Docker 基础

    下面,我们就来学习一下 Docker 中的一些基础知识及其它在 DevOps 中的重要性。 这就可以消除了“在我的机器上能正常运行”的问题,并未开发人员和运营团队之间的协作提供了一致的基础。 可扩展性和资源效率:Docker 的容器化方法实现了高效的资源利用和可扩展性。 这种可扩展性对于处理高流量负载、优化基础设施使用和实现成本效益至关重要。 快速部署:Docker 通过将应用程序及其依赖关系打包到一个容器中,简化了部署过程。 Docker 基础命令 1 docker run docker run命令用于启动一个新容器并通过命令行与之交互。

    22810编辑于 2023-12-05
  • 来自专栏技术杂记

    Codis 基础11

    发现此时,slave的同步关系已经自动建立好了 [root@h102 codis]# extern/redis-2.8.21/src/redis-cli -p 6390 info replication # Replication role:slave master_host:localhost master_port:6389 master_link_status:up master_last_io_seconds_ago:8 master_sync_in_progress:0 slave_repl_o

    33740编辑于 2022-03-22
领券