词典困难时期 [英] Hard time with dictionnary

查看:56
本文介绍了词典困难时期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带变量的词典,我想在全局变量中得到它。



例如:

展开 | 选择 | Wrap | 行号

解决方案

你要做的是非常错误的。通过说全球它你只是在做它。从全球范围内引用;不是什么它指着。为什么你不只是在循环外面有一个变量来存储你想要的条目。


你的意思是什么不好笑?如果你在字典中有375个项目,为什么你不叫它们的名字?我不明白你的困境在哪里......


快而脏:

展开 | 选择 | 换行 | 行号


< blockquote>


又快又脏:

展开 | 选择 | Wrap | 行号

I have a dictionnary with variable in it that I would like to get it in global variable.


example:

Expand|Select|Wrap|Line Numbers

解决方案

What you are trying to do is very wrong. By saying global it you are simply making "it" referable from a global scope; not what "it" points to. Why don''t you just have a variable outside the loop to store the entries that you want.

And what do you mean it is not funny? If you have 375 items in a dictionary why wouldn''t you call them by name? I don''t understand what your dilemma is here...


Quick and dirty:

Expand|Select|Wrap|Line Numbers


Quick and dirty:

Expand|Select|Wrap|Line Numbers


这篇关于词典困难时期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆