{"id":24,"date":"2016-05-17T08:45:41","date_gmt":"2016-05-17T00:45:41","guid":{"rendered":"http:\/\/www.inhhh.com\/?p=24"},"modified":"2016-05-18T20:49:24","modified_gmt":"2016-05-18T12:49:24","slug":"windows7-%e6%90%ad%e5%bb%ba%e5%ae%8c%e7%be%8epython%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83-%e6%96%b9%e6%b3%95%e4%b8%80-eclipse%e5%92%8cpydev","status":"publish","type":"post","link":"http:\/\/www.inhhh.com\/blog\/?p=24","title":{"rendered":"Windows7 \u642d\u5efa\u5b8c\u7f8ePython\u5f00\u53d1\u73af\u5883 \u65b9\u6cd5\u4e00  Eclipse\u548cPyDev"},"content":{"rendered":"<p>Windows7 Eclipse\u548cPyDev\u642d\u5efa\u5b8c\u7f8ePython\u5f00\u53d1\u73af\u5883<\/p>\n<p>\u9996\u5148\u8bf4\u660e\uff0c\u4e3a\u4ec0\u4e48\u8981\u914d\u7f6e\u8fd9\u4e2a\u5462\uff0c\u56e0\u4e3a\u6709\u4e00\u4e9b\u63a5\u53e3\uff0c\u8981\u5fc5\u987b\u4f7f\u7528python\u7684\u3002\u4f8b\u5982 tushare\uff0c\u4e4b\u524d\u7528\u8fc7\u522b\u4eba\u7684\u7ea2\u8336\u63a5\u53e3\u5473\uff0c\u662fDLL\u6765\u7684\uff0c\u8fd9\u6b21\u5c31\u7528tushare, \u6211\u81ea\u5df1\u4e4b\u524d\u4e5f\u6ca1\u6709\u7528\u5230\uff0c\u5c31\u5f53\u8fb9\u5b66\u8fb9\u7528\u5427\u3002<\/p>\n<p><strong>\u76ee\u5f55<\/strong><\/p>\n<div id=\"centercontent\">\n<div id=\"post_detail\">\n<div class=\"post\">\n<div id=\"cnblogs_post_body\">\n<p>\u5b89\u88c5Python<br \/>\npython for eclipse\u63d2\u4ef6\u5b89\u88c5<br \/>\n\u914d\u7f6ePyDev\u63d2\u4ef6<br \/>\n\u6d4b\u8bd5<\/p>\n<p><strong>\u5b89\u88c5Python<\/strong><br \/>\n\u4ece\u7f51\u7ad9\u4e0a\u4e0b\u8f7d\u6700\u65b0\u7684\u7248\u672c\uff0c\u4ece<a href=\"http:\/\/python.org\/download\/\" target=\"_blank\">http:\/\/python.org\/download\/<\/a>\u4e0b\u8f7d\u3002\u5b89\u88c5\u8fc7\u7a0b\u4e0e\u5176\u4ed6Windows\u8f6f\u4ef6\u7c7b\u4f3c\u3002\u76ee\u524d\u7a33\u5b9a\u7248\u672c\u4e3aPython 2.7.6\u548cPython 3.3.4\u3002<\/p>\n<p><strong><span style=\"color: #ff0000;\">\u5728Windows\u547d\u4ee4\u884c\u4e2d\u4f7f\u7528Python<\/span><\/strong><br \/>\n\u5982\u679c\u4f60\u60f3\u8981\u4eceWindows\u547d\u4ee4\u884c\u8c03\u7528Python\uff0c\u90a3\u4e48\u9700\u8981\u5148\u8bbe\u7f6ePython\u73af\u5883\u53d8\u91cf\u3002<\/p>\n<p>\u5bf9\u4e8eWindows\uff0c\u70b9\u51fb\u63a7\u5236\u9762\u677f-&gt;\u7cfb\u7edf-&gt;\u9ad8\u7ea7-&gt;\u73af\u5883\u53d8\u91cf\u3002\u5728\u201c\u7cfb\u7edf\u53d8\u91cf\u201d\u8868\u5355\u4e2d\u70b9\u51fb\u53eb\u505aPATH\u7684\u53d8\u91cf\uff0c\u7136\u540e\u7f16\u8f91\u8fd9\u4e2a\u53d8\u91cf\uff0c\u628a;D:\\dev\\python2.7.6\u52a0\u5230\u5b83\u7684\u7ed3\u5c3e\u3002\u5f53\u7136\uff0c\u662fPython\u6240\u5728\u7684\u5b89\u88c5\u76ee\u5f55\u3002<\/p>\n<p>\u6d4b\u8bd5python\u73af\u5883\u53d8\u91cf\u662f\u5426\u8bbe\u7f6e\u6210\u529f<\/p>\n<div class=\"cnblogs_code\">\n<pre>C:\\Users\\jiqinlin&gt;python\nPython 2.7.6 (default, Nov 10 2013, 19:24:24) [MSC v.1500 64 bit (AMD64)] on win\n32\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n&gt;&gt;&gt;<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p><strong>python for eclipse\u63d2\u4ef6\u5b89\u88c5<\/strong><br \/>\n1\u3001\u4e0b\u8f7dpython for eclipse<\/p>\n<p>2\u3001\u89e3\u538bpydev\u63d2\u4ef6\u540e\uff0c\u4f1a\u53d1\u73b0\u6709features\u3001plugins\u4e24\u4e2a\u6587\u4ef6\u5939\uff0c\u7136\u540e\u628afeatures\u6587\u4ef6\u5939\u4e0b\u7684\u6587\u4ef6\u79fb\u5230D:\\dev\\eclipse\\features\u76ee\u5f55\u4e0b\uff0c\u628aplugins\u6587\u4ef6\u5939\u4e0b\u7684\u6587\u4ef6\u79fb\u5230D:\\dev\\eclipse\\plugins\u76ee\u5f55\u4e0b\u3002<br \/>\n\u6ce8\u610f\uff1aD:\\dev\\eclipse\\\u4e3aeclipse\u5b89\u88c5\u76ee\u5f55<\/p>\n<p>\u6ce8\u610f\uff1a\u8fd9\u91cc\u63d0\u4f9b\u53e6\u4e00\u4e2a\u65b9\u6cd5\uff1a<br \/>\n\u6253\u5f00eclipse \u83dc\u5355-&gt; Help -&gt; Install new software \uff0c\u6dfb\u52a0 \u8fd9\u4e2a\u7f51\u5740 http:\/\/pydev.sourceforge.net\/updates, \u4e4b\u540e\u9009\u62e9\u5b89\u88c5\u5373<\/p>\n<p>3\u3001\u91cd\u542feclipse\uff0c\u5728windows-&gt;preferences\u51fa\u73b0PyDev\u914d\u7f6e\u9879\uff0c\u8868\u793aPyDev\u63d2\u4ef6\u5b89\u88c5\u6210\u529f\u3002<\/p>\n<p><strong>\u914d\u7f6ePyDev\u63d2\u4ef6<\/strong><br \/>\n\u5728Window\u83dc\u5355\u4e2d\u9009Preference\uff0c<br \/>\n1\u3001windows-&gt;preferences-&gt;PyDev-&gt;Interpreter &#8211; Python\uff0cNew\u4e00\u4e2aPython\u89e3\u91ca\u5668\uff0c\u586b\u4e0a\u89e3\u91ca\u5668\u540d\u5b57\u548c\u8def\u5f84\uff0c\u8def\u5f84\u9009\u76f8\u5e94\u7684python.exe<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-28\" src=\"http:\/\/www.inhhh.com\/blog\/wp-content\/uploads\/2016\/05\/1.png\" alt=\"1\" width=\"568\" height=\"254\" srcset=\"http:\/\/www.inhhh.com\/blog\/wp-content\/uploads\/2016\/05\/1.png 568w, http:\/\/www.inhhh.com\/blog\/wp-content\/uploads\/2016\/05\/1-300x134.png 300w\" sizes=\"auto, (max-width: 568px) 100vw, 568px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-29\" src=\"http:\/\/www.inhhh.com\/blog\/wp-content\/uploads\/2016\/05\/2.png\" alt=\"2\" width=\"656\" height=\"528\" srcset=\"http:\/\/www.inhhh.com\/blog\/wp-content\/uploads\/2016\/05\/2.png 656w, http:\/\/www.inhhh.com\/blog\/wp-content\/uploads\/2016\/05\/2-300x241.png 300w\" sizes=\"auto, (max-width: 656px) 100vw, 656px\" \/><\/p>\n<p>\u4ee5\u4e0b\u51e0\u6b65Python 3.x\u5fc5\u9009\uff0cPython 2\u968f\u610f\u3002\u4e2a\u4eba\u6bd4\u8f83\u4e60\u60efUnicode\uff0c\u6240\u4ee5\u4e00\u6b21\u6027\u5728\u8fd9\u513f\u8bbe\u5b9a\u4e86\u3002<br \/>\n2\u3001General-&gt;Editors-&gt;Text Editors-&gt;Spelling\uff0cEncoding\u6539\u6210Other:UTF-8<\/p>\n<p>3\u3001General-&gt;Workspace\uff0cText file encoding\u6539\u6210Other:UTF-8<br \/>\n\u81f3\u6b64\uff0cPyDev\u7684\u914d\u7f6e\u5c31\u5b8c\u6210\u4e86\u3002<\/p>\n<p><strong>\u6d4b\u8bd5<\/strong><br \/>\nFile-&gt;New-&gt;Project\uff0c\u9009PyDev\u4e0b\u7684PyDev Project\uff0cGrammer\u548cInterpreter\u9009\u76f8\u5e94\u7684\u7248\u672c\uff0cFinish\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-30\" src=\"http:\/\/www.inhhh.com\/blog\/wp-content\/uploads\/2016\/05\/3.png\" alt=\"3\" width=\"520\" height=\"582\" srcset=\"http:\/\/www.inhhh.com\/blog\/wp-content\/uploads\/2016\/05\/3.png 520w, http:\/\/www.inhhh.com\/blog\/wp-content\/uploads\/2016\/05\/3-268x300.png 268w\" sizes=\"auto, (max-width: 520px) 100vw, 520px\" \/><\/p>\n<p>\u5728PyDev Package Explorer\u7684\u9879\u76ee\u4e0a\u53f3\u952e\uff0cNew-&gt;PyDev Module\uff0c\u968f\u4fbf\u5199\u4e2a\u540d\u5b57\uff0cFinish\u3002<br \/>\n\u7136\u540e\u968f\u4fbf\u5199\u51e0\u884c\u4ee3\u7801\uff0cRun\u5728\u5f39\u51fa\u7684\u5bf9\u8bdd\u6846\u4e2d\u9009\u62e9Python Run\uff0cOK<\/p>\n<\/div>\n<p>\u4ee3\u7801\u5982\u4e0b\uff1a<br \/>\ndef hw(n):<br \/>\nif n==1:<br \/>\nreturn 1<br \/>\nelse:<br \/>\nreturn 2*n<\/p>\n<p>print (hw(2));<\/p>\n<\/div>\n<p>\u6ce8\u610f\uff1apython 3.x\u540e\u7684 \u4e00\u5b9a\u8981\u8fd9\u6837\u5199\u00a0print (hw(2));<\/p>\n<p>python 2.x \u53ef\u4ee5 \u5199\u6210\u00a0print hw(2);<\/p>\n<div class=\"post\">\n<div id=\"cnblogs_post_body\">\n<p>\u5b89\u88c5\u76f8\u5173\u7684\u63d2\u4ef6<br \/>\n\u4e0b\u8f7d\u76f8\u5173\u63d2\u4ef6<br \/>\nhttp:\/\/www.inhhh.com\/download\/pip-8.1.2.tar.gz<\/p>\n<p>\u89e3\u538b\u7f29\u5230python \u5b89\u88c5\u76ee\u5f55\uff0c\u6bd4\u5982\u5b89\u88c5\u5728d:\\python34, \u5c31\u628a\u6587\u4ef6\u89e3\u538b\u7f29\u5230:\\python34\\pip-8.1.2.tar.gz<br \/>\n<script src=\"http:\/\/c.csdnimg.cn\/pubfooter\/js\/tracking.js\" type=\"text\/javascript\" charset=\"utf-8\"><\/script><script type=\"text\/javascript\">\/\/ <![CDATA[\nvar protocol = window.location.protocol;\n        document.write('<script type=\"text\/javascript\" src=\"' + protocol + '\/\/csdnimg.cn\/pubfooter\/js\/repoAddr2.js?v=' + Math.random() + '\"><\/' + 'script>');\n\/\/ ]]><\/script><script src=\"http:\/\/csdnimg.cn\/pubfooter\/js\/repoAddr2.js?v=0.629158095416166\" type=\"text\/javascript\"><\/script><script src=\"http:\/\/static.blog.csdn.net\/scripts\/jquery.js\" type=\"text\/javascript\"><\/script><script src=\"http:\/\/static.blog.csdn.net\/scripts\/jquery-version.js\" type=\"text\/javascript\"><\/script><script src=\"http:\/\/static.blog.csdn.net\/scripts\/ad.js?v=1.1\" type=\"text\/javascript\"><\/script><!--new top--><!--new top--><!-- ad begin --><script src=\"http:\/\/ads.csdn.net\/js\/tracking.js\" type=\"text\/javascript\"><\/script><!-- ad end--><script src=\"http:\/\/bdimg.share.baidu.com\/static\/api\/js\/share.js?v=89860593.js?cdnversion=406512\"><\/script><script src=\"\/\/csdnimg.cn\/rabbit\/tracking-ad\/main.js?75eacd6\" type=\"text\/javascript\" charset=\"utf-8\"><\/script><script src=\"http:\/\/bdimg.share.baidu.com\/static\/js\/logger.js?cdnversion=406514\"><\/script><\/p>\n<div id=\"container\">\n<div id=\"body\">\n<div id=\"main\">\n<div class=\"main\">\n<div id=\"article_details\" class=\"details\">\n<div id=\"article_content\" class=\"article_content\">\n<p><span style=\"line-height: 21.96px; font-family: Arial, Verdana, Geneva, 'Bitstream Vera Sans', Helvetica, sans-serif;\">\u4e0b\u8f7d setuptool<\/span><\/p>\n<p><span style=\"line-height: 21.96px; font-family: Arial, Verdana, Geneva, 'Bitstream Vera Sans', Helvetica, sans-serif;\">http:\/\/www.inhhh.com\/download\/ez_setup.py<br \/>\n\u5728Windows\u4e0bcmd\u4e2d\u627e\u5230setup.py\u6240\u5728\u7684\u76ee\u5f55\uff0c\u8f93\u5165python setup.py\u8fd0\u884c\u8be5\u6587\u4ef6\u3002\u7136\u540e\u4f1a\u5728python\u7684\u5b89\u88c5\u76ee\u5f55\u4e0b\u751f\u6210\u4e00\u4e2aScripts\u6587\u4ef6\u5939\uff0c\u91cc\u9762\u6709easy_install.exe\u3002\u53bb\u7cfb\u7edf\u7684\u73af\u5883\u53d8\u91cf\u4e2d\u4fee\u6539\u7528\u6237\u53d8\u91cf\uff0c\u5c06scripts\u7684\u6587\u4ef6\u5939\u8def\u5f84\u52a0\u5165path\u4e2d\u3002<\/span><\/p>\n<p>\u5b89\u88c5\u5b8c\u6210\u4e4b\u540e\uff0c\u5728cmd\u4e2d\u8f93\u5165easy_install-script.py &#8211;help\uff0c\u5982\u679c\u6709\u8f93\u51fa\uff0c\u5219\u8bf4\u660eeasy_install\u5b89\u88c5\u6210\u529f<\/p>\n<p>\u6253\u5f00cmd\u8f93\u5165easy_install &#8211;allow-hosts=lxml.de,*.python.org lxml==3.4.4\uff0c\u7136\u540e\u56de\u8f66\uff0c\u6ce8\u610f\u8fd9\u91cc\u76843.4.4\u662f\u7248\u672c\u53f7\u4f1a\u66f4\u65b0\uff0c\u8981\u4f9d\u636e\u5b98\u7f51\u7684\u7248\u672c\u53f7<\/p>\n<p>\u6ce8\u610f\uff1a\u5982\u679c\u4f60\u5df2\u7ecf\u88c5\u4e86vs2008,vs2010\u7b49\u7684\u5f00\u53d1\u5de5\u5177\uff0c\u4f1a\u5b89\u88c5\u5931\u8d25\uff0c\u53ef\u4ee5\u4f7f\u7528cmd \u547d\u4ee4\uff1apip install virtualenv \u4e0e set\u00a0STATICBUILD=true &amp;&amp; pip install lxml \u5b89\u88c5, \u53c8\u6216\u8005\uff0c\u5148\u4e0b\u8f7dwheel \u6587\u4ef6,\u518d\u5b89\u88c5wheel, \u4e4b\u540e\u5b89\u88c5lxml\u5c31\u53ef\u4ee5\u4e86<br \/>\n<a href=\"http:\/\/www.inhhh.com\/download\/lxml-3.4.4-cp34-none-win32.whl\">http:\/\/www.inhhh.com\/download\/lxml-3.4.4-cp34-none-win32.whl<\/a><br \/>\npip install wheel<br \/>\npip install lxml-3.6.0-cp35-cp35m-win32.whl<\/p>\n<p>lxml\u88c5\u597d\uff0c\u73b0\u5728\u5c31\u88c5\u00a0pandas<\/p>\n<p>\u76f4\u63a5\u5728\u547d\u4ee4\u884c\u8f93\u5165\u00a0pip install pandas<\/p>\n<div id=\"container\">\u5b89\u88c5 TUSHARE<\/div>\n<div>\u76f4\u63a5\u5728\u547d\u4ee4\u884c\u8f93\u5165pip install tushare<\/div>\n<\/div>\n<\/div>\n<div>\u6574\u4e2a\u8fc7\u7a0b\u5b89\u88c5\u6210\u529f<\/div>\n<div id=\"article_details\" class=\"details\">\n<div id=\"article_content\" class=\"article_content\">\n<div><\/div>\n<p>\u6253\u5f00Eclipse \uff0c<\/p>\n<p>\u8f93\u5165<\/p>\n<pre><span class=\"kn\">import<\/span> <span class=\"nn\">tushare<\/span>\n\n<span class=\"k\">print<\/span><span class=\"p\">(<\/span><span class=\"n\">tushare<\/span><span class=\"o\">.<\/span><span class=\"n\">__version__<\/span><span class=\"p\">)\nprint(ts.get_hist_data('600848')) \n<\/span><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>\u8fd0\u884c\u901a\u8fc7\uff0c\u54c8\u54c8\uff0c\u8fd9\u6b21\u771f\u7684\u7528\u4e0apython\u4e86\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-43\" src=\"http:\/\/www.inhhh.com\/blog\/wp-content\/uploads\/2016\/05\/c3.jpg\" alt=\"c3\" width=\"1280\" height=\"984\" srcset=\"http:\/\/www.inhhh.com\/blog\/wp-content\/uploads\/2016\/05\/c3.jpg 1280w, http:\/\/www.inhhh.com\/blog\/wp-content\/uploads\/2016\/05\/c3-300x231.jpg 300w, http:\/\/www.inhhh.com\/blog\/wp-content\/uploads\/2016\/05\/c3-768x590.jpg 768w, http:\/\/www.inhhh.com\/blog\/wp-content\/uploads\/2016\/05\/c3-1024x787.jpg 1024w, http:\/\/www.inhhh.com\/blog\/wp-content\/uploads\/2016\/05\/c3-1200x923.jpg 1200w\" sizes=\"auto, (max-width: 1280px) 100vw, 1280px\" \/><\/p>\n<p>.\u5b8c.<\/p>\n<div class=\"cnblogs_code\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Windows7 Eclipse\u548cPyDev\u642d\u5efa\u5b8c\u7f8ePython\u5f00\u53d1\u73af\u5883 \u9996\u5148\u8bf4\u660e\uff0c\u4e3a\u4ec0\u4e48\u8981\u914d\u7f6e\u8fd9\u4e2a\u5462\uff0c\u56e0\u4e3a\u6709<\/p>\n<div class=\"more-link\">\n\t\t\t\t <a href=\"http:\/\/www.inhhh.com\/blog\/?p=24\" class=\"link-btn theme-btn\"><span>Read More <\/span> <i class=\"fa fa-caret-right\"><\/i><\/a>\n\t\t\t<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[12,14,11,16,15,13],"class_list":["post-24","post","type-post","status-publish","format-standard","hentry","category-it","tag-lxml","tag-pandas","tag-python-eclipse","tag-wheel","tag-15","tag-13"],"_links":{"self":[{"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/24","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=24"}],"version-history":[{"count":10,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/24\/revisions"}],"predecessor-version":[{"id":44,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/24\/revisions\/44"}],"wp:attachment":[{"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=24"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=24"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=24"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}