{"id":343189,"date":"2021-02-16T00:08:11","date_gmt":"2021-02-15T16:08:11","guid":{"rendered":"http:\/\/4563.org\/?p=343189"},"modified":"2021-02-16T00:08:11","modified_gmt":"2021-02-15T16:08:11","slug":"pycharm-%e9%87%8c%ef%bc%8c%e8%bf%99%e4%b8%aa%e8%b7%b3%e8%bd%ac%e8%a1%8c%e7%9a%84%e5%ae%9a%e4%bd%8d%e6%93%8d%e4%bd%9c%ef%bc%8c%e7%83%ad%e9%94%ae%e5%a6%82%e4%bd%95%e6%93%8d%e4%bd%9c%e4%bc%9a%e6%af%94","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=343189","title":{"rendered":"PyCharm \u91cc\uff0c\u8fd9\u4e2a\u8df3\u8f6c\u884c\u7684\u5b9a\u4f4d\u64cd\u4f5c\uff0c\u70ed\u952e\u5982\u4f55\u64cd\u4f5c\u4f1a\u6bd4\u8f83\u723d\uff1f(\u5728\u5f53\u524d\u6587\u4ef6\u8df3\u5230\uff0c\u51fd\u6570\u662f\u4ece\u4ec0\u4e48\u6587\u4ef6 import \u7684\u54ea\u4e00\u884c\u3002\u800c\u4e0d\u662f\u76f4\u63a5\u8df3\u5230\u90a3\u4e2a\u51fd\u6570\u7684\u5b8c\u6574\u5b9e\u73b0\u7684\u5730\u65b9\uff09\uff0c\u6216\u8005\u4f60\u4eec\u662f\u600e\u4e48\u5feb\u6377\u64cd\u4f5c\u7684\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  PyCharm \u91cc\uff0c\u8fd9\u4e2a\u8df3\u8f6c\u884c\u7684\u5b9a\u4f4d\u64cd\u4f5c\uff0c\u70ed\u952e\u5982\u4f55\u64cd\u4f5c\u4f1a\u6bd4\u8f83\u723d\uff1f(\u5728\u5f53\u524d\u6587\u4ef6\u8df3\u5230\uff0c\u51fd\u6570\u662f\u4ece\u4ec0\u4e48\u6587\u4ef6 import \u7684\u54ea\u4e00\u884c\u3002\u800c\u4e0d\u662f\u76f4\u63a5\u8df3\u5230\u90a3\u4e2a\u51fd\u6570\u7684\u5b8c\u6574\u5b9e\u73b0\u7684\u5730\u65b9\uff09\uff0c\u6216\u8005\u4f60\u4eec\u662f\u600e\u4e48\u5feb\u6377\u64cd\u4f5c\u7684\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : uti6770werty <\/span>  <span><i><\/i> 1<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u8b6c\u5982\uff1a <\/p>\n<pre><code>#one.py 16  from Fun.AnalyFunc import nowTimeForStr  # \u5728 one.py \u7684\u7b2c 16 \u884c\uff0c\u58f0\u660e\u5bfc\u5165 nowTimeForStr \u51fd\u6570  #one.py 3468 FunnyTimeStr = nowTimeForStr(True,False,True,False)  #\u5728 one.py \u7684\u7b2c 3468 \u884c\uff0c\u4f7f\u7528\u4e86 nowTimeForStr <\/code><\/pre>\n<p>\u73b0\u5728\u5149\u6807\u79fb\u52a8\u5230 3468 \u884c\u7684 nowTimeForStr \u4e0a\uff0c\u6309\u4e0b Ctrl+B\uff0c\u7126\u70b9\u76f4\u63a5\u8df3\u53bb\u4e86 Fun\/AnalyFunc.py \u91cc\u9762 def nowTimeForStr() \uff0c\u4e8b\u5b9e\u4e0a\u6211\u53ea\u662f\u60f3\u53bb\u5230 16 \u884c\uff0c\u5728\u6b64\u6587\u4ef6\u5185\u7684\u5bfc\u5165\u58f0\u660e\uff0c\u8fdb\u884c\u4fee\u6539\u800c\u5df2\u3002\u3002\u3002<br \/> \u5927\u81f4\u4e0a\u6478\u4e86\u4e00\u4e0b PyCharm \u7684\u70ed\u952e\uff0c\u4f3c\u4e4e\u4e0d\u5e26\u8fd9\u4e2a\u64cd\u4f5c\uff1f\uff08\u53ef\u80fd\u4e0d\u591f\u4ed4\u7ec6\uff0c\u6073\u8bf7\u63d0\u793a\u4e00\u4e0b\uff0c\u8c22\u8c22\uff01\uff09 <\/p>\n<p>\u5982\u679c\u7528 Ctrl +F\uff0c\u524d\u9762 20 \u591a\u4e2a nowTimeForStr \u8c03\u7528\uff0c\u90a3\u4e48\u624b\u4e5f\u591f\u7d2f\u7684\uff0c\u4e5f\u8d39\u65f6\u95f4\uff0cCtrl+Home,\u4ece\u5f00\u59cb\u518d\u627e\uff0c\u5f88\u5bb9\u6613\u6643\u4e24\u4e0b\u5c31\u56de\u4e0d\u5230\u5f00\u59cb\u7684\u5730\u65b9\u4e86\u3002\u3002\u3002\u3002<br \/> \u8c22\u8c22\u5927\u5bb6\u89e3\u7b54\u3002<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>11<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5283562\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xlui <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u9898\u5916\u8bdd\uff0c\u4f60\u53ea\u5e0c\u671b\u4fee\u6539 import \u90e8\u5206\uff0c\u90a3\u5728 Ctrl+F \u641c\u7d22\u4e4b\u540e\u76f4\u63a5\u8f6c\u5230\u6587\u4ef6\u5934\u5c31\u884c\u4e86\u5427\uff0c\u641c\u7d22\u7684\u5185\u5bb9\u4f1a\u9ad8\u4eae\u7684\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5283563\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : mcfog <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8bd5\u8bd5\u76f4\u63a5\u5728 3468 \u7126\u70b9\u4e0a shift f6 \uff08 refactor \uff09 rename \u5e94\u8be5\u5c31\u4f1a\u8fde\u7740 import \u4e00\u8d77\u4fee\u6539\uff0c\u5982\u679c\u6548\u679c\u4e0d\u5bf9\u8bd5\u7740\u641c\u52a8\u4f5c\u641c\u4e00\u4e0b rename import alias \u4e4b\u7c7b\u7684\u5173\u952e\u8bcd                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5283564\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : sunwei0325 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u7528\u7684\u662f ideavim \u7684 # \u548c *                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5283565\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : matrix67 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u4e2a\u660e\u663e ide \u8df3\u7684\u5730\u65b9\u65e5\u5e38\u770b\u4ee3\u7801\uff0c\u4fee\u6539\u6982\u7387\u66f4\u5927\u5440<\/p>\n<p>\u4f60\u8981\u8df3\u7684\u90a3\u4e2a\u5934\u5bfc\u5165\u90e8\u5206\u5f88\u591a\u4eba\u90fd\u662f\u628a\u5b83\u6298\u53e0\u8d77\u6765\uff0c\u4e3a\u5565\u4f1a\u6709\u4fee\u6539\u7684\u9700\u6c42\u3002\u4e00\u822c\u589e\u5220\u8fd9\u90e8\u5206\u7684 metadata \u90fd\u662f\u8ba9 ide \u53bb\u5b8c\u6210\u7684\uff0c\u6240\u4ee5\u6211\u611f\u89c9\u4f60\u8fd9\u4e2a\u662f\u4e2a x-y problem\uff0c\u4f60\u539f\u59cb\u7684\u9700\u6c42\u662f\u5565\uff1f                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5283566\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : uti6770werty <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @xlui \u4f3c\u4e4e\u6211\u6ca1\u80fd\u76f4\u63a5\u7406\u89e3\u610f\u601d\uff0cCtrl+F \u80fd\u76f4\u63a5\u8f6c\uff1f \u8c8c\u4f3c\u5728\u8fc7\u6ee4\u5668\u91cc\u4e5f\u4e0d\u80fd\u9009\u62e9\u6587\u4ef6\u5934\u90e8\u5206\uff1f py \u6587\u4ef6\u884c\u6570\u8fc7\u591a\uff0c\u9ad8\u4eae\u4e0d\u7ba1\u7528\u3002<\/p>\n<p>@mcfog \u8c22\u8c22\uff0c\u6700\u7ec8\u9700\u6c42\u5176\u5b9e\u4e5f\u4e0d\u662f\u76f4\u63a5\u6539\uff0c\u540e\u9762\u7ec6\u8bf4<\/p>\n<p>@sunwei0325 \u3002\u3002\u3002\u3002\u3002\u3002<\/p>\n<p>@matrix67 \u662f\u7684\uff0c\u6bcf\u4e2a\u4eba\u90fd\u6709\u4e60\u60ef\u4e0d\u540c\u5427\uff0c\u6211\u6709\u4e2a\u5f88\u4e0d\u5de5\u7a0b\u7684\u4e60\u60ef\uff0c\u6709\u4e9b\u51fd\u6570\u6211\u4e0d\u4f1a\u76f4\u63a5\u5728\u539f\u6587\u4ef6\u4e0a\u6539\uff0c\u5c31\u539f\u5730\u526f\u672c\u4e86\u4e00\u4e2a\u65b0\u6587\u4ef6\u540e\u6539\u7248\u672c\u540d\uff0c\u7136\u540e\u5728\u6587\u4ef6\u5934\u91cc\u9762\u53bb import \u6211\u52a8\u8fc7\u51fd\u6570\u7684\u90a3\u4e2a\u6587\u4ef6\u6765\u5bfc\u5165\u526f\u672c\u52a8\u8fc7\u7684\u51fd\u6570\uff0c\u8fd9\u6837\u5bf9\u81ea\u5df1\u7684\u601d\u8def\u6bd4\u8f83\u6e05\u6670\uff0c\u6709\u65f6\u5019\u8981\u5207\u6362\u6765\u56de\u5bf9\u6bd4\uff0c\u4e5f\u5c31\u6709\u4e86\u8fd9\u4e2a\u8981\u8df3\u53bb 16\/17 \u884c\u505a\u6ce8\u91ca\u7684\u52a8\u4f5c\u3002\u3002\u3002<br \/>\u80fd\u8bb0\u4f4f\u884c\u6570\uff0c\u6709\u65f6\u5019\u6211\u5c31\u76f4\u63a5 CTRL+G \u8df3\u8fc7\u53bb\uff0c\u6709\u65f6\u5019\u601d\u8def\u4e0d\u6e05\u6670\uff0c\u8fd8\u771f\u8bb0\u4e0d\u4f4f\u884c\u6570\uff0c\u8df3\u5f97\u4e0d\u5bf9\u5c31\u6d6a\u8d39\u51e0\u5341\u79d2\u65f6\u95f4\u53bb\u7ffb\u5c4f\u627e\u51fd\u6570\u4e86\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5283567\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : matrix67 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @uti6770werty #5 \u4f60\u8fd9\u4e48\u8bf4\u6211\u5c31\u61c2\u4f60\u7684\u9700\u6c42\u4e86\u3002<\/p>\n<p>\u4f60\u7684\u9700\u6c42\u5e94\u8be5\u662f\uff0cdebug \u6216\u8005\u4fee\u6539\u51fd\u6570\u7684\u65f6\u5019\uff0c\u4f60\u559c\u6b22 copy \u539f\u6587\u4ef6\u5230\u4e00\u4e2a\u526f\u672c\uff0c\u4e3a\u4e86\u5bf9\u6bd4\u4e24\u4e2a\u51fd\u6570\u4e0d\u540c\u7684\u6548\u679c\uff0c\u9700\u8981\u6539 import \u6587\u4ef6\u540d\u3002 \u4e0d\u8fc7\u96be\u9053\u4f60\u662f\u624b\u5de5\u53bb\u6539 import \uff1f \u5982\u679c\u4f60\u7684\u51fd\u6570\u662f\u88ab\u51e0\u5341\u4e2a\u6587\u4ef6\u5f15\u7528\u548b\u6539\u561e\uff1f<\/p>\n<p>\u4f60\u8fd9\u4e2a\u9700\u6c42\u6211\u53ef\u4ee5\u8bb2\u4e0b\u6211\u662f\u548b\u6539\u7684\uff1a<\/p>\n<p>1. \u6bd4\u5982\u6709\u4e2a\u51fd\u6570 func <br \/>2. \u6211\u4f1a\u628a\u6574\u4e2a\u51fd\u6570\uff0c\u90fd\u5728\u539f\u6587\u4ef6\u91cc\u9762 copy \u4e00\u4efd func_bak<br \/>3. \u4e4b\u540e\u5c31\u5728 func \u91cc\u9762\u6539\u51fd\u6570\uff0c\u8fd0\u884c\uff0c\u6d4b\u8bd5\u7b49<br \/>4. \u4e3a\u4e86\u8fdb\u884c\u548c\u539f\u51fd\u6570\uff08 func_bak \uff09\u7684\u5bf9\u6bd4\uff0c\u5728 func \u4e0a\u9762 shift+f6 rename \u6210 func_temp, \u8fd9\u65f6 ide \u4f1a\u628a\u6240\u6709\u5f15\u7528\u8fd9\u4e2a\u51fd\u6570\u7684\u5730\u65b9\u4e5f\u6539\u6210 func_temp<br \/>5. \u628a func_temp \u51fd\u6570\u540d\u6539\u6210 func\uff0c\u628a func_bak \u6539\u6210 func_temp. \u6240\u6709\u8c03\u7528\u51fd\u6570\u90fd\u4f1a\u6307\u5411\u6539\u4e4b\u524d\u7684\u51fd\u6570<br \/>6. \u6240\u6709\u6b65\u9aa4\u90fd\u4e0d\u9700\u8981\u52a8 import\uff0c\u5355\u5143\u6d4b\u8bd5\u7b49\u4e5f\u4e0d\u7528\u52a8\uff0c\u8be5\u8dd1\u8fc7\u7684\u90fd\u80fd\u8dd1\u8fc7                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5283568\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : answerhuang <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             1. \u9009\u4e2d nowTimeForStr<br \/>2. Select All Occurrences ( control + command + G )<br \/>3. Esc                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5283569\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Takamine <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             gg \u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5283570\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : qazwsxkevin <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @matrix67 \u597d\u6280\u80fd\uff0c\u5b66\u4e60\u4e86\uff0c\u4ee5\u540e\u7edd\u5bf9\u80fd\u7528\u4e0a\uff0c\u8c22\u8c22\uff01<\/p>\n<p>@answerhuang \u8fd9\u4e2a\u5c31\u662f\u539f\u672c\u60f3\u8981\u7684\u64cd\u4f5c\uff0c\u611f\u8c22\uff01\uff01\uff01                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5283571\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : sampeng <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             vim \u6a21\u5f0f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5283572\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : BingoXuan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u8bf4\u7684\u5c31\u662f monkeypatch\uff0c\u5bfc\u5165\u540e\u989d\u5916\u5bfc\u5165\u4e00\u4e2a monkey patch \u6a21\u5757\uff0c\u81ea\u52a8\u67e5\u627e\u7279\u5b9a\u76ee\u5f55\u4e0b\u7684\u6a21\u5757\u8fdb\u884c\u66ff\u6362\u3002\u8fd9\u6837\u6240\u6709\u4e1c\u897f\u90fd\u4e0d\u7528\u52a8\u3002\u4e0d\u8fc7\u7528 IDE debug \u65f6\u5019\u7528\u67e5\u627e\u518d\u8df3\u8f6c\u4f60\u9700\u8981\u7684\u51fd\u6570\u800c\u4e0d\u662f\u76f4\u63a5\u8df3\u8f6c\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>PyCharm \u91cc\uff0c\u8fd9\u4e2a\u8df3\u8f6c\u884c\u7684\u5b9a&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/343189"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=343189"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/343189\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=343189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=343189"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=343189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}