{"id":249,"date":"2020-04-17T08:58:25","date_gmt":"2020-04-17T00:58:25","guid":{"rendered":"https:\/\/zechs.taipei\/?p=249"},"modified":"2020-04-17T08:58:26","modified_gmt":"2020-04-17T00:58:26","slug":"%e8%bd%89%e5%91%bc%e5%8f%abpython%e7%9a%84%e5%9b%9b%e7%a8%ae%e6%96%b9%e6%b3%95%ef%bc%88%e5%98%97%e8%a9%a6%e4%ba%86%e5%9b%9b%e7%a8%ae%ef%bc%8c%e5%8f%aa%e8%a9%b3%e7%b4%b0%e8%ac%9b%e8%a7%a3%e6%9c%ac","status":"publish","type":"post","link":"https:\/\/zechs.taipei\/?p=249","title":{"rendered":"[\u8f49]#\u547c\u53ebpython\u7684\u56db\u7a2e\u65b9\u6cd5\uff08\u5617\u8a66\u4e86\u56db\u7a2e\uff0c\u53ea\u8a73\u7d30\u8b1b\u89e3\u672c\u4eba\u6210\u529f\u7684\u5f8c\u5169\u7a2e\uff0c\u5176\u9918\u65b9\u6cd5\u53ea\u5217\u51fa\uff0c\u8a73\u7d30\u7528\u6cd5\u8acb\u81ea\u884c\u8c37\u6b4c\u767e\u5ea6\uff09"},"content":{"rendered":"<p>\u8f49\u81ea <a href=\"https:\/\/www.itread01.com\/content\/1545323704.html\">https:\/\/www.itread01.com\/content\/1545323704.html<\/a> <\/p>\n\n\n\n<p><strong>\u4e00\u3001\u4f7f\u7528c#\uff0cnuget\u7ba1\u7406\u5305\u4e0a\u4e0b\u8f09\u7684ironPython\u5b89\u88dd\u5305<\/strong><\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp;\u5617\u8a66\u5f8c\u767c\u73fe\uff0c\u5c0d\u5f15\u7528\u4e86numpy\u7b49\u7b2c\u4e09\u65b9\u5eab\u7684python\u7a0b\u5f0f\u78bc\uff0c\u6703\u5831\u627e\u4e0d\u5230\u6a21\u7d44xxx\u7684\u932f\u8aa4\uff0c\u4e0a\u7db2\u67e5\u8b49\u5f8c\u767c\u73fe\u6b64\u554f\u984c\u57fa\u672c\u96e3\u4ee5\u89e3\u6c7a<\/p>\n\n\n\n<p><br><strong>\u4e8c\u3001\u4f7f\u7528c++\u7a0b\u5f0f\u547c\u53ebpython\u6a94\u6848\uff0c\u7136\u5f8c\u5c07\u5176\u505a\u6210\u52d5\u614b\u9023\u7d50\u5eab\uff08dll\uff09\uff0c\u5728c#\u4e2d\u547c\u53eb\u6b64dll\u6a94\u6848<\/strong><br>&nbsp; &nbsp; &nbsp;\u9650\u5236\uff1a\u5be6\u73fe\u65b9\u5f0f\u5f88\u8907\u96dc\uff0c\u4e26\u4e14\u53d7python\u7248\u672c\u3001(python\/vs)32\/64\u4f4d\u5f71\u97ff\uff0c\u800c\u4e14\u8981\u6c42\u4f7f\u7528\u8005\u5fc5\u9808\u5b89\u88ddpython\u57f7\u884c\u74b0\u5883<\/p>\n\n\n\n<p><strong>\u4e09\u3001\u4f7f\u7528\u5b89\u88dd\u597d\u7684python\u74b0\u5883\uff0c\u5229\u7528c#\u547d\u4ee4\u5217\uff0c\u547c\u53eb.py\u6a94\u6848\u57f7\u884c<\/strong><\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; \u512a\u9ede\uff1a\u57f7\u884c\u901f\u5ea6\u53ea\u6bd4\u5728python\u672c\u8eab\u74b0\u5883\u4e2d\u6162\u4e00\u9ede\uff0c\u6b65\u9a5f\u4e5f\u76f8\u5c0d\u7c21\u55ae<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; \u7f3a\u9ede\uff1a\u9700\u8981\u4f7f\u7528\u8005\u5b89\u88dd\u914d\u7f6epython\u74b0\u5883<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; \u5be6\u7528\u6b65\u9a5f\uff1a<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; 1\u3001\u4e0b\u8f09\u5b89\u88ddpython\uff0c\u4e26\u914d\u7f6e\u597d\u74b0\u5883\u8b8a\u6578\u7b49\uff08\u672c\u4eba\u7528\u7684Anaconda\uff0c\u9023\u7d50\u6b64\u8655\u4e0d\u518d\u63d0\u4f9b\uff09<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp;2\u3001\u7de8\u5bebpython\u6a94\u6848\uff08\u9019\u88e1\u70ba\u4e86\u4fbf\u65bc\u7406\u89e3\uff0c\u53ea\u50b3\u6bd4\u8f03\u7c21\u55ae\u7684\u5169\u500b\u5f15\u6578\uff09&nbsp;&nbsp;<\/p>\n\n\n\n<p>\u6ce8\uff1a\u9019\u5169\u500bpython\u6a94\u6848\uff0c\u6211\u5f15\u7528\u4e86numpy\u7b2c\u4e09\u65b9\u5eab\uff0c\u4e5f\u8981\u5b89\u88dd\u5f8c\u624d\u80fd\u5728python\u4e2d\u4f7f\u7528<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#multi.py\n\ndef multiplication(a,b):\n\treturn a*b<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#main.py\nimport numpy as np\nimport multi\nimport sys\n\ndef func(a,b):\n    result=np.sqrt(multi.multiplication(int(a),int(b)))\n    return result\n\n\nif __name__ == '__main__':\n    print(func(sys.argv[1],sys.argv[2]))<\/pre>\n\n\n\n<p>ps:\u70ba\u4e86import\u4e0d\u5831\u932f\uff0c\u5118\u91cf\u628amulti.py\u6a94\u6848\u653emain.py\u540c\u4e00\u8cc7\u6599\u593e\u4e0b\u3002\u56e0\u70ba\u6253\u5305exe\u6a94\u6848\u57f7\u884c\u5f8c\uff0c\u53ef\u80fd\u6703\u5831\u627e\u4e0d\u5230Multi\u6a21\u7d44\u7684\u932f\u8aa4 &nbsp;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; 3\u3001\u5728c#\u4e2d\u547c\u53eb\u4e0a\u8ff0\u4e3bpython\u6a94\u6848\uff1amain.py<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; (\u6211\u76f4\u63a5\u5efa\u4e86\u4e00\u500bwpf\u6a94\u6848\uff0c\u653e\u5728\u4e00\u500b\u6309\u9215\u7684\u9ede\u9078\u4e8b\u4ef6\u4e2d\u57f7\u884c\u4e86\uff0c\u4f60\u5011\u96a8\u610f)<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">        private void Button_Click(object sender, RoutedEventArgs e)\n        {\n\n            string[] strArr=new string[2];\/\/\u5f15\u6578\u5217\u8868\n            string sArguments = @\"main.py\";\/\/\u9019\u88e1\u662fpython\u7684\u6a94\u540d\u5b57\n            strArr[0] = \"2\";\n            strArr[1] = \"3\";\n            RunPythonScript(sArguments, \"-u\", strArr);\n        }\n        \/\/\u547c\u53ebpython\u6838\u5fc3\u7a0b\u5f0f\u78bc\n        public static void RunPythonScript(string sArgName, string args = \"\", params string[] teps)\n        {\n            Process p = new Process();\n            string path = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase + sArgName;\/\/ \u7372\u5f97python\u6a94\u6848\u7684\u7d55\u5c0d\u8def\u5f91\uff08\u5c07\u6a94\u6848\u653e\u5728c#\u7684debug\u8cc7\u6599\u593e\u4e2d\u53ef\u4ee5\u9019\u6a23\u64cd\u4f5c\uff09\n            path = @\"C:\\Users\\user\\Desktop\\test\\\"+sArgName;\/\/(\u56e0\u70ba\u6211\u6c92\u653edebug\u4e0b\uff0c\u6240\u4ee5\u76f4\u63a5\u5beb\u7684\u7d55\u5c0d\u8def\u5f91,\u66ff\u63db\u6389\u4e0a\u9762\u7684\u8def\u5f91\u4e86)\n            p.StartInfo.FileName = @\"D:\\Python\\envs\\python3\\python.exe\";\/\/\u6c92\u6709\u914d\u74b0\u5883\u8b8a\u6578\u7684\u8a71\uff0c\u53ef\u4ee5\u50cf\u6211\u9019\u6a23\u5bebpython.exe\u7684\u7d55\u5c0d\u8def\u5f91\u3002\u5982\u679c\u914d\u4e86\uff0c\u76f4\u63a5\u5beb\"python.exe\"\u5373\u53ef\n            string sArguments = path;\n            foreach (string sigstr in teps)\n            {\n                sArguments += \" \" + sigstr;\/\/\u50b3\u905e\u5f15\u6578\n            }\n\n                sArguments += \" \" + args;\n\n            p.StartInfo.Arguments = sArguments;\n\n            p.StartInfo.UseShellExecute = false;\n\n            p.StartInfo.RedirectStandardOutput = true;\n\n            p.StartInfo.RedirectStandardInput = true;\n\n            p.StartInfo.RedirectStandardError = true;\n\n            p.StartInfo.CreateNoWindow = true;\n\n            p.Start();\n            p.BeginOutputReadLine();\n            p.OutputDataReceived += new DataReceivedEventHandler(p_OutputDataReceived);\n            Console.ReadLine();\n            p.WaitForExit();\n        }\n        \/\/\u8f38\u51fa\u5217\u5370\u7684\u8cc7\u8a0a\n        static void p_OutputDataReceived(object sender, DataReceivedEventArgs e)\n        {\n            if (!string.IsNullOrEmpty(e.Data))\n            {\n                AppendText(e.Data + Environment.NewLine);\n            }\n        }\n        public delegate void AppendTextCallback(string text);\n        public static void AppendText(string text)\n        {\n            Console.WriteLine(text);     \/\/\u6b64\u8655\u5728\u63a7\u5236\u6aaf\u8f38\u51fa.py\u6a94\u6848print\u7684\u7d50\u679c\n\n        }<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/private.codecogs.com\/gif.latex?%5Csqrt%7B2*3%7D\" alt=\"\\sqrt{2*3}\"\/><\/figure>\n\n\n\n<p>\u57f7\u884c\u6210\u529f\uff0c\u5f97\u5230\u7d50\u679c\uff1a\u4e5f\u5c31\u662f<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/img-blog.csdn.net\/20180907174957130?watermark\/2\/text\/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQyMDYzMDkx\/font\/5a6L5L2T\/fontsize\/400\/fill\/I0JBQkFCMA==\/dissolve\/70\" alt=\"\"\/><\/figure>\n\n\n\n<p><br><strong>\u56db\u3001c#\u547c\u53ebpython\u53ef\u57f7\u884cexe\u6a94\u6848\uff0c\u4f7f\u7528\u547d\u4ee4\u5217\u9032\u884c\u50b3\u53c3\u53d6\u8fd4\u56de\u503c<\/strong><\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; \u512a\u9ede\uff1a\u7121\u9700\u5b89\u88ddpython\u57f7\u884c\u74b0\u5883<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; \u7f3a\u9ede\uff1a<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp;1\u3001\u53ef\u80fd\u662f\u56e0\u70ba\u8981\u5c55\u958bexe\u4e2d\u5305\u542b\u7684python\u74b0\u5883\uff0c\u57f7\u884c\u901f\u5ea6\u76f8\u7576\u6162\uff0c\u614e\u7528\uff01<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp;2\u3001\u56e0\u70ba\u662f\u547d\u4ee4\u5217\u50b3\u53c3\u5f62\u5f0f\uff0c\u6545\u50b3\u53c3\u9700\u8981\u81ea\u884c\u8655\u7406\u3002ps\uff1a\u7531\u65bc\u547d\u4ee4\u5217\u50b3\u53c3\u5f62\u5f0f\u70ba\uff1axxx.exe \u5f15\u65781 \u5f15\u65782 \u5f15\u65783&#8230;.<\/p>\n\n\n\n<p>\u6211\u8981\u50b3\u4e00\u500b\u5f88\u5927\u7684\u9663\u5217\uff0c\u66f2\u7dda\u6551\u570b\uff0c\u7528c#\u5c07\u9663\u5217\u5beb\u5165txt\u6a94\u6848\u4e2d\uff0c\u5c07\u5b58\u653e\u8def\u5f91\u50b3\u7d66python\u51fd\u5f0f\uff0cpython\u8b80\u53d6\u6b64txt\u6a94\u6848\u5f97\u5230\u8cc7\u6599<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p><strong>&nbsp; &nbsp; &nbsp;\u4f7f\u7528\u6b65\u9a5f\uff1a<\/strong><\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; 1\u3001\u7de8\u5bebpython\u6a94\u6848\uff08\u9019\u88e1\u70ba\u4e86\u4fbf\u65bc\u7406\u89e3\uff0c\u53ea\u50b3\u6bd4\u8f03\u7c21\u55ae\u7684\u5169\u500b\u5f15\u6578\uff09&nbsp;&nbsp;<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#multi.py\n\ndef multiplication(a,b):\n\treturn a*b<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#main.py\nimport numpy as np\nimport multi\nimport sys\n\ndef func(a,b):\n    result=np.sqrt(multi.multiplication(int(a),int(b)))\n    return result\n\n\nif __name__ == '__main__':\n    print(func(sys.argv[1],sys.argv[2]))<\/pre>\n\n\n\n<p>ps:\u70ba\u4e86import\u4e0d\u5831\u932f\uff0c\u5118\u91cf\u628amulti.py\u6a94\u6848\u653emain.py\u540c\u4e00\u8cc7\u6599\u593e\u4e0b\u3002\u56e0\u70ba\u6253\u5305exe\u6a94\u6848\u57f7\u884c\u5f8c\uff0c\u53ef\u80fd\u6703\u5831\u627e\u4e0d\u5230Multi\u6a21\u7d44\u7684\u932f\u8aa4<\/p>\n\n\n\n<p>2\u3001\u5b89\u88ddpyInstaller\uff08\u82e5\u5df2\u5b89\u88dd\u8acb\u76f4\u63a5\u8df3\u904e\u6b64\u6b65\u9a5f\uff09<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; \u6211\u4f7f\u7528\u7684\u662fAnaconda\u7de8\u5bebpython\uff0c\u6240\u4ee5\u4f7f\u7528Anaconda Prompt\u9032\u884c\u5b89\u88ddpyInstaller\uff08\u76f4\u63a5\u5b89\u88ddpython\u4e26\u914d\u597d\u74b0\u5883\u8b8a\u6578\u7684\u5c0f\u5925\u4f34\uff0c\u53ef\u4ee5\u5728\u96fb\u8166\u7684cmd\u4e0b\u9032\u884c\u64cd\u4f5c\uff09<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/img-blog.csdn.net\/20180905115235414?watermark\/2\/text\/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQyMDYzMDkx\/font\/5a6L5L2T\/fontsize\/400\/fill\/I0JBQkFCMA==\/dissolve\/70\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u9019\u500b\u985e\u4f3c\u65bc\u96fb\u8166\u7684cmd.exe\u7a0b\u5f0f\uff0c\u53ef\u5728\u5176\u4e2d\u8f38\u5165\u547d\u4ee4\u5217\u64cd\u4f5c<\/p>\n\n\n\n<p>\u5b89\u88ddpyInstaller\u547d\u4ee4\u5217:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/img-blog.csdn.net\/20180905115839309?watermark\/2\/text\/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQyMDYzMDkx\/font\/5a6L5L2T\/fontsize\/400\/fill\/I0JBQkFCMA==\/dissolve\/70\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u6b63\u5e38\u4f86\u8b1b\u6703\u5831\u4e00\u500b\u932f\u8aa4\uff0c\u8aaa\u4f60\u7684pip\u7248\u672c\u904e\u4f4e\uff0c\u9700\u8981\u5148\u66f4\u65b0\u4e00\u4e0b<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">pip install --upgrade pip<\/pre>\n\n\n\n<p>\u4f7f\u7528\u6b64\u547d\u4ee4\u66f4\u65b0pip\uff0c\u7136\u5f8c\u518d\u57f7\u884cpip install pyinstaller\u547d\u4ee4\u5373\u53ef<\/p>\n\n\n\n<p>3\u3001\u4f7f\u7528pyinstaller\u6253\u5305python\u7a0b\u5f0f<\/p>\n\n\n\n<p>\u540c\u6a23\u9084\u662f\u5728Anaconda Prompt\u4e2d\uff0ccd python\u6a94\u6848\u6240\u5728\u7684\u8def\u5f91\uff0c\u7136\u5f8c\u57f7\u884c\u6253\u5305\u547d\u4ee4<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/img-blog.csdn.net\/20180905133912529?watermark\/2\/text\/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQyMDYzMDkx\/font\/5a6L5L2T\/fontsize\/400\/fill\/I0JBQkFCMA==\/dissolve\/70\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u6253\u5305\u904e\u7a0b\u53ef\u80fd\u6703\u51fa\u932f\uff08\u627e\u4e0d\u5230\u6a21\u7d44\u3001\u8fed\u4ee3\u6df1\u5ea6\u8d85\u51fa\u7b49\uff0c\u5728\u6211\u53e6\u5169\u7bc7\u90e8\u843d\u683c\u88e1\u6709\u89e3\u6c7a\u8fa6\u6cd5\uff09<\/p>\n\n\n\n<p>\u82e5\u6253\u5305\u6210\u529f\uff0c\u51fa\u73fesuccessfully\uff0c\u5931\u6557\u7684\u8a71\u6703\u7d66\u51fa\u932f\u8aa4\u8cc7\u8a0a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/img-blog.csdn.net\/20180905134346867?watermark\/2\/text\/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQyMDYzMDkx\/font\/5a6L5L2T\/fontsize\/400\/fill\/I0JBQkFCMA==\/dissolve\/70\" alt=\"\"\/><\/figure>\n\n\n\n<p>4\u3001\u5728c#\u4e2d\u547c\u53eb\u6b64exe\u6a94\u6848\uff08\u6b64\u8655\u6211\u5efa\u4e86\u4e00\u500bwpf\u5c08\u6848\uff0c\u5229\u7528\u6309\u9215\u9ede\u9078\u4e8b\u4ef6\u4f86\u5be6\u73fe\u547c\u53eb\uff09<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">namespace WpfTest2\n{\n    \/\/\/ &lt;summary>\n    \/\/\/ MainWindow.xaml \u7684\u4e92\u52d5\u908f\u8f2f\n    \/\/\/ &lt;\/summary>\n    public partial class MainWindow : Window\n    {\n        public MainWindow()\n        {\n            InitializeComponent();\n        }\n\n        private void Button_Click(object sender, RoutedEventArgs e)\n        {\n            \/\/string debugPath = System.Environment.CurrentDirectory;           \/\/\u6b64c#\u5c08\u6848\u7684debug\u8cc7\u6599\u593e\u8def\u5f91\n            string pyexePath = @\"C:\\Users\\user\\Desktop\\test\\dist\\main.exe\";     \n            \/\/python\u6a94\u6848\u6240\u5728\u8def\u5f91\uff0c\u4e00\u822c\u4e0d\u4f7f\u7528\u7d55\u5c0d\u8def\u5f91\uff0c\u6b64\u8655\u50c5\u4f5c\u70ba\u4f8b\u5b50\uff0c\u5efa\u8b70\u8f49\u79fb\u5230debug\u8cc7\u6599\u593e\u4e0b\n            \n            Process p = new Process();\n            p.StartInfo.FileName = pyexePath;\/\/\u9700\u8981\u57f7\u884c\u7684\u6a94\u6848\u8def\u5f91\n            p.StartInfo.UseShellExecute = false; \/\/\u5fc5\u9700\n            p.StartInfo.RedirectStandardOutput = true;\/\/\u8f38\u51fa\u5f15\u6578\u8a2d\u5b9a\n            p.StartInfo.RedirectStandardInput = true;\/\/\u50b3\u5165\u5f15\u6578\u8a2d\u5b9a\n            p.StartInfo.CreateNoWindow = true;\n            p.StartInfo.Arguments = \"2 3\";\/\/\u5f15\u6578\u4ee5\u7a7a\u683c\u5206\u9694\uff0c\u5982\u679c\u67d0\u500b\u5f15\u6578\u70ba\u7a7a\uff0c\u53ef\u4ee5\u50b3\u5165\u201d\u201d\n            p.Start();\n            string output = p.StandardOutput.ReadToEnd();\n            p.WaitForExit();\/\/\u95dc\u9375\uff0c\u7b49\u5f85\u5916\u90e8\u7a0b\u5f0f\u9000\u51fa\u5f8c\u624d\u80fd\u5f80\u4e0b\u57f7\u884c}\n            Console.Write(output);\/\/\u8f38\u51fa\n            p.Close();        \n        }\n    }\n}<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/private.codecogs.com\/gif.latex?%5Csqrt%7B2*3%7D\" alt=\"\\sqrt{2*3}\"\/><\/figure>\n\n\n\n<p>\u5728\u63a7\u5236\u6aaf\u6253\u5370\u51fa\u7d50\u679c\uff1a\u4e5f\u5c31\u662f<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/img-blog.csdn.net\/20180905135451834?watermark\/2\/text\/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQyMDYzMDkx\/font\/5a6L5L2T\/fontsize\/400\/fill\/I0JBQkFCMA==\/dissolve\/70\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u81f3\u6b64\uff0c\u5b8c\u6210c#\u547c\u53ebpython\u7684exe\u6a94\u6848\uff0c\u4e26\u5be6\u73fe\u4e86\u50b3\u5165\u50b3\u51fa\u5f15\u6578\u529f\u80fd\uff0c\u8b1d\u8b1d\u89c0\u770b<\/p>","protected":false},"excerpt":{"rendered":"<p>\u8f49\u81ea https:\/\/www.itread01.com\/content\/1545323704.html \u4e00\u3001\u4f7f &#8230; <a title=\"[\u8f49]#\u547c\u53ebpython\u7684\u56db\u7a2e\u65b9\u6cd5\uff08\u5617\u8a66\u4e86\u56db\u7a2e\uff0c\u53ea\u8a73\u7d30\u8b1b\u89e3\u672c\u4eba\u6210\u529f\u7684\u5f8c\u5169\u7a2e\uff0c\u5176\u9918\u65b9\u6cd5\u53ea\u5217\u51fa\uff0c\u8a73\u7d30\u7528\u6cd5\u8acb\u81ea\u884c\u8c37\u6b4c\u767e\u5ea6\uff09\" class=\"read-more\" href=\"https:\/\/zechs.taipei\/?p=249\" aria-label=\"\u95b1\u8b80\u3008[\u8f49]#\u547c\u53ebpython\u7684\u56db\u7a2e\u65b9\u6cd5\uff08\u5617\u8a66\u4e86\u56db\u7a2e\uff0c\u53ea\u8a73\u7d30\u8b1b\u89e3\u672c\u4eba\u6210\u529f\u7684\u5f8c\u5169\u7a2e\uff0c\u5176\u9918\u65b9\u6cd5\u53ea\u5217\u51fa\uff0c\u8a73\u7d30\u7528\u6cd5\u8acb\u81ea\u884c\u8c37\u6b4c\u767e\u5ea6\uff09\u3009\u5168\u6587\">\u95b1\u8b80\u5168\u6587<\/a><\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-249","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/zechs.taipei\/index.php?rest_route=\/wp\/v2\/posts\/249","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zechs.taipei\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zechs.taipei\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zechs.taipei\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zechs.taipei\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=249"}],"version-history":[{"count":1,"href":"https:\/\/zechs.taipei\/index.php?rest_route=\/wp\/v2\/posts\/249\/revisions"}],"predecessor-version":[{"id":250,"href":"https:\/\/zechs.taipei\/index.php?rest_route=\/wp\/v2\/posts\/249\/revisions\/250"}],"wp:attachment":[{"href":"https:\/\/zechs.taipei\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zechs.taipei\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zechs.taipei\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}