简体   繁体   English

运行 python 脚本并在运行时从 c# 到 python 脚本获取值

[英]Run python script and get value from c# to python script while running

I am running python script, while its being run I would like to access method of python using C# and send arguments to method via C#. I am running python script, while its being run I would like to access method of python using C# and send arguments to method via C#. I saw several examples using IronPython, I would like to use some other way where I don't need to add.dll file as reference.我看到了几个使用 IronPython 的示例,我想使用一些其他方式,我不需要添加.dll 文件作为参考。

Typically accessing methods between different coding languages is avoided, but one way you might be able to achieve what you want to do is by using shared memory.通常会避免在不同编码语言之间访问方法,但您可能能够实现您想要做的事情的一种方法是使用共享 memory。 Create a text file, have the C# program write to it, and have the python program read from it whatever arguments you wanted to pass into the method.创建一个文本文件,让 C# 程序写入它,并让 python 程序从中读取您想要传递给方法的任何 arguments 程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM