首页
关于
友链
Search
1
ESXI 一些功能调整
626 阅读
2
天翼云网关3.0/4.0超管密码
564 阅读
3
SoftEther 客户端篇
528 阅读
4
SoftEther 服务端篇
440 阅读
5
Centos安装个人网盘Alist v3教程
384 阅读
奇思妙想
代码相关
软件分享
游戏分享
游戏相关
我的家庭影院
Ai
登录
Search
标签搜索
python
esxi
git
SoftEther
linux
apscheduler
在线
rclone
飞牛
list
列表
idm
激活码
Charles
pdf
免安装
鲁大师
图片查看器
蜂蜜浏览器
honeyview
哥特式
累计撰写
111
篇文章
累计收到
15
条评论
首页
栏目
奇思妙想
代码相关
软件分享
游戏分享
游戏相关
我的家庭影院
Ai
页面
关于
友链
搜索到
94
篇与
的结果
2022-05-09
Python *args和**kwargs
我们知道splat运算符解包多个值,并且知道函数参数有两种类型。若现在还未弄明白,那么可以将*args理解为变元的缩写,而**kwargs理解为关键字变元的缩写。各参数用于解压其各自的变元类型,允许使用可变字长变元列表进行函数调用。例如,创建一个函数表示学生的考试分数。def printScores(student,*scores): print(f"Student Name:{student}") for score in scores: print(score) printScores("Jonathan",100, 95, 88, 92, 99) """ Student Name: Jonathan 100 95 88 92 99 """噢,等等,我并未称呼其为*args?是的,“args”是一个标准化规范,但仍然只是一个名称。事实上,在*args中,唯一的星号是真正的参与者,创建了列表,其内容则是来自函数调用的位置参数(在这些定义变元后)。这些理清楚之后,**kwargs就很容易理解了。名称并不重要,重要的是双星号创建了字典,其内容是关键字参数,来自函数调用(在这些定义变元后)。为了更好地演示,我们创建一个函数,输出参加全国英语等级考试的人员名单。def printPetNames(owner,**pets): print(f"Owner Name:{owner}") for pet,name in pets.items(): print(f"{pet}:{name}") printPetNames("Jonathan", dog="Brock",fish=["Larry", "Curly", "Moe"],turtle="Shelldon") """ Owner Name: Jonathan dog: Brock fish: ['Larry', 'Curly', 'Moe'] turtle: Shelldon """
2022年05月09日
24 阅读
0 评论
0 点赞
2022-04-20
Python定时器
import threading import datetime def run(): print(datetime.datetime.now()) timer = threading.Timer(1, run) timer.start() # 这里才开始运行 if __name__ == '__main__': tq = threading.Timer(1, function=run) # 这里是创建线程 tq.start()
2022年04月20日
60 阅读
0 评论
1 点赞
2022-04-06
button和submit
如果是button请将button的类型改为type="button",因为浏览器会认为button按钮默认类型是submit,会提交数据从而导致整个页面刷新在ie浏览器中按钮的type默认是button,在其他浏览器(如火狐,chrome)则是submit
2022年04月06日
59 阅读
0 评论
0 点赞
2022-04-06
vue跨域问题
在vue-cli版本为2.x的情况下修改webpack.dev.conf.js中的devServer对象加入disableHostCheck: truedevServer: { disableHostCheck: true, }vue-cli版本3.0的情况下修改vue.config.jsmodule.exports = { devServer: { disableHostCheck: true, // 或者试试下面这个 allowedHosts:['.xxxx.com','.xxx.com'], 或者是all } }
2022年04月06日
41 阅读
0 评论
0 点赞
1
...
6
7