int a = new int [] {1,2,3} for (int x :a) { System.out.println(x); } ...
分类:
编程语言 时间:
2020-12-31 12:26:37
阅读次数:
0
code from threading import Thread from multiprocessing import Process import os def work(name): print('{}的pid是'.format(name), os.getpid()) if __name__ ...
分类:
编程语言 时间:
2020-12-31 12:09:31
阅读次数:
0
code import os from multiprocessing import Process def f(x): print('子进程id :',os.getpid(),'父进程id :',os.getppid()) return x*x if __name__ == '__main__': ...
分类:
系统相关 时间:
2020-12-31 12:06:57
阅读次数:
0
嵌套取值操作 1. 请取出第一个学生的第一个爱好 students_info = [['egon', 18, ['play', ]], ['alex', 18, ['play', 'sleep']]] print(students_info[0][2][0]) 2. 针对字典,请取出取公司名 inf ...
分类:
其他好文 时间:
2020-12-31 12:02:21
阅读次数:
0
code import multiprocessing def foo(i): print ('called function in process: %s' %i) return if __name__ == '__main__': Process_jobs = [] for i in range ...
分类:
编程语言 时间:
2020-12-31 11:59:32
阅读次数:
0
urllib.request 返回的数据需要解码,如 网站返回的是GBK编码数据. 需要调用decode("gbk") 此时输出不会乱码. with urllib.request.urlopen(url, context=context) as response: html = response.r ...
分类:
其他好文 时间:
2020-12-31 11:55:54
阅读次数:
0
1. 目标功能: 将字符串首字母转成大写,而字符串其余字母保持不变 2. 如果使用字符串的capitalize()方法, 可以将字符串的首字母转为大写, 同时会将字符串其余字母都转为小写 示例代码: text_str = "badBoy" print(text_str.capitalize()) 执 ...
分类:
编程语言 时间:
2020-12-30 11:36:29
阅读次数:
0
计划任务crontab-e*/1****sudosh/root/redis/redis_cluster/7003-cron.sh脚本#!/bin/shredis=`netstat-an|grep":7003"|awk‘$1=="tcp"&&$NF=="LISTEN"{print$0}‘|wc-l`if[$redis-eq0];then#端口被占用执行如下sudo/root/redi
分类:
其他好文 时间:
2020-12-30 11:20:41
阅读次数:
0
list=[1,4,3,6,0,33] for j in range(0,len(list)-1): for i in range(0,len(list)-1): if list[i] > list[i+1]: list[i],list[i+1]=list[i+1],list[i] print('l ...
分类:
编程语言 时间:
2020-12-30 10:55:29
阅读次数:
0
` public class YanghuiTest { public static void main(String[] args) { int[][] yh = new int[10][]; for(int i=0;i<yh.length;i++){ yh[i] = new int[i+1]; ...
分类:
编程语言 时间:
2020-12-29 11:52:33
阅读次数:
0