Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/338.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代码中实现与.Net变量的交互。有没有办法替换pythonnet的scope.Set()scope.Get()?_Python_C#_.net_Python.net - Fatal编程技术网

我想在python代码中实现与.Net变量的交互。有没有办法替换pythonnet的scope.Set()scope.Get()?

我想在python代码中实现与.Net变量的交互。有没有办法替换pythonnet的scope.Set()scope.Get()?,python,c#,.net,python.net,Python,C#,.net,Python.net,python运行时中可能有多个对变量的写入和读取。例如: # int myint=1 a=NetCore.Get(myint) b=a+2 NetCore.Set(myint,b) # myint=3 a=NetCore.Get(myint) c=a+1 NetCore.Set(myint,c) # return myint=4 谢谢大家! 这与C编程语言有什么关系?您是否打算使用C标记来代替?请花一些时间阅读,然后你的问题来解决它的问题并改进它。对不起,我的错。你需要澄清为什么不能只使用P

python运行时中可能有多个对变量的写入和读取。例如:

# int myint=1
a=NetCore.Get(myint)
b=a+2
NetCore.Set(myint,b)

# myint=3
a=NetCore.Get(myint)
c=a+1
NetCore.Set(myint,c)
# return myint=4

谢谢大家!

这与C编程语言有什么关系?您是否打算使用C标记来代替?请花一些时间阅读,然后你的问题来解决它的问题并改进它。对不起,我的错。你需要澄清为什么不能只使用Python变量。否则,您的问题就没有意义了,因为.NET方法没有可以从方法本身外部访问的作用域。你确定你说的不是静态属性/字段吗?