{"id":468,"date":"2017-02-08T15:29:08","date_gmt":"2017-02-08T07:29:08","guid":{"rendered":"http:\/\/www.rainweb.site\/?p=468"},"modified":"2023-08-07T20:57:29","modified_gmt":"2023-08-07T12:57:29","slug":"python-article39","status":"publish","type":"post","link":"http:\/\/rain1024.com\/index.php\/2017\/02\/08\/python-article39\/","title":{"rendered":"\u57fa\u4e8e\u817e\u8bafCOS\u5bf9\u8c61\u5b58\u50a8SDK\u4f7f\u7528Python\u7f16\u5199NR-TCloud1.1"},"content":{"rendered":"<h1>NR-TCloud 1.1\uff0c\u66f4\u65b0\u4e8e2017-02-08<\/h1>\n<h2>\u66f4\u65b0\u8bf4\u660e\uff1a<\/h2>\n<h4>\u7b2c\u4e00\u7248\u4e0a\u4f20\u65f6\u9700\u8981\u5c06upload.pyc\u590d\u5236\u5230\u8981\u4e0a\u4f20\u5bf9\u8c61\u7684\u540c\u4e00\u76ee\u5f55\u4e0b\uff0c\u4e0d\u7136\u4f1a\u627e\u4e0d\u5230\u5bf9\u8c61\u94fe\u63a5\u800c\u4e0a\u4f20\u5931\u8d25\uff0c\u5728\u4f7f\u7528\u65f6\u5f88\u9ebb\u70e6\uff0c\u9700\u8981\u591a\u6b21\u79fb\u52a8\u5de5\u5177\uff0c<\/h4>\n<h3>\u800c\u8fd9\u4e00\u7248\u589e\u52a0\u4e86\u4e34\u65f6\u590d\u5236\u529f\u80fd\uff08\u5373\u5c06\u6240\u4e0a\u4f20\u7684\u5bf9\u8c61\u590d\u5236\u5230\u5de5\u5177\u76ee\u5f55\u4e0b\uff0c\u5b8c\u6210\u4e0a\u4f20\u540e\u4fbf\u7acb\u5373\u5220\u9664\uff09\uff0c\u4f60\u53ea\u9700\u5c06\u7f16\u8bd1\u597d\u7684upload.pyc\u653e\u7f6e\u5230\u4efb\u610f\u76ee\u5f55\u4e0b\uff08\u4e0d\u8981\u4e0a\u4f20\u5bf9\u8c61\u7684\u76ee\u5f55\u4e0b\uff09\uff0c\u7136\u540e\u6253\u5f00\u5de5\u5177\uff0c\u586b\u5199\u8981\u4e0a\u4f20\u7684\u6587\u4ef6\u5939\uff0c\u76f4\u63a5\u5c06\u8981\u4e0a\u4f20\u7684\u5bf9\u8c61\u62c9\u5165\u5bf9\u8bdd\u6846\u5373\u53ef\u3002\u672c\u6b21\u7248\u672c\u53bb\u9664\u4e86\u8be2\u95ee\u7ee7\u7eed\u529f\u80fd\uff0c\u53ef\u4ee5\u8fde\u7eed\u4e0a\u4f20\uff0c\u4e0a\u4f20\u5b8c\u6bd5\u540e\u70b9\u51fb\u5173\u95ed\uff0c\u5373\u5b8c\u6210\u4e0a\u4f20\u3002<\/h3>\n<h2>COS-upload<\/h2>\n<h3>\u57fa\u4e8e\u817e\u8bafCOS\u4e91\u5bf9\u8c61\u5b58\u50a8SDK\uff0c\u4f7f\u7528Python\u7f16\u5199\u7684\u6587\u4ef6\u4e0a\u4f20\u5de5\u5177<\/h3>\n<h5>\u6982\u5ff5<\/h5>\n<h5>COS\u4e91\u5bf9\u8c61\u5b58\u50a8\uff0c\u542c\u8d77\u6765\u662f\u4e00\u4e2a\u5f88\u7384\u7684\u6982\u5ff5\uff0c\u5b98\u65b9\u7684\u6982\u5ff5\u662f\u5bf9\u8c61\u5b58\u50a8\u670d\u52a1\uff08Cloud Object Service\uff09\u662f\u9762\u5411\u4f01\u4e1a\u548c\u4e2a\u4eba\u5f00\u53d1\u8005\u63d0\u4f9b\u7684\u9ad8\u53ef\u7528\uff0c\u9ad8\u7a33\u5b9a\uff0c\u5f3a\u5b89\u5168\u7684\u4e91\u7aef\u5b58\u50a8\u670d\u52a1\u3002\u60a8\u53ef\u4ee5\u5c06\u4efb\u610f\u6570\u91cf\u548c\u5f62\u5f0f\u7684\u975e\u7ed3\u6784\u5316\u6570\u636e\u653e\u5165COS\uff0c\u5e76\u5728\u5176\u4e2d\u5b9e\u73b0\u6570\u636e\u7684\u7ba1\u7406\u548c\u5904\u7406\u3002<\/h5>\n<h4>\u800c\u6211\u5bf9COS\u7684\u7406\u89e3\u5c31\u662f\uff0c\u6211\u5b58\u5165\u4e00\u4e2a\u5bf9\u8c61\uff0cCOS\u7ed9\u6211\u8fd4\u56de\u4e00\u4e2aurl\u5730\u5740\uff0c\u8fd9\u4e2a\u5730\u5740\u5728\u5168\u7403\u53ea\u8981\u662f\u6709\u7f51\u7edc\u7684\u5730\u65b9\u90fd\u53ef\u4ee5\u8bbf\u95ee\u7684\u5230\uff0c\u8fd9\u5c31\u7ed9\u6211\u4eec\u89e3\u51b3\u4e86\u4e00\u4e9b\u5728\u7ebfMarkdown\u6216\u8005\u5176\u4ed6\u6587\u6863\u7d20\u6750\u7684\u95ee\u9898\uff0c\u4f8b\u5982\u6211\u672c\u5730\u7684\u4e00\u4efdmd\u6587\u6863\uff0c\u91cc\u9762\u7684\u56fe\u7247\u662f\u4ee5\u94fe\u63a5\u7684\u65b9\u5f0f\u5b58\u5728\uff0c\u800c\u4e0d\u662f\u50cfword\u6587\u6863\u4e2d\u76f4\u63a5\u628a\u56fe\u7247\u653e\u5230\u6587\u6863\u4e2d\uff0c\u8fd8\u6709HTML\u9875\u9762\u7b49\u90fd\u662f\u7528\u94fe\u63a5\u7684\u5f62\u5f0f\u53bb\u5c55\u73b0\uff0c\u5982\u679c\u6b64\u65f6\u6211\u628aMD\u590d\u5236\u5230\u5176\u4ed6\u5730\u65b9\uff0c\u94fe\u63a5\u5c31\u4f1a\u5931\u6548\u3002<\/h4>\n<h4>\u800cCOS\u7684\u51fa\u73b0\uff0c\u6211\u53ea\u9700\u8981\u4f7f\u7528\u5df2\u7ecf\u4e0a\u4f20\u7684\u7d20\u6750\u7684url\u5730\u5740\u5373\u53ef\uff0c\u4e0d\u8bba\u5728\u54ea\u91cc\uff0c\u8fd9\u4e2a\u5730\u5740\u662f\u6c38\u8fdc\u6709\u6548\u7684\u3002\u5f53\u7136\uff0cCOS\u7684\u4f5c\u7528\u8fd8\u6709\u5f88\u591a\uff0c\u6211\u53ea\u662f\u4f7f\u7528\u7684\u6700\u7b80\u5355\u7684\u3002<\/h4>\n<h3>\u57fa\u4e8e\u4ee5\u4e0a\u9700\u6c42\uff0c\u83b7\u53d6url\u5730\u5740\u7684\u524d\u63d0\u662f\u6211\u9700\u8981\u4e0a\u4f20\u6587\u4ef6\uff0c\u5b98\u7f51\u63d0\u4f9b\u4e86\u63a7\u5236\u53f0\uff0c\u4f46\u6bcf\u6b21\u90fd\u9700\u8981\u6253\u5f00\u6e38\u89c8\u5668\u4e00\u4e2a\u4e00\u4e2a\u7684\u4e0a\u4f20\u592a\u8fc7\u4f4e\u6548\uff0c\u4e8e\u662f\u6211\u4f7f\u7528\u4e86\u5b98\u65b9\u63d0\u4f9b\u7684SDK\u529f\u80fd\uff0c\u4f7f\u7528python\u5199\u4e86\u8fd9\u6837\u4e00\u4e2a\u7b80\u5355\u7684\u4e0a\u4f20\u6587\u4ef6\u529f\u80fd\uff0c\u4e0b\u9762\u662f\u4f7f\u7528\u65b9\u6cd5\uff1a<\/h3>\n<ol>\n<li>\u5148\u5c06upload.py\u548ccompile.pyc\u4e0b\u8f7d\uff0c\u653e\u5230\u540c\u4e00\u4e2a\u6587\u4ef6\u5939\u4e2d<\/li>\n<li>\u5c06\u4f60\u5728\u5b98\u7f51\u7684APPID\uff0c\u5bc6\u94a5\uff0cBucket\u5206\u522b\u586b\u5165upload.py\u4e2d\uff0c\u534e\u5317\u5730\u533a\u5bf9\u5e94tj\u3002<\/li>\n<li>\u6253\u5f00compile.pyc\u6587\u4ef6\uff0c\u4e00\u5b9a\u662fpyc\u7f16\u8bd1\u597d\u7684\uff0c\u76f4\u63a5\u53cc\u51fb\u8fd0\u884c\uff0c\u518d\u5c06upload.py\u62d6\u5165\uff0c\u4f1a\u628aupload.py\u7f16\u8bd1\u6210\u4e3apyc\u683c\u5f0f\u3002<\/li>\n<li>\u7136\u540e\u628auploda.pyc\u653e\u7f6e\u5230\u4efb\u610f\u76ee\u5f55\u4e0b\uff08\u4e0d\u8981\u4e0a\u4f20\u5bf9\u8c61\u7684\u76ee\u5f55\u4e0b\uff09\uff0c\u7136\u540e\u6253\u5f00\u5de5\u5177\uff0c\u586b\u5199\u8981\u4e0a\u4f20\u7684\u6587\u4ef6\u5939\uff0c\u76f4\u63a5\u5c06\u8981\u4e0a\u4f20\u7684\u5bf9\u8c61\u62c9\u5165\u5bf9\u8bdd\u6846\u5373\u53ef\u3002<\/li>\n<\/ol>\n<p>\u300b\u300b\u300b<a href=\"https:\/\/github.com\/rainweb521\/COS-upload\">\u8fd9\u662f\u9879\u76ee\u7684github\u5730\u5740<\/a><\/p>\n<h3>\u8fd9\u662f\u6211\u53d1\u5e03\u7684NR-TCloud1.1\u7248\uff0c\u540e\u7eed\u4f1a\u6839\u636e\u9700\u6c42\u7ee7\u7eed\u66f4\u65b0<\/h3>\n<ul>\n<li>\u5982\u56fe<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog-1252406596.costj.myqcloud.com\/blog\/nr2.jpg\" width=\"496\" height=\"326\" class=\"alignnone size-medium\" \/><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>NR-TCloud 1.1\uff0c\u66f4\u65b0\u4e8e2017-02-08 \u66f4\u65b0\u8bf4\u660e\uff1a \u7b2c\u4e00\u7248\u4e0a\u4f20\u65f6\u9700\u8981\u5c06upload.pyc\u590d\u5236\u2026 <span class=\"read-more\"><a href=\"http:\/\/rain1024.com\/index.php\/2017\/02\/08\/python-article39\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":469,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"aside","meta":{"footnotes":""},"categories":[15],"tags":[58,74],"class_list":["post-468","post","type-post","status-publish","format-aside","has-post-thumbnail","hentry","category-python","tag-python","tag-know","post_format-post-format-aside"],"_links":{"self":[{"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/posts\/468","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/comments?post=468"}],"version-history":[{"count":1,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/posts\/468\/revisions"}],"predecessor-version":[{"id":1501,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/posts\/468\/revisions\/1501"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/media\/469"}],"wp:attachment":[{"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/media?parent=468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/categories?post=468"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/tags?post=468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}