{"id":362,"date":"2017-06-25T15:50:44","date_gmt":"2017-06-25T07:50:44","guid":{"rendered":"https:\/\/9dream.me\/?p=362"},"modified":"2017-06-25T17:26:10","modified_gmt":"2017-06-25T09:26:10","slug":"python-%e5%9f%ba%e7%a1%801-2-%e7%ac%ac%e4%b8%80%e4%b8%aa%e5%b0%8f%e7%a8%8b%e5%ba%8f-test-py","status":"publish","type":"post","link":"https:\/\/9dream.me\/python-%e5%9f%ba%e7%a1%801-2-%e7%ac%ac%e4%b8%80%e4%b8%aa%e5%b0%8f%e7%a8%8b%e5%ba%8f-test-py\/","title":{"rendered":"Python \u57fa\u78401.2-\u7b2c\u4e00\u4e2a\u5c0f\u7a0b\u5e8f"},"content":{"rendered":"

\u5b89\u88c5\u597d\u4e86python3.6\u540e \uff0c\u6839\u636e\u5728\u7ebf\u6559\u7a0b\u4e0a\u7684\u6307\u5bfc\u5f00\u59cb\u5199test.py\u8fd9\u4e2a\u5c0f\u7a0b\u5e8f\uff0c\u4f9d\u7167\u6211\u5728HTML\u91cc\u7684\u7ecf\u9a8c\u6211\u590d\u5236\u4e86\u4f8b\u5b50\u4e2d\u7684\u4ee3\u7801\u8bd5\u56fe\u8d34\u5230Python\u4ea4\u4e92\u5f0f\u73af\u5883\u7a97\u53e3\uff0c\u6ca1\u9519\u5c31\u662f\u8fd9\u4e2a\u8fd9\u4e2a\u9ed1\u8272\u7684\u7a97\u53e3\"python1\"\uff0c\u53ef\u662f\u5e76\u6ca1\u6709\u6210\u529f\uff0c\u63d0\u793a\u7b26\u540e\u53ea\u51fa\u73b0\u4e86^V \u8fd9\u6837\u7684\u5b57\u7b26\uff0c\u4e3a\u4ec0\u4e48\uff1f<\/p>\n

\u662f\u7684\uff0c\u6211\u4e0d\u5e94\u8be5\u5077\u61d2\u800c\u4e0d\u53bb\u4e00\u4e00\u7ec3\u4e60\u3002\u6240\u4ee5\u5343\u4e07\u4e0d\u8981\u7528\u201c\u590d\u5236\u201d-\u201c\u7c98\u8d34\u201d\u7684\u65b9\u5f0f\u628a\u4ee3\u7801\u4ece\u9875\u9762\u7c98\u8d34\u5230\u73af\u5883\u7a97\u53e3<\/span><\/p>\n

\u597d\u4e86\uff0c\u8ba9\u6211\u7528print()<\/code>\u51fd\u6570\uff08\u8ba9Python\u6253\u5370\u51fa\u6307\u5b9a\u7684\u6587\u5b57\uff09\u5f00\u542fhello world\u65c5\u7a0b\u5427\uff0c\u7136\u540e\u628a\u5e0c\u671b\u6253\u5370\u7684\u6587\u5b57\u7528\u5355\u5f15\u53f7\u6216\u8005\u53cc\u5f15\u53f7\u62ec\u8d77\u6765\uff0c\u4f46\u4e0d\u80fd\u6df7\u7528\u5355\u5f15\u53f7\u548c\u53cc\u5f15\u53f7\uff0c\u56e0\u4e3a\u5728\u5b89\u88c5V3\u4e4b\u524d\u6211\u7528\u8fc7V2 \u7684\u7248\u672c\uff0c2\u91cc\u662f\u4e0d\u9700\u8981\u7528\u62ec\u53f7\u7684\uff0c\u8fd9\u662fPy2 \u548c Py3\u7684\u4e00\u4e2a\u533a\u522b\u4e4b\u4e00\u3002<\/p>\n

>>> <\/span>print('hello, world'<\/span>)\r\nhello, world\r\n<\/code><\/pre>\n

\u8fd9\u79cd\u7528\u5355\u5f15\u53f7\u6216\u8005\u53cc\u5f15\u53f7\u62ec\u8d77\u6765\u7684\u6587\u672c\u5728\u7a0b\u5e8f\u4e2d\u53eb\u5b57\u7b26\u4e32\uff1b\u5230\u6b64\u4e3a\u6b62\u5b8c\u6210\u4e86hello world,\u6211\u60f3save \u8fd9\u7b2c\u4e00\u4e2a\u7a0b\u5e8f\u53ef\u662f\u6211\u53d1\u73b0\u5de6\u4e0a\u89d2\u6ca1\u6709save \u7684option, \u6211\u4ee5\u4e3a\u8fd9\u8ddf\u6211\u5728\u7528word,txt,\u4e00\u6837\u7684\uff0c\u662f\u7684\u8fd9\u4e5f\u662f\u4e0d\u540c\u7684\u5730\u65b9\uff0c\u6ca1\u6709save \u6587\u4ef6\u7684\u6309\u94ae\uff0c\u8001\u5e08\u8bf4\u8981\u7528IDE\u754c\u9762\u624d\u80fdsave\u6587\u4ef6py<\/p>\n

\u597d\u5427\uff0c\u6211\u8fd8\u662f\u88c5\u4e00\u4e2aPycharm \u597d\u4e86 \uff0c\u8ba9\u6211\u5148\u7528exit()\u4f53\u9a8c\u4e0b\u9000\u51faPython\u4ea4\u4e92\u73af\u5883\u3002<\/p>\n

\u5728\u4e0b\u4e00\u8282test \u4e4b\u524d\u5148\u4e86\u89e3\u4e0b\u6ce8\u610f\u4e8b\u9879<\/p>\n

\u547d\u4ee4\u884c\u6a21\u5f0f\u548cPython\u4ea4\u4e92\u6a21\u5f0f<\/em><\/span><\/h3>\n

\u5728\u547d\u4ee4\u884c\u6a21\u5f0f\u4e0b\uff0c\u53ef\u4ee5\u6267\u884cpython<\/code>\u8fdb\u5165Python\u4ea4\u4e92\u5f0f\u73af\u5883\uff0c\u4e5f\u53ef\u4ee5\u6267\u884cpython hello.py<\/code>\u8fd0\u884c\u4e00\u4e2a.py<\/code>\u6587\u4ef6\u3002<\/p>\n

\u770b\u5230>>><\/code>\u662f\u5728Python\u4ea4\u4e92\u5f0f\u73af\u5883\u4e0b\uff1a<\/p>\n

\u6b64\u5916\uff0c\u5728\u547d\u4ee4\u884c\u6a21\u5f0f\u8fd0\u884c.py<\/code>\u6587\u4ef6\u548c\u5728Python\u4ea4\u4e92\u5f0f\u73af\u5883\u4e0b\u76f4\u63a5\u8fd0\u884cPython\u4ee3\u7801\u6709\u6240\u4e0d\u540c\u3002Python\u4ea4\u4e92\u5f0f\u73af\u5883\u4f1a\u628a\u6bcf\u4e00\u884cPython\u4ee3\u7801\u7684\u7ed3\u679c\u81ea\u52a8\u6253\u5370\u51fa\u6765\uff0c\u4f46\u662f\uff0c\u76f4\u63a5\u8fd0\u884cPython\u4ee3\u7801\u5374\u4e0d\u4f1a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5b89\u88c5\u597d\u4e86python3.6\u540e \uff0c\u6839\u636e\u5728\u7ebf\u6559\u7a0b\u4e0a\u7684\u6307\u5bfc\u5f00\u59cb\u5199test.py\u8fd9\u4e2a\u5c0f\u7a0b … \u7ee7\u7eed\u9605\u8bfb →<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[17],"tags":[29],"_links":{"self":[{"href":"https:\/\/9dream.me\/wp-json\/wp\/v2\/posts\/362"}],"collection":[{"href":"https:\/\/9dream.me\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/9dream.me\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/9dream.me\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/9dream.me\/wp-json\/wp\/v2\/comments?post=362"}],"version-history":[{"count":9,"href":"https:\/\/9dream.me\/wp-json\/wp\/v2\/posts\/362\/revisions"}],"predecessor-version":[{"id":373,"href":"https:\/\/9dream.me\/wp-json\/wp\/v2\/posts\/362\/revisions\/373"}],"wp:attachment":[{"href":"https:\/\/9dream.me\/wp-json\/wp\/v2\/media?parent=362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/9dream.me\/wp-json\/wp\/v2\/categories?post=362"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/9dream.me\/wp-json\/wp\/v2\/tags?post=362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}