上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 30 下一页
2023年1月16日
摘要: 迭代器 1.该对象需提供next方法,返回迭代器的下一项 2.如果没有下一项即迭代完成时会抛出一个StopIteration异常。 list1 = [1,2,3] iter1 = iter(list1) iter2 = iter(list1)for i in iter1:print("迭代器1:", 阅读全文
posted @ 2023-01-16 11:51 boye169 阅读(32) 评论(0) 推荐(0) 编辑
摘要: 对所有可迭代的对象进行排序操作 sort 与sorted区别: sort 是应用在list上的方法 sorted可以对所以可迭代的对象进行排序操作 list的sort方法返回的是对已经存在的列表进行操作,而内建函数sorted方法返回的是一个新的list ,而不是在原来的基础上进行的操作 语法 so 阅读全文
posted @ 2023-01-16 11:37 boye169 阅读(20) 评论(0) 推荐(0) 编辑
摘要: 查看内置函数 #方法一 dir(__builtins__) #方法二 import builtins dir(builtins) 数据类型 bool:布尔型(True, False) int: 整形(整数) float:浮点型(小数) complex : 复数 进制转换 bin() 将给的参数转换成 阅读全文
posted @ 2023-01-16 11:33 boye169 阅读(11) 评论(0) 推荐(0) 编辑
摘要: import requests def get_external_ip(): try: ip = requests.get("http://jsonip.com/").json().get('ip') return ip except: return None if __name__ =="__ma 阅读全文
posted @ 2023-01-16 10:56 boye169 阅读(203) 评论(0) 推荐(0) 编辑
2023年1月13日
摘要: 文档:https://yunlzheng.gitbook.io/prometheus-book/parti-prometheus-ji-chu/promql/what-is-prometheus-metrics-and-labels https://dandelioncloud.cn/article 阅读全文
posted @ 2023-01-13 16:45 boye169 阅读(240) 评论(0) 推荐(0) 编辑
摘要: test.html <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Go Web</title> </head> <body> {{ . 阅读全文
posted @ 2023-01-13 11:30 boye169 阅读(21) 评论(0) 推荐(0) 编辑
2023年1月12日
摘要: 在ie系列下,$.get()方法在url地址固定时,会缓存返回结果,导致不可预料的问题。但在火狐下,则不会缓存。 要解决该问题有很多办法,最直接的是把$.get()方法换成$.ajax(),然后配置cache:false即可。我不喜欢$.ajax()繁琐的配置方式,可采取以下最简单方式实现: 在$. 阅读全文
posted @ 2023-01-12 11:20 boye169 阅读(82) 评论(0) 推荐(0) 编辑
2023年1月11日
摘要: 使用-u标志来包含用户名,并且curl将提示输入密码: curl -u username http://example.com 在命令中包含密码,但您的密码将在bash历史记录中显示 curl -u username:password http://example.comcurl http://us 阅读全文
posted @ 2023-01-11 11:53 boye169 阅读(1702) 评论(0) 推荐(0) 编辑
摘要: package main import ( "fmt" "log" "net/http" "strings" ) func sayhelloName(w http.ResponseWriter, r *http.Request) { r.ParseForm() //解析参数,默认是不会解析的 fmt 阅读全文
posted @ 2023-01-11 10:36 boye169 阅读(43) 评论(0) 推荐(0) 编辑
2023年1月10日
摘要: 下载 https://github.com/prometheus/pushgateway/releases curl https://github.com/prometheus/pushgateway/releases/download/v1.2.0/pushgateway-1.2.0.linux- 阅读全文
posted @ 2023-01-10 16:21 boye169 阅读(233) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 30 下一页