Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/298.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python'的名称是什么;s";变量();vb.net中的函数?_Python_Vb.net_Function - Fatal编程技术网

Python'的名称是什么;s";变量();vb.net中的函数?

Python'的名称是什么;s";变量();vb.net中的函数?,python,vb.net,function,Python,Vb.net,Function,我有一段简单的代码: ##Variables representing a table of 5 rows and 5 columns: r1c1, r1c2, r1c3, r1c4, r1c5 = "","","","","" r2c1, r2c2, r2c3... = "","","","","" #for all 5 rows. (I know this is not the best way to do things, but bare with me) for r in range(

我有一段简单的代码:

##Variables representing a table of 5 rows and 5 columns:

r1c1, r1c2, r1c3, r1c4, r1c5 = "","","","",""
r2c1, r2c2, r2c3... = "","","","",""
#for all 5 rows. (I know this is not the best way to do things, but bare with me)
for r in range(1,6):
    for c in range(1,6):
        currentPos= "r"+str(r)+"c"+str(c)
        vars()[currentPos]="identified"
        #print(currentPos)
print(r1c1)
print(r1c2)
print(r...)
所有这些变量实际上代表了我的vb.net程序中的许多对象,我想将其.text属性更改为一个值

本质上,我不知道python“var()”函数的vb版本是什么,如果有的话

进一步的细节:我实际上希望数据库中的所有字段和行与我的vb程序中的每个定位文本框相对应


其他解决方案也可以。

这是
vars()
function而不是
var()
function.)这是可怕的代码。Python让你这么做已经够糟糕的了——VB.Net到处都是肮脏的旧东西,你不需要把Python的脏衣服也带进去。只需使用合理的数据结构重新编写即可。与其尝试直接翻译代码,不如考虑您尝试实现的功能,然后编写最好的VB代码来实现它。@jmchiliney我之所以这样问是因为我无法做到这一点。实际上,我找不到任何函数或任何东西可以帮助我的代码实现这一点。我可以用python来做,这就是为什么我要包含它。我可以专门问一下我的vb问题,但是我会有更多的方法来解决这个问题,当我想知道是否有什么好的方法可以用这种特定的方式来解决这个问题的时候。我想知道怎么做,而不是别人告诉我怎么做。这就是我提出这个问题的原因。我建议你学习VB.NET是如何工作的。它不是那样工作的。