{"id":344642,"date":"2021-02-15T04:29:31","date_gmt":"2021-02-14T20:29:31","guid":{"rendered":"http:\/\/4563.org\/?p=344642"},"modified":"2021-02-15T04:29:31","modified_gmt":"2021-02-14T20:29:31","slug":"%e7%bf%bb%e8%af%91%ef%bc%9a%e3%80%8a%e5%ae%9e%e7%94%a8%e7%9a%84-python-%e7%bc%96%e7%a8%8b%e3%80%8b01_07_functions","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=344642","title":{"rendered":"\u7ffb\u8bd1\uff1a\u300a\u5b9e\u7528\u7684 Python \u7f16\u7a0b\u300b01_07_Functions"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u7ffb\u8bd1\uff1a\u300a\u5b9e\u7528\u7684 Python \u7f16\u7a0b\u300b01_07_Functions               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : codists <\/span>  <span><i><\/i> 3<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<h1>1.7 \u51fd\u6570<\/h1>\n<p> <\/p>\n<p>\u968f\u7740\u7a0b\u5e8f\u5f00\u59cb\u53d8\u5927\uff0c\u6211\u4eec\u4f1a\u60f3\u8981\u6709\u6761\u7406\u5730\u7ec4\u7ec7\u8fd9\u4e9b\u7a0b\u5e8f\u3002\u672c\u8282\u7b80\u8981\u4ecb\u7ecd\u51fd\u6570\u3001\u5e93\u6a21\u5757\u4ee5\u53ca\u5e26\u6709\u5f02\u5e38\u7684\u9519\u8bef\u5904\u7406\u3002<\/p>\n<h3>\u81ea\u5b9a\u4e49\u51fd\u6570<\/h3>\n<p>\u5bf9\u4f60\u8981\u91cd\u7528\u7684\u4ee3\u7801\u4f7f\u7528\u51fd\u6570\u3002\u4e0b\u9762\u662f\u51fd\u6570\u7684\u5b9a\u4e49\u65b9\u5f0f\uff1a<\/p>\n<pre><code>def sumcount(n):     '''     Returns the sum of the first n integers     '''     total = 0     while n &gt; 0:         total += n         n -= 1     return total <\/code><\/pre>\n<p>\u51fd\u6570\u8c03\u7528\uff1a<\/p>\n<pre><code>a = sumcount(100) <\/code><\/pre>\n<p>\u51fd\u6570\u662f\u6267\u884c\u67d0\u4e9b\u4efb\u52a1\u5e76\u8fd4\u56de\u7ed3\u679c\u7684\u4e00\u7cfb\u5217\u8bed\u53e5\u3002 <code>return<\/code> \u5173\u952e\u5b57\u9700\u8981\u663e\u5f0f\u6307\u5b9a\u51fd\u6570\u7684\u8fd4\u56de\u503c\u3002<\/p>\n<h3>\u5e93\u51fd\u6570<\/h3>\n<p>Python \u5e26\u6709\u4e00\u4e2a\u5927\u578b\u7684\u6807\u51c6\u5e93\u3002\u4f7f\u7528 <code>import<\/code> \u8bbf\u95ee\u5e93\u6a21\u5757\u3002\u793a\u4f8b\uff1a<\/p>\n<pre><code>import math x = math.sqrt(10)  import urllib.request u = urllib.request.urlopen('http:\/\/www.python.org\/') data = u.read() <\/code><\/pre>\n<p>\u7a0d\u540e\uff0c\u6211\u4eec\u5c06\u66f4\u8be6\u7ec6\u5730\u4ecb\u7ecd\u5e93\u548c\u6a21\u5757\u3002<\/p>\n<h3>\u9519\u8bef\u548c\u5f02\u5e38<\/h3>\n<p>\u51fd\u6570\u5c06\u9519\u8bef\u62a5\u544a\u4e3a\u5f02\u5e38\u3002\u5f02\u5e38\u4f1a\u5bfc\u81f4\u51fd\u6570\u4e2d\u6b62\uff0c\u5982\u679c\u672a\u5904\u7406\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u6574\u4e2a\u7a0b\u5e8f\u7ec8\u6b62\u3002<\/p>\n<p>\u5728\u4f60\u7684 Python \u89e3\u91ca\u5668\uff08 REPL \uff09\u4e2d\u5c1d\u8bd5\u4e00\u4e0b\uff1a<\/p>\n<pre><code>&gt;&gt;&gt; int('N\/A') Traceback (most recent call last): File \"&lt;stdin&gt;\", line 1, in &lt;module&gt; ValueError: invalid literal for int() with base 10: 'N\/A' &gt;&gt;&gt; <\/code><\/pre>\n<p>\u51fa\u4e8e\u8c03\u8bd5\u7684\u76ee\u7684\uff0c\u4e0a\u9762\u7684\u9519\u8bef\u4fe1\u606f\u63cf\u8ff0\u4e86\u53d1\u751f\u7684\u60c5\u51b5\uff0c\u9519\u8bef\u4ea7\u751f\u7684\u4f4d\u7f6e\u4ee5\u53ca\u56de\u6eaf\u3002\u8be5\u56de\u6eaf\u663e\u793a\u5bfc\u81f4\u5931\u8d25\u7684\u5176\u5b83\u51fd\u6570\u8c03\u7528\u3002<\/p>\n<h3>\u6355\u83b7\u548c\u5904\u7406\u5f02\u5e38<\/h3>\n<p>\u5f02\u5e38\u53ef\u4ee5\u88ab\u6355\u83b7\u5e76\u5904\u7406\u3002\u8981\u6355\u83b7\u5f02\u5e38\uff0c\u4f7f\u7528 <code>try - except<\/code> \u8bed\u53e5\uff1a<\/p>\n<pre><code>for line in f:     fields = line.split()     try:         shares = int(fields[1])     except ValueError:         print(\"Couldn't parse\", line)     ... <\/code><\/pre>\n<p>\u8be5\u540d\u79f0 <code>ValueError<\/code> \u5fc5\u987b\u4e0e\u4f60\u5c1d\u8bd5\u6355\u83b7\u7684\u9519\u8bef\u7c7b\u578b\u5339\u914d\u3002<\/p>\n<p>\u901a\u5e38\uff0c\u6839\u636e\u6240\u6267\u884c\u7684\u64cd\u4f5c\uff0c\u5f88\u96be\u63d0\u524d\u786e\u5207\u5730\u77e5\u9053\u53ef\u80fd\u4f1a\u53d1\u751f\u54ea\u79cd\u9519\u8bef\u3002\u4e0d\u7ba1\u662f\u597d\u662f\u574f\uff0c\u901a\u5e38\u4f1a\u6dfb\u52a0\u5728\u7a0b\u5e8f\u610f\u5916\u5954\u6e83\u540e\u7684\u5f02\u5e38\u5904\u7406\uff08\u793a\u4f8b\uff1a\u201d\u5929\u54ea\uff0c\u6211\u4eec\u5fd8\u8bb0\u6355\u83b7\u9519\u8bef\u4e86\u3002\u6211\u4eec\u5e94\u8be5\u5904\u7406\u9519\u8bef\u7684\u3002\u201c\uff09\u3002<\/p>\n<h3>\u89e6\u53d1\u5f02\u5e38<\/h3>\n<p>\u8981\u89e6\u53d1\u5f02\u5e38\uff0c\u8bf7\u4f7f\u7528 <code>raise<\/code> \u8bed\u53e5\uff1a<\/p>\n<pre><code>raise RuntimeError('What a kerfuffle') <\/code><\/pre>\n<p>\u8fd9\u5c06\u5bfc\u81f4\u7a0b\u5e8f\u56e0\u5f02\u5e38\u56de\u6eaf\u800c\u4e2d\u6b62\uff0c\u9664\u975e\u8be5\u5f02\u5e38\u901a\u8fc7 <code>try-except<\/code> \u4ee3\u7801\u5757\u6355\u83b7\u3002 <\/p>\n<pre><code>% python3 foo.py Traceback (most recent call last):   File \"foo.py\", line 21, in &lt;module&gt;     raise RuntimeError(\"What a kerfuffle\") RuntimeError: What a kerfuffle <\/code><\/pre>\n<h2>\u7ec3\u4e60<\/h2>\n<h3>\u7ec3\u4e60 1.29\uff1a\u5b9a\u4e49\u4e00\u4e2a\u51fd\u6570<\/h3>\n<p>\u5c1d\u8bd5\u5b9a\u4e49\u4e00\u4e2a\u7b80\u5355\u7684\u51fd\u6570\uff1a<\/p>\n<pre><code>&gt;&gt;&gt; def greeting(name):         'Issues a greeting'         print('Hello', name)  &gt;&gt;&gt; greeting('Guido') Hello Guido &gt;&gt;&gt; greeting('Paula') Hello Paula &gt;&gt;&gt; <\/code><\/pre>\n<p>\u5982\u679c\u51fd\u6570\u7684\u7b2c\u4e00\u6761\u8bed\u53e5\u662f\u5b57\u7b26\u4e32\uff0c\u90a3\u4e48\u5b83\u88ab\u5f53\u505a\u6587\u6863\u5b57\u7b26\u4e32\u3002\u5c1d\u8bd5\u8f93\u5165\u4e00\u4e2a\u547d\u4ee4\u6765\u663e\u793a\u8be5\u6587\u6863\u5b57\u7b26\u4e32\uff0c\u4f8b\u5982 <code>help(greeting)<\/code>\u3002<\/p>\n<h3>\u7ec3\u4e60 1.30\uff1a\u5c06\u811a\u672c\u8f6c\u6362\u4e3a\u51fd\u6570<\/h3>\n<p>\u628a\u4f60\u5728 \u7ec3\u4e60 1.27 \u4e3a <code>pcost.py<\/code> \u7a0b\u5e8f\u7f16\u5199\u7684\u4ee3\u7801\u653e\u5230 <code>portfolio_cost(filename)<\/code> \u51fd\u6570\u91cc\u9762\u3002\u6b64\u51fd\u6570\u4ee5\u6587\u4ef6\u540d\u4f5c\u4e3a\u8f93\u5165\uff0c\u8bfb\u53d6\u6587\u4ef6\u4e2d\u7684\u6295\u8d44\u7ec4\u5408\u6570\u636e\uff0c\u628a\u6295\u8d44\u7ec4\u5408\u603b\u7684\u8d39\u7528\u4f5c\u4e3a\u6d6e\u70b9\u6570\u8fd4\u56de\u3002<\/p>\n<p>\u8981\u4f7f\u7528\u4f60\u7684\u51fd\u6570\uff0c\u8bf7\u4fee\u6539\u7a0b\u5e8f\uff0c\u4f7f\u5176\u770b\u8d77\u6765\u50cf\u4e0b\u9762\u8fd9\u6837\uff1a<\/p>\n<pre><code>def portfolio_cost(filename):     ...     # Your code here     ...  cost = portfolio_cost('Data\/portfolio.csv') print('Total cost:', cost) <\/code><\/pre>\n<p>\u8fd0\u884c\u7a0b\u5e8f\u65f6\uff0c\u4f60\u5e94\u8be5\u4f1a\u770b\u5230\u548c\u4ee5\u524d\u4e00\u6837\u7684\u8f93\u51fa\u3002\u8fd0\u884c\u7a0b\u5e8f\u540e\uff0c\u4f60\u4e5f\u53ef\u4ee5\u8f93\u5165\u4e00\u4e0b\u547d\u4ee4\u6765\u4ea4\u4e92\u5f0f\u5730\u8c03\u7528\u51fd\u6570\uff1a<\/p>\n<pre><code>bash $ python3 -i pcost.py <\/code><\/pre>\n<p>\u8fd9\u5c06\u5141\u8bb8\u4f60\u4ece\u4ea4\u4e92\u6a21\u5f0f\u8c03\u7528\u51fd\u6570\uff1a<\/p>\n<pre><code>&gt;&gt;&gt; portfolio_cost('Data\/portfolio.csv') 44671.15 &gt;&gt;&gt; <\/code><\/pre>\n<p>\u80fd\u591f\u4ea4\u4e92\u5730\u8bd5\u9a8c\u4ee3\u7801\u5bf9\u8c03\u8bd5\u548c\u6d4b\u8bd5\u975e\u5e38\u6709\u7528\u3002<\/p>\n<h3>\u7ec3\u4e60 1.31\uff1a\u9519\u8bef\u5904\u7406<\/h3>\n<p>\u5982\u679c\u4f60\u5728\u7f3a\u5c11\u67d0\u4e9b\u5b57\u6bb5\u7684\u6587\u4ef6\u4e0a\u4f7f\u7528\u51fd\u6570\uff0c\u4f1a\u53d1\u751f\u4ec0\u4e48\u60c5\u51b5\uff1f<\/p>\n<pre><code>&gt;&gt;&gt; portfolio_cost('Data\/missing.csv') Traceback (most recent call last):     File \"&lt;stdin&gt;\", line 1, in &lt;module&gt;     File \"pcost.py\", line 11, in portfolio_cost     nshares    = int(fields[1]) ValueError: invalid literal for int() with base 10: '' &gt;&gt;&gt; <\/code><\/pre>\n<p>\u5728\u8fd9\u4e00\u70b9\u4e0a\uff0c\u4f60\u9762\u4e34\u4e00\u4e2a\u51b3\u5b9a\uff1a\u8981\u4f7f\u7a0b\u5e8f\u6b63\u5e38\u5de5\u4f5c\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u6d88\u9664\u9519\u8bef\u884c\uff08 bad lines \uff09\u6765\u6e05\u7406\u539f\u59cb\u8f93\u5165\u6587\u4ef6\uff0c\u6216\u8005\u4fee\u6539\u4ee3\u7801\uff0c\u4ee5\u67d0\u79cd\u65b9\u5f0f\u5904\u7406\u9519\u8bef\u884c\u3002<\/p>\n<p>\u8bf7\u4fee\u6539 <code>pcost.py<\/code> \u7a0b\u5e8f\u4ee5\u6355\u83b7\u5f02\u5e38\uff0c\u6253\u5370\u8b66\u544a\u4fe1\u606f\u7136\u540e\u7ee7\u7eed\u5904\u7406\u6587\u4ef6\u4f59\u4e0b\u90e8\u5206\u3002<\/p>\n<h3>\u7ec3\u4e60 1.32\uff1a\u4f7f\u7528\u5e93\u51fd\u6570<\/h3>\n<p>Python \u5e26\u6709\u4e00\u4e2a\u62e5\u6709\u5927\u91cf\u6709\u7528\u51fd\u6570\u7684\u5927\u578b\u6807\u51c6\u5e93\u3002<code>csv<\/code> \u6a21\u5757\u662f\u4e00\u4e2a\u5728\u8fd9\u91cc\u53ef\u80fd\u6709\u7528\u7684\u5e93\u3002\u65e0\u8bba\u4f55\u65f6\uff0c\u6bcf\u5f53\u5fc5\u987b\u5fc5\u987b\u4f7f\u7528 CSV \u6570\u636e\u6587\u4ef6\u65f6\uff0c\u90fd\u5e94\u4f7f\u7528 <code>csv<\/code> \u6a21\u5757\u3002\u4e0b\u9762\u662f\u4e00\u4e2a\u6709\u5173 <code>csv<\/code> \u6a21\u5757\u662f\u5982\u4f55\u5de5\u4f5c\u7684\u793a\u4f8b\uff1a<\/p>\n<pre><code>&gt;&gt;&gt; import csv &gt;&gt;&gt; f = open('Data\/portfolio.csv') &gt;&gt;&gt; rows = csv.reader(f) &gt;&gt;&gt; headers = next(rows) &gt;&gt;&gt; headers ['name', 'shares', 'price'] &gt;&gt;&gt; for row in rows:         print(row)  ['AA', '100', '32.20'] ['IBM', '50', '91.10'] ['CAT', '150', '83.44'] ['MSFT', '200', '51.23'] ['GE', '95', '40.37'] ['MSFT', '50', '65.10'] ['IBM', '100', '70.44'] &gt;&gt;&gt; f.close() &gt;&gt;&gt; <\/code><\/pre>\n<p><code>csv<\/code> \u6a21\u5757\u6709\u4e00\u4e2a\u975e\u5e38\u68d2\u7684\u529f\u80fd\u2014\u2014\u5b83\u5904\u7406\u5404\u79cd\u5e95\u5c42\u7ec6\u8282\uff0c\u4f8b\u5982\u5f15\u53f7\u548c\u9002\u5f53\u7684\u9017\u53f7\u62c6\u5206\u3002\u5728\u4e0a\u9762\u7684\u8f93\u51fa\u4e2d\uff0c\u4f60\u4f1a\u6ce8\u610f\u5230\u5b83\u4ece\u7b2c\u4e00\u5217\u7684\u540d\u79f0\uff08 names \uff09\u4e2d\u5220\u9664\u4e86\u53cc\u5f15\u53f7\u3002<\/p>\n<p>\u4fee\u6539\u4f60\u7684 <code>pcost.py<\/code> \u7a0b\u5e8f\uff0c\u4ee5\u4f7f\u7528 <code>csv<\/code> \u6a21\u5757\u8fdb\u884c\u89e3\u6790\uff0c\u7136\u540e\u5c1d\u8bd5\u8fd0\u884c\u524d\u9762\u7684\u793a\u4f8b\u3002<\/p>\n<h3>\u7ec3\u4e60 1.33\uff1a\u4ece\u547d\u4ee4\u884c\u8bfb\u53d6<\/h3>\n<p>\u5728 <code>pcost.py<\/code> \u7a0b\u5e8f\u4e2d\uff0c\u8f93\u5165\u6587\u4ef6\u7684\u540d\u79f0\u5df2\u7ecf\u88ab\u786c\u7f16\u7801\u5230\u4ee3\u7801\u4e2d\uff1a<\/p>\n<pre><code># pcost.py  def portfolio_cost(filename):     ...     # Your code here     ...  cost = portfolio_cost('Data\/portfolio.csv') print('Total cost:', cost) <\/code><\/pre>\n<p>\u867d\u7136\u7528\u4e8e\u5b66\u4e60\u548c\u6d4b\u8bd5\u8fd8\u884c\uff0c\u4f46\u5728\u5b9e\u9645\u7684\u7a0b\u5e8f\u4e2d\uff0c\u4f60\u53ef\u80fd\u4e0d\u4f1a\u8fd9\u4e48\u505a\u3002<\/p>\n<p>\u76f8\u53cd\uff0c\u4f60\u53ef\u4ee5\u628a\u6587\u4ef6\u540d\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\u7ed9\u811a\u672c\u3002\u5c1d\u8bd5\u6309\u4ee5\u4e0b\u6b65\u9aa4\u4fee\u6539\u7a0b\u5e8f\u7684\u5e95\u90e8\uff1a<\/p>\n<pre><code># pcost.py import sys  def portfolio_cost(filename):     ...     # Your code here     ...  if len(sys.argv) == 2:     filename = sys.argv[1] else:     filename = 'Data\/portfolio.csv'  cost = portfolio_cost(filename) print('Total cost:', cost) <\/code><\/pre>\n<p><code>sys.argv<\/code> \u662f\u4e00\u4e2a\u5217\u8868\uff0c\u8be5\u5217\u8868\u5305\u542b\u4e86\u5728\u547d\u4ee4\u884c\u4e0a\u4f20\u9012\u7684\u53c2\u6570\uff08\u5982\u679c\u6709\uff09\u3002<\/p>\n<p>\u8981\u8fd0\u884c\u7a0b\u5e8f\uff0c\u4f60\u9700\u8981\u4ece\u7ec8\u7aef\uff08 terminal \uff09\u8fd0\u884c Python \u3002<\/p>\n<p>\u793a\u4f8b\uff0c\u4ece Unix \u7cfb\u7edf\u4e2d\u7684 bash \u8fd0\u884c\uff1a<\/p>\n<pre><code>bash % python3 pcost.py Data\/portfolio.csv Total cost: 44671.15 bash % <\/code><\/pre>\n<p>\u6ce8\uff1a\u5b8c\u6574\u7ffb\u8bd1\u89c1 https:\/\/github.com\/codists\/practical-python-zh<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>2<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5315631\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : CoreJa <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u597d\u5bb6\u4f19\uff0c\u5e74\u524d\u770b\u5230\u5927\u4f6c\u4f60\u5728\u7ffb\u8bd1\u7684\u65f6\u5019\u8fd8\u662f\u7b2c\u4e8c\u7ae0\u672b\u5c3e\uff0c\u73b0\u5728\u7b2c\u56db\u7ae0\u90fd\u5feb\u641e\u5b8c\u4e86\uff0c\u5f3a\u7684\u5440\u3002<\/p>\n<p>\u6211\u4e4b\u524d\u7ffb\u8fc7\u4e00\u5c0f\u90e8\u5206 DRF \u6846\u67b6\u7684\u6587\u6863\uff0c\u6bd5\u7adf\u7ffb\u8bd1\u5176\u5b9e\u66f4\u50cf\u662f\u5b66\u4e60\u7684\u65f6\u5019\u987a\u624b\u5c31\u7ffb\u4e86\uff0c\u8981\u662f\u53ef\u4ee5\u7684\u8bdd\u6211\u4e5f\u60f3\u505a\u70b9\u8d21\u732e\uff0c\u80fd\u5426\u5206\u4eab\u4e00\u4e0b\u4f60\u7684\u7ffb\u8bd1\u8ba1\u5212\uff1f\u6211\u53ef\u4ee5\u63d0 pr \u6216\u8005\u76f4\u63a5 push                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5315632\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : codists <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @CoreJa <br \/>\u54ce\u5440\u5988\u5440\uff0c\u611f\u52a8\u3002\u770b\u4e86\u5927\u4f6c\u7684\u535a\u5ba2\uff0c\u611f\u89c9\u6bd4\u6211\u5389\u5bb3\u54c8\uff0c\u8fd9\u79cd\u5c0f\u9879\u76ee\u5c31\u4e0d\u52b3\u70e6\u5927\u4f6c\u4e86\uff0c\u5f85\u6211\u641e\u4e00\u4e2a\u5927\u70b9\u7684\u9879\u76ee\u518d\u8bf7\u4f60\u6307\u5bfc\u6307\u5bfc\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u7ffb\u8bd1\uff1a\u300a\u5b9e\u7528\u7684 Python \u7f16\u7a0b&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\/344642"}],"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=344642"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/344642\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=344642"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=344642"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=344642"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}