This commit is contained in:
owenchen committed 2026-06-04 08:16:49 +08:00
1 parent 39494fb5c3
commit 871de41ba5
9 files changed
+259 -49

No files matched your search

+21
View File
@@ -156,6 +156,27 @@ namespace CloudBuilder.Topshelf.Python
return null;
}
public List<string> GetSurnames()
{
try
{
//必须定义方法的方式使用
using (Py.GIL())
{
string json = python.GetValueExec($"processor.get_surnames_json()");
// 反序列化
if (json == "[]") return null;
return JsonSerializer.Deserialize<List<string>>(json);
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
return null;
}
public string Get(string arg)
{
return python.GetValueExec(arg);