{"id":443,"date":"2017-02-07T13:13:21","date_gmt":"2017-02-07T05:13:21","guid":{"rendered":"http:\/\/www.rainweb.site\/?p=443"},"modified":"2023-08-07T20:57:30","modified_gmt":"2023-08-07T12:57:30","slug":"python-article31","status":"publish","type":"post","link":"http:\/\/rain1024.com\/index.php\/2017\/02\/07\/python-article31\/","title":{"rendered":"\u57fa\u4e8e\u817e\u8bafCOS\u5bf9\u8c61\u5b58\u50a8SDK\u4f7f\u7528Python\u7f16\u5199\u7684\u6587\u4ef6\u4e0a\u4f20\u5de5\u5177"},"content":{"rendered":"<h1>COS-upload<\/h1>\n<h3>\u57fa\u4e8e\u817e\u8bafCOS\u4e91\u5bf9\u8c61\u5b58\u50a8SDK\uff0c\u4f7f\u7528Python\u7f16\u5199\u7684\u6587\u4ef6\u4e0a\u4f20\u5de5\u5177\uff0c\u53d1\u5e03\u4e8egithub\u4e0a\uff0c\u6709\u9700\u8981\u7684\u53ef\u4ee5\u8bbf\u95ee<\/h3>\n<h4>\u6982\u5ff5<\/h4>\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\u5982\u4e00\u4efd\u8d44\u6e90\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\u4f1a\u5c06upload.py\u7f16\u8bd1\u6210\u4e3aupload.pyc\u683c\u5f0f\u3002<\/li>\n<li>\u7136\u540e\u628auploda.pyc\u653e\u5230\u8981\u4e0a\u4f20\u7684\u6587\u4ef6\u76ee\u5f55\u4e0b\uff0c\u6253\u5f00\uff0c\u8f93\u5165\u8981\u4e0a\u4f20\u7684\u6587\u4ef6\u5939\u540d\u79f0\uff08\u968f\u4fbf\u7684\u540d\u79f0\uff09\uff0c\u7136\u540e\u628a\u6587\u4ef6\u62c9\u5982\u5373\u53ef\uff0center\u4ee5\u540e\uff0c\u4f1a\u8be2\u95eecontinue\uff0c\u662f\u5426\u7ee7\u7eed\u4e0a\u4f20<\/li>\n<\/ol>\n<h3>\u8fd9\u662f\u6211\u53d1\u5e03\u7684P1.0\u7248\uff0c\u540e\u7eed\u4f1a\u6839\u636e\u9700\u6c42\u7ee7\u7eed\u66f4\u65b0<\/h3>\n<p>\u5982\u56fe<br \/>\n<a href=\"http:\/\/blog-1252406596.costj.myqcloud.com\/photo\/python.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog-1252406596.costj.myqcloud.com\/photo\/python.png\" width=\"499\" height=\"330\" class=\"alignnone size-medium\" \/><\/a><\/p>\n<blockquote><p>\n  &gt;&gt;<a href=\"https:\/\/github.com\/rainweb521\/COS-upload\/tree\/master\" title=\"\u8fd9\u662fgithub\u4e0a\u7684\u5730\u5740\">\u8fd9\u662fgithub\u4e0a\u7684\u5730\u5740<\/a>\n<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>COS-upload \u57fa\u4e8e\u817e\u8bafCOS\u4e91\u5bf9\u8c61\u5b58\u50a8SDK\uff0c\u4f7f\u7528Python\u7f16\u5199\u7684\u6587\u4ef6\u4e0a\u4f20\u5de5\u5177\uff0c\u53d1\u5e03\u4e8egithub\u4e0a\u2026 <span class=\"read-more\"><a href=\"http:\/\/rain1024.com\/index.php\/2017\/02\/07\/python-article31\/\">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,18],"tags":[58,74],"class_list":["post-443","post","type-post","status-publish","format-aside","has-post-thumbnail","hentry","category-python","category-technique","tag-python","tag-know","post_format-post-format-aside"],"_links":{"self":[{"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/posts\/443","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=443"}],"version-history":[{"count":1,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/posts\/443\/revisions"}],"predecessor-version":[{"id":1509,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/posts\/443\/revisions\/1509"}],"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=443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/categories?post=443"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/tags?post=443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}