python 关键字参数为什么只能出现在最后_为什么我只传入一个关键字参数错误值却得到多个值?...

我用以下命令调用函数load():load(r'M:\test_3.p', marker = '*', linestyle = '-.', color = 'b', grid = True)

在这个函数中,我打印了kwargs['color'],我只得到了一个值,我得到了值b(我最初在函数调用中输入的值)。有没有其他原因让我得到这个错误?在脚本的末尾有一个错误。有人能帮忙吗?在

错误具体是:

^{pr2}$

代码如下:def load(string, **kwargs):

#Unpickling the data in order

f = open(string, 'r')

raw_data = pk.load(f)

title = pk.load(f)

xlabel = pk.load(f)

ylabel = pk.load(f)

line_labels = pk.load(f)

line_colors = pk.load(f)

line_marker = pk.load(f)

f.close()

#Specifying the graph

fig0 = plt.figure()

ax = fig0.add_subplot(1,1,1)

plt.ion()

# Handles plt. methods (included some basic ones but in future will add library of all)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值