{"id":932932,"date":"2024-12-26T18:07:22","date_gmt":"2024-12-26T10:07:22","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/932932.html"},"modified":"2024-12-26T18:07:25","modified_gmt":"2024-12-26T10:07:25","slug":"notepad%e5%a6%82%e4%bd%95%e7%94%a8python","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/932932.html","title":{"rendered":"notepad\u5982\u4f55\u7528python"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25070601\/50f5f0b9-24e3-42ab-a675-4d5738913904.webp\" alt=\"notepad\u5982\u4f55\u7528python\" \/><\/p>\n<p><p> <strong>\u5728\u4f7f\u7528Python\u64cd\u63a7Notepad\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528Windows\u7684\u7cfb\u7edf\u547d\u4ee4\u6765\u6253\u5f00Notepad\u3001\u4f7f\u7528Python\u7684<code>subprocess<\/code>\u6a21\u5757\u6765\u8fd0\u884cNotepad\u3001\u901a\u8fc7\u6a21\u62df\u952e\u76d8\u8f93\u5165\u64cd\u4f5cNotepad\u7b49\u65b9\u5f0f\u6765\u5b9e\u73b0\u3002\u5176\u4e2d\uff0c\u5229\u7528<code>subprocess<\/code>\u6a21\u5757\u662f\u6700\u5e38\u89c1\u7684\u65b9\u6cd5\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u76f4\u63a5\u4ecePython\u811a\u672c\u4e2d\u6267\u884c\u7cfb\u7edf\u547d\u4ee4\u5e76\u6253\u5f00Notepad\u3002<\/strong><\/p>\n<\/p>\n<p><p>\u5229\u7528<code>subprocess<\/code>\u6a21\u5757\u6253\u5f00Notepad\u662f\u76f8\u5bf9\u7b80\u5355\u548c\u5e38\u7528\u7684\u65b9\u6cd5\u3002\u901a\u8fc7<code>subprocess.run([&quot;notepad.exe&quot;])<\/code>\u547d\u4ee4\uff0c\u4f60\u53ef\u4ee5\u5728Python\u811a\u672c\u4e2d\u76f4\u63a5\u542f\u52a8Notepad\u3002\u8fd9\u79cd\u65b9\u6cd5\u7684\u4f18\u70b9\u5728\u4e8e\u7b80\u6d01\u660e\u4e86\uff0c\u9002\u5408\u7528\u4e8e\u7b80\u5355\u7684\u81ea\u52a8\u5316\u4efb\u52a1\uff0c\u6bd4\u5982\u5feb\u901f\u6253\u5f00\u4e00\u4e2a\u6587\u672c\u6587\u4ef6\u8fdb\u884c\u67e5\u770b\u6216\u7f16\u8f91\u3002<\/p>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u66f4\u8be6\u7ec6\u5730\u63a2\u8ba8\u5982\u4f55\u5728Python\u4e2d\u4f7f\u7528\u4e0d\u540c\u7684\u65b9\u6cd5\u6253\u5f00\u548c\u64cd\u63a7Notepad\uff0c\u5305\u62ec\u5982\u4f55\u901a\u8fc7\u7cfb\u7edf\u547d\u4ee4\u3001<code>subprocess<\/code>\u6a21\u5757\u548c\u952e\u76d8\u8f93\u5165\u6a21\u62df\u6765\u5b9e\u73b0\u8fd9\u4e00\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528\u7cfb\u7edf\u547d\u4ee4<\/h3>\n<\/p>\n<p><p>\u5728Windows\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0cNotepad\u662f\u4e00\u4e2a\u5e38\u89c1\u7684\u6587\u672c\u7f16\u8f91\u5668\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7Python\u6765\u6267\u884c\u547d\u4ee4\u884c\u64cd\u4f5c\uff0c\u4ece\u800c\u6253\u5f00Notepad\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u901a\u8fc7Python\u4f7f\u7528\u7cfb\u7edf\u547d\u4ee4\u6765\u6253\u5f00Notepad\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u4f7f\u7528os.system()\u51fd\u6570<\/strong><\/li>\n<\/ol>\n<p><p>Python\u7684<code>os<\/code>\u6a21\u5757\u63d0\u4f9b\u4e86<code>system()<\/code>\u51fd\u6570\uff0c\u5141\u8bb8\u4f60\u76f4\u63a5\u4ecePython\u811a\u672c\u4e2d\u6267\u884c\u7cfb\u7edf\u547d\u4ee4\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u4ee3\u7801\u6253\u5f00Notepad\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<p>os.system(&#39;notepad.exe&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u7b80\u5355\u76f4\u63a5\uff0c\u4f46\u5b83\u4f1a\u963b\u585ePython\u811a\u672c\u7684\u6267\u884c\uff0c\u76f4\u5230Notepad\u5173\u95ed\u540e\u624d\u4f1a\u7ee7\u7eed\u6267\u884c\u540e\u7eed\u4ee3\u7801\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u4f7f\u7528subprocess.run()\u51fd\u6570<\/strong><\/li>\n<\/ol>\n<p><p><code>subprocess<\/code>\u6a21\u5757\u63d0\u4f9b\u4e86\u66f4\u7075\u6d3b\u7684\u65b9\u6cd5\u6765\u6267\u884c\u5916\u90e8\u547d\u4ee4\u3002<code>subprocess.run()<\/code>\u51fd\u6570\u4e0d\u4ec5\u53ef\u4ee5\u6253\u5f00Notepad\uff0c\u8fd8\u80fd\u5904\u7406\u66f4\u591a\u590d\u6742\u7684\u573a\u666f\uff0c\u4f8b\u5982\u4f20\u9012\u53c2\u6570\u3001\u6355\u83b7\u8f93\u51fa\u7b49\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import subprocess<\/p>\n<p>subprocess.run([&#39;notepad.exe&#39;])<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e0e<code>os.system()<\/code>\u4e0d\u540c\uff0c<code>subprocess.run()<\/code>\u4e0d\u4f1a\u963b\u585e\u540e\u7eed\u4ee3\u7801\u7684\u6267\u884c\uff0c\u4f60\u53ef\u4ee5\u7ee7\u7eed\u5728\u811a\u672c\u4e2d\u6267\u884c\u5176\u4ed6\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u901a\u8fc7Python\u811a\u672c\u7f16\u8f91\u6587\u4ef6<\/h3>\n<\/p>\n<p><p>\u9664\u4e86\u6253\u5f00Notepad\uff0c\u4f60\u8fd8\u53ef\u4ee5\u901a\u8fc7Python\u811a\u672c\u6765\u76f4\u63a5\u7f16\u8f91\u6587\u672c\u6587\u4ef6\uff0c\u7136\u540e\u5728Notepad\u4e2d\u67e5\u770b\u7f16\u8f91\u7ed3\u679c\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u5b9e\u73b0\u8fd9\u4e00\u64cd\u4f5c\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u4f7f\u7528\u6587\u4ef6\u8bfb\u5199\u64cd\u4f5c<\/strong><\/li>\n<\/ol>\n<p><p>Python\u63d0\u4f9b\u4e86\u5185\u7f6e\u7684\u6587\u4ef6\u8bfb\u5199\u64cd\u4f5c\uff0c\u53ef\u4ee5\u7528\u4e8e\u521b\u5efa\u3001\u4fee\u6539\u548c\u8bfb\u53d6\u6587\u672c\u6587\u4ef6\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u521b\u5efa\u5e76\u5199\u5165\u6587\u4ef6<\/p>\n<p>with open(&#39;example.txt&#39;, &#39;w&#39;) as file:<\/p>\n<p>    file.write(&#39;Hello, this is an example text.&#39;)<\/p>\n<h2><strong>\u8bfb\u53d6\u5e76\u6253\u5370\u6587\u4ef6\u5185\u5bb9<\/strong><\/h2>\n<p>with open(&#39;example.txt&#39;, &#39;r&#39;) as file:<\/p>\n<p>    content = file.read()<\/p>\n<p>    print(content)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u4f7f\u7528subprocess\u6253\u5f00\u7f16\u8f91\u540e\u7684\u6587\u4ef6<\/strong><\/li>\n<\/ol>\n<p><p>\u5728\u5b8c\u6210\u6587\u4ef6\u7684\u7f16\u8f91\u540e\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528<code>subprocess<\/code>\u6a21\u5757\u6253\u5f00Notepad\u67e5\u770b\u6587\u4ef6\u5185\u5bb9\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import subprocess<\/p>\n<p>subprocess.run([&#39;notepad.exe&#39;, &#39;example.txt&#39;])<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u6837\uff0c\u4f60\u53ef\u4ee5\u5728Notepad\u4e2d\u770b\u5230\u901a\u8fc7Python\u811a\u672c\u521b\u5efa\u548c\u7f16\u8f91\u7684\u6587\u4ef6\u5185\u5bb9\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u6a21\u62df\u952e\u76d8\u8f93\u5165<\/h3>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ef\u80fd\u9700\u8981\u5728Notepad\u4e2d\u8fdb\u884c\u81ea\u52a8\u5316\u7684\u6587\u672c\u8f93\u5165\u64cd\u4f5c\u3002\u53ef\u4ee5\u4f7f\u7528Python\u7684\u7b2c\u4e09\u65b9\u5e93<code>pyautogui<\/code>\u6765\u6a21\u62df\u952e\u76d8\u8f93\u5165\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u5b89\u88c5pyautogui\u5e93<\/strong><\/li>\n<\/ol>\n<p><p>\u5728\u4f7f\u7528<code>pyautogui<\/code>\u4e4b\u524d\uff0c\u9700\u8981\u5148\u8fdb\u884c\u5b89\u88c5\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u901a\u8fc7pip\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">pip install pyautogui<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u6a21\u62df\u952e\u76d8\u8f93\u5165<\/strong><\/li>\n<\/ol>\n<p><p>\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528<code>pyautogui<\/code>\u6a21\u62df\u952e\u76d8\u8f93\u5165\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pyautogui<\/p>\n<p>import time<\/p>\n<p>import subprocess<\/p>\n<h2><strong>\u6253\u5f00Notepad<\/strong><\/h2>\n<p>subprocess.run([&#39;notepad.exe&#39;])<\/p>\n<p>time.sleep(1)  # \u7b49\u5f85Notepad\u6253\u5f00<\/p>\n<h2><strong>\u6a21\u62df\u952e\u76d8\u8f93\u5165<\/strong><\/h2>\n<p>pyautogui.typewrite(&#39;Hello, this is a simulated input!&#39;, interval=0.1)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u9002\u5408\u7528\u4e8e\u7b80\u5355\u7684\u81ea\u52a8\u5316\u8f93\u5165\u4efb\u52a1\uff0c\u4f46\u5728\u590d\u6742\u7684\u573a\u666f\u4e0b\u53ef\u80fd\u9700\u8981\u7ed3\u5408\u5176\u4ed6\u5de5\u5177\u4f7f\u7528\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u901a\u8fc7Windows API\u8fdb\u884c\u64cd\u4f5c<\/h3>\n<\/p>\n<p><p>\u5bf9\u4e8e\u66f4\u9ad8\u7ea7\u7684\u81ea\u52a8\u5316\u64cd\u4f5c\uff0c\u53ef\u4ee5\u5229\u7528Windows API\u6765\u5b9e\u73b0\u5bf9Notepad\u7684\u63a7\u5236\u3002\u8fd9\u901a\u5e38\u9700\u8981\u66f4\u591a\u7684\u7f16\u7a0b\u6280\u5de7\u548c\u5bf9Windows\u64cd\u4f5c\u7cfb\u7edf\u7684\u6df1\u5165\u4e86\u89e3\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u4f7f\u7528pywin32\u5e93<\/strong><\/li>\n<\/ol>\n<p><p><code>pywin32<\/code>\u662f\u4e00\u4e2aPython\u5e93\uff0c\u5b83\u63d0\u4f9b\u4e86\u5bf9Windows API\u7684\u8bbf\u95ee\u3002\u53ef\u4ee5\u901a\u8fc7\u5b83\u6765\u5b9e\u73b0\u5bf9Windows\u5e94\u7528\u7a0b\u5e8f\u7684\u63a7\u5236\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import win32api<\/p>\n<p>import win32con<\/p>\n<p>import win32gui<\/p>\n<h2><strong>\u6253\u5f00Notepad<\/strong><\/h2>\n<p>subprocess.run([&#39;notepad.exe&#39;])<\/p>\n<h2><strong>\u83b7\u53d6Notepad\u7a97\u53e3\u53e5\u67c4<\/strong><\/h2>\n<p>hwnd = win32gui.FindWindow(None, &#39;\u65e0\u6807\u9898 - \u8bb0\u4e8b\u672c&#39;)<\/p>\n<h2><strong>\u53d1\u9001\u952e\u76d8\u8f93\u5165<\/strong><\/h2>\n<p>win32api.SendMessage(hwnd, win32con.WM_SETTEXT, None, &#39;Hello, this is API input!&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u63a7\u5236\u7a97\u53e3<\/strong><\/li>\n<\/ol>\n<p><p>\u901a\u8fc7Windows API\uff0c\u4f60\u8fd8\u53ef\u4ee5\u5b9e\u73b0\u7a97\u53e3\u7684\u6700\u5c0f\u5316\u3001\u6700\u5927\u5316\u3001\u79fb\u52a8\u7b49\u64cd\u4f5c\u3002\u8fd9\u4e9b\u64cd\u4f5c\u901a\u5e38\u7528\u4e8e\u66f4\u590d\u6742\u7684\u81ea\u52a8\u5316\u4efb\u52a1\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u603b\u7ed3\u4e0e\u5e94\u7528\u573a\u666f<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u5728Python\u4e2d\u5b9e\u73b0\u5bf9Notepad\u7684\u57fa\u672c\u63a7\u5236\uff0c\u5305\u62ec\u6253\u5f00\u3001\u7f16\u8f91\u548c\u6a21\u62df\u8f93\u5165\u3002\u8fd9\u4e9b\u64cd\u4f5c\u5728\u67d0\u4e9b\u81ea\u52a8\u5316\u4efb\u52a1\u4e2d\u975e\u5e38\u6709\u7528\uff0c\u6bd4\u5982\uff1a<\/p>\n<\/p>\n<ul>\n<li><strong>\u81ea\u52a8\u5316\u6d4b\u8bd5<\/strong>\uff1a\u5728\u8f6f\u4ef6\u6d4b\u8bd5\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528Python\u811a\u672c\u6a21\u62df\u7528\u6237\u8f93\u5165\u3002<\/li>\n<li><strong>\u6570\u636e\u5904\u7406<\/strong>\uff1a\u5feb\u901f\u6253\u5f00\u548c\u7f16\u8f91\u65e5\u5fd7\u6587\u4ef6\u6216\u914d\u7f6e\u6587\u4ef6\u3002<\/li>\n<li><strong>\u811a\u672c\u5316\u4efb\u52a1<\/strong>\uff1a\u5c06\u91cd\u590d\u6027\u4efb\u52a1\u811a\u672c\u5316\uff0c\u63d0\u9ad8\u5de5\u4f5c\u6548\u7387\u3002<\/li>\n<\/ul>\n<p><p>\u5c3d\u7ba1\u8fd9\u4e9b\u65b9\u6cd5\u5728\u5f88\u591a\u573a\u666f\u4e0b\u90fd\u975e\u5e38\u6709\u6548\uff0c\u4f46\u5728\u9009\u62e9\u4f7f\u7528\u54ea\u79cd\u65b9\u6cd5\u65f6\uff0c\u9700\u8981\u6839\u636e\u5177\u4f53\u9700\u6c42\u548c\u73af\u5883\u8fdb\u884c\u6743\u8861\u3002\u5982\u679c\u4efb\u52a1\u8f83\u4e3a\u7b80\u5355\uff0c\u53ef\u4ee5\u9009\u62e9<code>subprocess<\/code>\u6a21\u5757\uff1b\u5982\u679c\u9700\u8981\u66f4\u590d\u6742\u7684\u64cd\u4f5c\uff0c\u5219\u53ef\u4ee5\u8003\u8651\u4f7f\u7528<code>pyautogui<\/code>\u6216<code>pywin32<\/code>\u5e93\u3002\u65e0\u8bba\u9009\u62e9\u54ea\u79cd\u65b9\u6cd5\uff0c\u4e86\u89e3\u5176\u5de5\u4f5c\u539f\u7406\u548c\u5e94\u7528\u573a\u666f\u90fd\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u4f7f\u7528Python\u521b\u5efa\u548c\u7f16\u8f91Notepad\u6587\u4ef6\uff1f<\/strong><br \/>\u8981\u5728Python\u4e2d\u521b\u5efa\u548c\u7f16\u8f91Notepad\u6587\u4ef6\uff0c\u53ef\u4ee5\u4f7f\u7528\u5185\u7f6e\u7684\u6587\u4ef6\u64cd\u4f5c\u529f\u80fd\u3002\u4f7f\u7528<code>open()<\/code>\u51fd\u6570\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u65b0\u6587\u4ef6\u6216\u6253\u5f00\u4e00\u4e2a\u5df2\u6709\u6587\u4ef6\uff0c\u7ed3\u5408<code>write()<\/code>\u548c<code>read()<\/code>\u65b9\u6cd5\u5373\u53ef\u5b9e\u73b0\u5199\u5165\u548c\u8bfb\u53d6\u5185\u5bb9\u7684\u529f\u80fd\u3002\u4f8b\u5982\uff1a  <\/p>\n<pre><code class=\"language-python\">with open(&#39;example.txt&#39;, &#39;w&#39;) as file:\n    file.write(&#39;Hello, Notepad!&#39;)\n<\/code><\/pre>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u5c06\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>example.txt<\/code>\u7684\u6587\u4ef6\u5e76\u5199\u5165\u5185\u5bb9\u3002<\/p>\n<p><strong>Python\u662f\u5426\u53ef\u4ee5\u8bfb\u53d6Notepad\u4e2d\u7684\u6587\u672c\uff1f<\/strong><br \/>\u786e\u5b9e\u53ef\u4ee5\uff0c\u4f7f\u7528Python\u53ef\u4ee5\u8f7b\u677e\u8bfb\u53d6Notepad\u6587\u4ef6\u4e2d\u7684\u6587\u672c\u3002\u901a\u8fc7<code>open()<\/code>\u51fd\u6570\u4ee5\u8bfb\u53d6\u6a21\u5f0f\u6253\u5f00\u6587\u4ef6\uff0c\u7136\u540e\u4f7f\u7528<code>read()<\/code>\u6216<code>readlines()<\/code>\u65b9\u6cd5\u83b7\u53d6\u6587\u672c\u5185\u5bb9\u3002\u4f8b\u5982\uff1a  <\/p>\n<pre><code class=\"language-python\">with open(&#39;example.txt&#39;, &#39;r&#39;) as file:\n    content = file.read()\n    print(content)\n<\/code><\/pre>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u4f1a\u8f93\u51fa<code>example.txt<\/code>\u6587\u4ef6\u4e2d\u7684\u6240\u6709\u6587\u672c\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u5982\u4f55\u5904\u7406Notepad\u6587\u4ef6\u4e2d\u7684\u7f16\u7801\u95ee\u9898\uff1f<\/strong><br \/>\u5904\u7406Notepad\u6587\u4ef6\u7684\u7f16\u7801\u95ee\u9898\u65f6\uff0c\u53ef\u4ee5\u5728\u6253\u5f00\u6587\u4ef6\u65f6\u6307\u5b9a\u7f16\u7801\u683c\u5f0f\u3002\u5e38\u89c1\u7684\u7f16\u7801\u6709<code>utf-8<\/code>\u548c<code>gbk<\/code>\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f60\u7684Notepad\u6587\u4ef6\u662f\u7528<code>utf-8<\/code>\u7f16\u7801\u4fdd\u5b58\u7684\uff0c\u53ef\u4ee5\u8fd9\u6837\u6253\u5f00\uff1a  <\/p>\n<pre><code class=\"language-python\">with open(&#39;example.txt&#39;, &#39;r&#39;, encoding=&#39;utf-8&#39;) as file:\n    content = file.read()\n<\/code><\/pre>\n<p>\u8fd9\u5c06\u786e\u4fdd\u8bfb\u53d6\u5230\u7684\u5185\u5bb9\u80fd\u591f\u6b63\u786e\u663e\u793a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728\u4f7f\u7528Python\u64cd\u63a7Notepad\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528Windows\u7684\u7cfb\u7edf\u547d\u4ee4\u6765\u6253\u5f00Notepad\u3001\u4f7f\u7528Pyth [&hellip;]","protected":false},"author":3,"featured_media":932938,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/932932"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=932932"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/932932\/revisions"}],"predecessor-version":[{"id":932940,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/932932\/revisions\/932940"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/932938"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=932932"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=932932"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=932932"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}