2024-04-18 05:21:09 发布
网友
在我的应用程序中,我将参数传递给Python文件。我写的代码是:
process.StartInfo.Arguments = string.Format("{0} {1}",@"C:\Work\Scripts\XML_Parsing.py", asset_id.Text);
这对我很管用。问题是,我有将近20个值要作为参数传递给Python文件。有没有更好的方法将这些值传递给Python?你知道吗
你知道吗字符串。连接似乎对你的目的有用。你知道吗
string[] python_args = new string[] { @"C:\Work\Scripts\XML_Parsing.py", "arg1", "arg2" }; process.StartInfo.Arguments = String.Join(" ", python_args);
你知道吗字符串。连接似乎对你的目的有用。你知道吗
相关问题 更多 >
编程相关推荐