{"id":559,"date":"2017-02-18T19:35:19","date_gmt":"2017-02-18T11:35:19","guid":{"rendered":"http:\/\/192.168.1.20\/?p=559"},"modified":"2017-10-23T11:57:21","modified_gmt":"2017-10-23T03:57:21","slug":"{d4daabd1ba368d9860c36387ddb72bbda14f8f9559d69d60a952800885260c03}e5{d4daabd1ba368d9860c36387ddb72bbda14f8f9559d69d60a952800885260c03}85{47dd41ec6bdcbd9a214c783a3735392b82ea6d1d918378c5a53e0640702d813","status":"publish","type":"post","link":"http:\/\/alextop.top\/?p=559","title":{"rendered":"\u5173\u4e8epython\u65e0\u6cd5\u663e\u793a\u4e2d\u6587\u7684\u95ee\u9898\uff1aSyntaxError: Non-ASCII character &#8216;\\xe4&#8217; in file test.py on line 3, but no encoding declared\u3002"},"content":{"rendered":"<p><span style=\"color:black; font-size:10pt\"><span style=\"font-family:\u5b8b\u4f53\">\u60f3\u5728<\/span><span style=\"font-family:Verdana\">python<\/span><span style=\"font-family:\u5b8b\u4f53\">\u4ee3\u7801\u4e2d\u8f93\u51fa\u6c49\u5b57\u3002\u4f46\u662f\u8001\u662f\u51fa\u73b0<\/span><span style=\"color:red\"><span style=\"font-family:Verdana\">SyntaxError: Non-ASCII character &#8216;\\xe4&#8217; in file <span style=\"color:lime\">test.py<span style=\"color:red\"> on<span style=\"color:lime\"> line <span style=\"color:red\">, but no encoding declared<\/span><\/span><\/span><\/span><\/span><span style=\"font-family:\u5b8b\u4f53\">\u3002<\/span><span style=\"font-family:Verdana\"><br \/>\n\t\t\t\t\t<span style=\"color:black\">(test.py<\/span><\/span><span style=\"font-family:\u5b8b\u4f53\">\u662f\u6211\u81ea\u5df1\u7684\u6587\u4ef6\uff0c\u63d0\u793a\u9519\u8bef\u51fa\u73b0\u5728\u7b2c<\/span><span style=\"color:black\"><span style=\"font-family:Verdana\">4<\/span><span style=\"font-family:\u5b8b\u4f53\">\u884c\uff0c<\/span><span style=\"font-family:Verdana\"><br \/>\n\t\t\t\t\t<\/span><span style=\"font-family:\u5b8b\u4f53\">\u4f60\u7684\u6587\u4ef6\u4e5f\u4f1a\u5f97\u5230\u76f8\u5e94\u7684\u63d0\u793a<\/span><span style=\"font-family:Verdana\">)<\/span><span style=\"font-family:\u5b8b\u4f53\">\u3002<\/span><span style=\"font-family:Verdana\">\u00a0<\/span><span style=\"font-family:\u5b8b\u4f53\">\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b<\/span><span style=\"font-family:Verdana\">test.py<\/span><span style=\"font-family:\u5b8b\u4f53\">\u4ee3\u7801\u5982\u4e0b\uff1a<\/span><span style=\"font-family:Verdana\"><br \/>\n\t\t\t\t\t<\/span><\/span><\/span><\/span><\/p>\n<p style=\"background: whitesmoke\"><span style=\"color:teal; font-family:Times New Roman; font-size:12pt\">1<span style=\"color:black\"><br \/>\n\t\t\t\t<span style=\"color:green\">#!\/usr\/bin\/python<span style=\"color:black\"><br \/>\n\t\t\t\t\t<\/span><\/span><\/span><\/span><\/p>\n<p style=\"background: whitesmoke\"><span style=\"color:teal; font-family:Times New Roman; font-size:12pt\">2<span style=\"color:black\"><br \/>\n\t\t\t<\/span><\/span><\/p>\n<p style=\"background: whitesmoke\"><span style=\"color:teal; font-size:12pt\"><span style=\"font-family:Times New Roman\">3<span style=\"color:black\"><br \/>\n\t\t\t\t\t<span style=\"color:blue\">print<span style=\"color:black\"><br \/>\n\t\t\t\t\t\t\t<span style=\"color:maroon\">&#8220;<\/span><\/span><\/span><\/span><\/span><span style=\"font-family:\u5b8b\u4f53\">\u4f60\u597d\u5417<\/span><span style=\"color:maroon; font-family:Times New Roman\">&#8220;<span style=\"color:black\"><br \/>\n\t\t\t\t<\/span><\/span><\/span><\/p>\n<p><span style=\"color:black; font-size:10pt\"><span style=\"font-family:\u5b8b\u4f53\">\u3000\u3000\u5728\u7ec8\u7aef\u4e0b\u6267\u884c<\/span><span style=\"font-family:Verdana\">python test.py<\/span><span style=\"font-family:\u5b8b\u4f53\">\u6307\u4ee4\u4e4b\u540e\uff0c<\/span><span style=\"font-family:Verdana\"><br \/>\n\t\t\t<\/span><\/span><\/p>\n<p><span style=\"color:black\"><span style=\"font-family:\u5b8b\u4f53; font-size:10pt\">\u3000\u3000<\/span><span style=\"font-family:Verdana\"><span style=\"font-size:10pt\">File &#8220;test.py&#8221;, line 3<\/span><span style=\"font-size:10pt\"><br \/>\n\t\t\t\t<\/span><\/span><\/span><\/p>\n<p><span style=\"color:black; font-size:10pt\"><span style=\"font-family:\u5b8b\u4f53\">\u3000\u3000<\/span><span style=\"font-family:Verdana\">SyntaxError: Non-ASCII character &#8216;\\xe4&#8217; in file test.py on line 3, but no encoding declared; see http:\/\/www.python.org\/peps\/pep-0263.html for details<br \/>\n<\/span><\/span><\/p>\n<p><span style=\"color:black; font-size:10pt\"><em><span style=\"font-family:\u5b8b\u4f53\">\u3000\u3000\u8fd9\u662f<\/span><span style=\"font-family:Verdana\">python<\/span><span style=\"font-family:\u5b8b\u4f53\">\u7f16\u7801\u7684\u95ee\u9898\uff0c<\/span><span style=\"font-family:Verdana\"> python<\/span><span style=\"font-family:\u5b8b\u4f53\">\u4e2d\u9ed8\u8ba4\u7684\u7f16\u7801\u683c\u5f0f\u662f<\/span><span style=\"font-family:Verdana\">ASCII<\/span><span style=\"font-family:\u5b8b\u4f53\">\u683c\u5f0f\uff0c<\/span><span style=\"font-family:Verdana\"><br \/>\n\t\t\t\t<\/span><span style=\"font-family:\u5b8b\u4f53\">\u6240\u4ee5\u5728\u6ca1\u4fee\u6539\u7f16\u7801\u683c\u5f0f\u65f6\u65e0\u6cd5\u6b63\u786e\u6253\u5370\u6c49\u5b57\u3002<\/span><\/em><span style=\"font-family:Verdana\"><br \/>\n\t\t\t<\/span><\/span><\/p>\n<p><span style=\"color:black; font-size:10pt\"><em><span style=\"font-family:\u5b8b\u4f53\">\u3000\u3000\u89e3\u51b3\u529e\u6cd5\uff1a<\/span><span style=\"font-family:Verdana\"> \u00a0<\/span><span style=\"font-family:\u5b8b\u4f53\">\u5728\u4ee5\u540e\u7684\u6bcf\u4e00\u4e2a\u9700\u8981\u663e\u793a\u6c49\u5b57\u7684<\/span><span style=\"font-family:Verdana\">python<\/span><span style=\"font-family:\u5b8b\u4f53\">\u6587\u4ef6\u4e2d\uff0c<\/span><span style=\"font-family:Verdana\"><br \/>\n\t\t\t\t<\/span><span style=\"font-family:\u5b8b\u4f53\">\u53ef\u4ee5\u91c7\u7528\u5982\u4e0b\u65b9\u6cd5\u5728<\/span><span style=\"font-family:Verdana\"><br \/>\n\t\t\t\t\t<span style=\"color:#99cc00\">#!\/usr\/bin\/python<\/span><\/span><\/em><span style=\"color:black\"><em><span style=\"font-family:\u5b8b\u4f53\">\u7684\u4e0b\u4e00\u884c\u52a0\u4e0a\u4e00\u53e5\u8bdd\u6765\u5b9a\u4e49\u7f16\u7801\u683c\u5f0f\uff0c<\/span><span style=\"font-family:Verdana\"><br \/>\n\t\t\t\t\t<\/span><span style=\"font-family:\u5b8b\u4f53\">\u6211\u4ee5<\/span><span style=\"font-family:Verdana\">utf-8<\/span><span style=\"font-family:\u5b8b\u4f53\">\u7f16\u7801\u4e3a\u4f8b\u3002<\/span><\/em><span style=\"font-family:Verdana\"><br \/>\n\t\t\t\t<\/span><\/span><\/span><\/p>\n<p><span style=\"color:black; font-size:10pt\"><span style=\"font-family:\u5b8b\u4f53\"><em>\u3000\u3000\u7b2c\u4e00\u79cd\uff1a<\/em><\/span><span style=\"font-family:Verdana\"><br \/>\n\t\t\t<\/span><\/span><\/p>\n<p style=\"background: whitesmoke\"><span style=\"color:teal; font-family:Times New Roman; font-size:12pt\">1<span style=\"color:black\"><br \/>\n\t\t\t\t<span style=\"color:green\">#!\/usr\/bin\/python<span style=\"color:black\"><br \/>\n\t\t\t\t\t<\/span><\/span><\/span><\/span><\/p>\n<p style=\"background: whitesmoke\"><span style=\"color:teal; font-family:Times New Roman; font-size:12pt\">2<span style=\"color:black\"><br \/>\n\t\t\t\t<span style=\"color:green\">#coding:utf-8<span style=\"color:black\"><br \/>\n\t\t\t\t\t<\/span><\/span><\/span><\/span><\/p>\n<p style=\"background: whitesmoke\"><span style=\"color:teal; font-size:12pt\"><span style=\"font-family:Times New Roman\">3<span style=\"color:black\"><br \/>\n\t\t\t\t\t<span style=\"color:blue\">print<span style=\"color:black\"><br \/>\n\t\t\t\t\t\t\t<span style=\"color:maroon\">&#8220;<\/span><\/span><\/span><\/span><\/span><span style=\"font-family:\u5b8b\u4f53\">\u4f60\u597d\u5417<\/span><span style=\"color:maroon; font-family:Times New Roman\">&#8220;<span style=\"color:black\"><br \/>\n\t\t\t\t<\/span><\/span><\/span><\/p>\n<p><span style=\"color:black; font-size:10pt\"><span style=\"font-family:\u5b8b\u4f53\">\u3000\u3000\u7b2c\u4e8c\u79cd\uff1a<\/span><span style=\"font-family:Verdana\"><br \/>\n\t\t\t<\/span><\/span><\/p>\n<p style=\"background: whitesmoke\"><span style=\"color:teal; font-family:Times New Roman; font-size:12pt\">1<span style=\"color:black\"><br \/>\n\t\t\t\t<span style=\"color:green\">#!\/usr\/bin\/python<span style=\"color:black\"><br \/>\n\t\t\t\t\t<\/span><\/span><\/span><\/span><\/p>\n<p style=\"background: whitesmoke\"><span style=\"color:teal; font-family:Times New Roman; font-size:12pt\">2<span style=\"color:black\"><br \/>\n\t\t\t\t<span style=\"color:green\">#-*-coding:utf-8 -*-<span style=\"color:black\"><br \/>\n\t\t\t\t\t<\/span><\/span><\/span><\/span><\/p>\n<p style=\"background: whitesmoke\"><span style=\"color:teal; font-size:12pt\"><span style=\"font-family:Times New Roman\">3<span style=\"color:black\"><br \/>\n\t\t\t\t\t<span style=\"color:blue\">print<span style=\"color:black\"><br \/>\n\t\t\t\t\t\t\t<span style=\"color:maroon\">&#8220;<\/span><\/span><\/span><\/span><\/span><span style=\"font-family:\u5b8b\u4f53\">\u4f60\u597d\u5417<\/span><span style=\"color:maroon; font-family:Times New Roman\">&#8220;<span style=\"color:black\"><br \/>\n\t\t\t\t<\/span><\/span><\/span><\/p>\n<p><span style=\"color:black; font-size:10pt\"><span style=\"font-family:\u5b8b\u4f53\">\u3000\u3000\u7b2c\u4e09\u79cd\uff1a<\/span><span style=\"font-family:Verdana\"><br \/>\n\t\t\t<\/span><\/span><\/p>\n<p style=\"background: whitesmoke\"><span style=\"color:teal; font-family:Times New Roman; font-size:12pt\">1<span style=\"color:black\"><br \/>\n\t\t\t\t<span style=\"color:green\">#!\/usr\/bin\/python<span style=\"color:black\"><br \/>\n\t\t\t\t\t<\/span><\/span><\/span><\/span><\/p>\n<p style=\"background: whitesmoke\"><span style=\"color:teal; font-family:Times New Roman; font-size:12pt\">2<span style=\"color:black\"><br \/>\n\t\t\t\t<span style=\"color:green\">#vim: set fileencoding:utf-8<span style=\"color:black\"><br \/>\n\t\t\t\t\t<\/span><\/span><\/span><\/span><\/p>\n<p style=\"background: whitesmoke\"><span style=\"color:teal; font-size:12pt\"><span style=\"font-family:Times New Roman\">3<span style=\"color:black\"><br \/>\n\t\t\t\t\t<span style=\"color:blue\">print<span style=\"color:black\"><br \/>\n\t\t\t\t\t\t\t<span style=\"color:maroon\">&#8220;<\/span><\/span><\/span><\/span><\/span><span style=\"font-family:\u5b8b\u4f53\">\u4f60\u597d\u5417<\/span><span style=\"color:maroon; font-family:Times New Roman\">&#8220;<span style=\"color:black\"><br \/>\n\t\t\t\t<\/span><\/span><\/span><\/p>\n<p><span style=\"color:black\"><span style=\"font-family:\u5b8b\u4f53\"><span style=\"font-size:10pt\">\u3000\u3000<span style=\"color:#cc99ff\"><strong>\uff0a\uff0a\uff0a<\/strong><\/span><\/span><span style=\"font-size:12pt\"><strong>\u7279\u522b\u6ce8\u610f\uff1a\u5b9a\u4e49\u7f16\u7801\u683c\u5f0f\u7684\u8fd9\u4e00\u884c\u4ee3\u7801\u5fc5\u987b\u653e\u5728\u7b2c\u4e00\u884c\u6216\u8005\u7b2c\u4e8c\u884c\uff0c<\/strong><\/span><\/span><span style=\"color:#cc99ff\"><span style=\"font-size:12pt\"><strong><span style=\"font-family:Verdana\"><br \/>\n\t\t\t\t\t\t<\/span><span style=\"font-family:\u5b8b\u4f53\">\u4e00\u822c\u5982\u679c\u7b2c\u4e00\u884c\u662f\u63d0\u793a<\/span><span style=\"font-family:Verdana\">python<\/span><span style=\"font-family:\u5b8b\u4f53\">\u4f4d\u7f6e\u7684\u4ee3\u7801\uff0c<\/span><span style=\"font-family:Verdana\"><br \/>\n\t\t\t\t\t\t<\/span><span style=\"font-family:\u5b8b\u4f53\">\u90a3\u4e48\u5b9a\u4e49\u7f16\u7801\u683c\u5f0f\u7684\u8fd9\u4e00\u884c\u5c31\u5fc5\u987b\u653e\u5728\u7b2c\u4e8c\u884c\uff0c\u5426\u5219\u4f9d\u7136\u4f1a\u63d0\u793a\u9519\u8bef\u3002<\/span><\/strong><\/span><span style=\"color:black; font-family:Verdana; font-size:10pt\"><br \/>\n\t\t\t\t<\/span><\/span><\/span><\/p>\n<p><span style=\"color:#cc99ff\"><span style=\"font-family:\u5b8b\u4f53; font-size:12pt\">\u3000\u3000\u60f3\u4e86\u89e3\u591a\u7ec6\u8282\u8bf7\u9605\u8bfb\uff1a<a href=\"http:\/\/www.python.org\/dev\/peps\/pep-0263\/\"\/><\/span><span style=\"color:#525252; font-family:Verdana; font-size:10pt\">http:\/\/www.python.org\/dev\/peps\/pep-0263\/<\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u60f3\u5728python\u4ee3\u7801\u4e2d\u8f93\u51fa\u6c49\u5b57&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24,10],"tags":[],"class_list":["post-559","post","type-post","status-publish","format-standard","hentry","category-python","category-jishu"],"_links":{"self":[{"href":"http:\/\/alextop.top\/index.php?rest_route=\/wp\/v2\/posts\/559"}],"collection":[{"href":"http:\/\/alextop.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/alextop.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/alextop.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/alextop.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=559"}],"version-history":[{"count":1,"href":"http:\/\/alextop.top\/index.php?rest_route=\/wp\/v2\/posts\/559\/revisions"}],"predecessor-version":[{"id":999,"href":"http:\/\/alextop.top\/index.php?rest_route=\/wp\/v2\/posts\/559\/revisions\/999"}],"wp:attachment":[{"href":"http:\/\/alextop.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=559"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/alextop.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=559"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/alextop.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=559"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}