要求: 代码示例: import java.util.Random;import java.util.Scanner; import javax.script.ScriptEngine;import javax.script.ScriptEngineManager;import javax.scri ...
分类:
其他好文 时间:
2020-10-18 10:04:51
阅读次数:
16
1 import os 2 3 #os.system('python hello1.py') 4 5 6 while 1: 7 print("****************\n") 8 print("****************\n") 9 num = input("please input ...
分类:
其他好文 时间:
2020-10-18 09:57:03
阅读次数:
21
#!/bin/bash #by wwp 2020-10-14 for ip in `cat ip.list` do { ping -c1 -W1 $ip &>/dev/null if [ $? -eq 0 ];then ssh $ip "sed -ri '/^#UseDNS/cUseDNS no' ...
分类:
其他好文 时间:
2020-10-18 09:49:45
阅读次数:
23
背景介绍: 今天跟导师聊了很多,感触颇深,差距颇大,收获颇多~ 对基线和版本的控制有了更深入的了解。 每个人都有自己使用linux的环境,这些环境可以提升自己的工作效率,在岁月长河中,慢慢去完善这些“习惯”。 1 #!/bin/bash 2 3 yesnoinput() 4 { 5 while : ...
分类:
系统相关 时间:
2020-10-16 11:26:33
阅读次数:
36
列表 list = [item1, item2, ...] 如何定义空列表 1. em_list = list() 2. em_list = [] 如何遍历一个列表 # for循环 for i in alist: print(i) # while循环 i = 0 while i < len(alis ...
分类:
编程语言 时间:
2020-10-16 11:13:11
阅读次数:
23
1.1 列表的局限 前面我们说通过队列的 rpush 和 lpop 可以实现消息队列(队尾进队头出),但是消费者需要不停地调用 lpop 查看 List 中是否有等待处理的消息(比如写一个 while 循环)。 为了减少通信的消耗,可以 sleep()一段时间再消费,但是会有两个问题: 1、如果生产 ...
分类:
其他好文 时间:
2020-10-14 20:38:26
阅读次数:
21
分支语句包括if,switch;循环语句包括while,for,dowhile;if,else语句在书写时要注意格式,else总是与相邻的if语句相匹配;switch语句没办法直接实现分支,只能判断选择,需要break实现分支;switch语句允许嵌套使用;循环语句要注意continue,break的用法;continue是结束本次循环,继续执行下一次循环;break是结束整个循环。
分类:
其他好文 时间:
2020-10-13 17:27:53
阅读次数:
20
HelloDocker(一)——Docker简介一、Docker简介1、Docker简介Docker是DockerInc公司开源的一项基于UbuntuLXC技术构建的应用容器引擎DockerEngine的简称,完全基于Go语言开发并遵守Apache2.0协议开源。Docker可以让开发者打包应用以及依赖包到一个轻量级、可移植的容器中,然后发布到任何流行的Linux版本机器上,也可以实现虚拟化。Do
分类:
其他好文 时间:
2020-10-13 17:24:21
阅读次数:
21
常用的三种方式: while read linedoecho $linedone < filename(待读取的文件) cat filename(待读取的文件) | while read linedoecho $linedone for line in `cat filename(待读取的文件)`d ...
分类:
系统相关 时间:
2020-10-12 20:17:26
阅读次数:
25
In our last example, we explored the scheduling of 2 factories. Both factories had 2 costs: Fixed Costs - Costs incurred while the factory is running ...
分类:
其他好文 时间:
2020-10-12 20:02:33
阅读次数:
27