上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 19 下一页
摘要: import os main = "hello3.exe" r_v = os.system(main) print (r_v ) 阅读全文
posted @ 2021-03-06 18:05 朵朵奇fa 阅读(396) 评论(0) 推荐(0) 编辑
摘要: spam=[] spam2=[] for i in range(0,10): spam.extend(str(i))#extend 添加的元素必须是可以迭代的对象,所以不能添加整型 spam2.append(i) print(spam2) 阅读全文
posted @ 2021-03-06 18:03 朵朵奇fa 阅读(107) 评论(0) 推荐(0) 编辑
摘要: package Demo; import java.io.*; public class JavaIO { public static void main(String[] args){ try { //文件IO,File对象既可以表示文件,也可以表示目录 File f1 = new File("C 阅读全文
posted @ 2021-03-06 18:00 朵朵奇fa 阅读(48) 评论(0) 推荐(0) 编辑
摘要: import time def run_time(fun): def wrapper(): start=time.time() fun()#函数在这里执行 end=time.time() cost_time=end-start print("耗时",cost_time) return wrapper 阅读全文
posted @ 2021-03-03 21:59 朵朵奇fa 阅读(64) 评论(0) 推荐(0) 编辑
摘要: #并行:真的多任务,任务数小于cpu核数#并发:假的多任务,任务数大于cpu核数import threadingimport time def sing(): for i in range(5): print("singing") time.sleep(1) def Dance(): for i i 阅读全文
posted @ 2021-03-03 21:28 朵朵奇fa 阅读(74) 评论(0) 推荐(0) 编辑
摘要: import geventfrom gevent import monkeyimport timemonkey.patch_all()def func1(): print("111111") time.sleep(1) def func2(): print("2222") time.sleep(1) 阅读全文
posted @ 2021-03-03 21:27 朵朵奇fa 阅读(53) 评论(0) 推荐(0) 编辑
摘要: #all() 函数用于判断给定的可迭代参数 iterable 中的所有元素是否都为 TRUE,如果是返回 True,否则返回 False。#元素除了是 0、空、None、False 外都算 True。##关于all函数的使用a=['z','a']str="azing"if all(xs in str 阅读全文
posted @ 2021-03-03 21:26 朵朵奇fa 阅读(75) 评论(0) 推荐(0) 编辑
摘要: import pandas as pd df=pd.DataFrame({'A':[1,2,3],"B":[11,22,33]}) df['C']=df['A'].apply(lambda x : x+3)#apply运用于series的每个元素,对series运用apply就是对series的每一 阅读全文
posted @ 2021-03-03 21:24 朵朵奇fa 阅读(72) 评论(0) 推荐(0) 编辑
摘要: package Demo;import java.io.*;public class JavaIO { public static void main(String[] args){ try { //文件IO,File对象既可以表示文件,也可以表示目录 File f1 = new File("C:\ 阅读全文
posted @ 2021-03-03 21:22 朵朵奇fa 阅读(454) 评论(0) 推荐(0) 编辑
摘要: package Demo;public class loop { public static void main(String[] args){ int x = 10; while (x<20){ System.out.println(x); x++; } do{ x++; }while (x<20 阅读全文
posted @ 2021-03-03 21:20 朵朵奇fa 阅读(54) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 19 下一页