{"id":222122,"date":"2021-07-17T10:11:07","date_gmt":"2021-07-17T02:11:07","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=222122"},"modified":"2021-07-07T11:15:54","modified_gmt":"2021-07-07T03:15:54","slug":"code-python-linux","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/code-python-linux.html","title":{"rendered":"\u5b9e\u4f8b\u4ee3\u7801\u5206\u4eabPython\u5b9e\u73b0Linux\u76d1\u63a7"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u672c\u6587\u901a\u8fc7\u5b9e\u4f8b\u4ee3\u7801\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u4e86Python\u5b9e\u73b0Linux\u76d1\u63a7\u7684\u65b9\u6cd5\uff0c\u975e\u5e38\u4e0d\u9519\uff0c\u5177\u6709\u4e00\u5b9a\u7684\u53c2\u8003\u501f\u9274\u4ef7\u503c,\u9700\u8981\u7684\u670b\u53cb\u53ef\u4ee5\u53c2\u8003\u4e0b\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

\u5de5\u4f5c\u539f\u7406\uff1a\u57fa\u4e8e\/proc \u6587\u4ef6\u7cfb\u7edf<\/strong><\/div>\n

Linux \u7cfb\u7edf\u4e3a\u7ba1\u7406\u5458\u63d0\u4f9b\u4e86\u975e\u5e38\u597d\u7684\u65b9\u6cd5\uff0c\u4f7f\u5176\u53ef\u4ee5\u5728\u7cfb\u7edf\u8fd0\u884c\u65f6\u66f4\u6539\u5185\u6838\uff0c\u800c\u4e0d\u9700\u8981\u91cd\u65b0\u5f15\u5bfc\u5185\u6838\u7cfb\u7edf\uff0c\u8fd9\u662f\u901a\u8fc7\/proc \u865a\u62df\u6587\u4ef6\u7cfb\u7edf\u5b9e\u73b0\u7684\u3002\/proc \u6587\u4ef6\u865a\u62df\u7cfb\u7edf\u662f\u4e00\u79cd\u5185\u6838\u548c\u5185\u6838\u6a21\u5757\u7528\u6765\u5411\u8fdb\u7a0b\uff08process\uff09\u53d1\u9001\u4fe1\u606f\u7684\u673a\u5236\uff08\u6240\u4ee5\u53eb\u505a\u201c\/proc\u201d\uff09\uff0c\u8fd9\u4e2a\u4f2a\u6587\u4ef6\u7cfb\u7edf\u5141\u8bb8\u4e0e\u5185\u6838\u5185\u90e8\u6570\u636e\u7ed3\u6784\u4ea4\u4e92\uff0c\u83b7\u53d6\u6709\u5173\u8fdb\u7a0b\u7684\u6709\u7528\u4fe1\u606f\uff0c\u5728\u8fd0\u884c\u4e2d\uff08on the fly\uff09\u6539\u53d8\u8bbe\u7f6e\uff08\u901a\u8fc7\u6539\u53d8\u5185\u6838\u53c2\u6570\uff09\u3002\u4e0e\u5176\u4ed6\u6587\u4ef6\u7cfb\u7edf\u4e0d\u540c\uff0c\/proc \u5b58\u5728\u4e8e\u5185\u5b58\u800c\u4e0d\u662f\u786c\u76d8\u4e2d\u3002proc \u6587\u4ef6\u7cfb\u7edf\u63d0\u4f9b\u7684\u4fe1\u606f\u5982\u4e0b\uff1a<\/p>\n

\u8fdb\u7a0b\u4fe1\u606f\uff1a\u7cfb\u7edf\u4e2d\u7684\u4efb\u4f55\u4e00\u4e2a\u8fdb\u7a0b\uff0c\u5728 proc \u7684\u5b50\u76ee\u5f55\u4e2d\u90fd\u6709\u4e00\u4e2a\u540c\u540d\u7684\u8fdb\u7a0b ID\uff0c\u53ef\u4ee5\u627e\u5230 cmdline\u3001mem\u3001root\u3001stat\u3001statm\uff0c\u4ee5\u53ca status\u3002\u67d0\u4e9b\u4fe1\u606f\u53ea\u6709\u8d85\u7ea7\u7528\u6237\u53ef\u89c1\uff0c\u4f8b\u5982\u8fdb\u7a0b\u6839\u76ee\u5f55\u3002\u6bcf\u4e00\u4e2a\u5355\u72ec\u542b\u6709\u73b0\u6709\u8fdb\u7a0b\u4fe1\u606f\u7684\u8fdb\u7a0b\u6709\u4e00\u4e9b\u53ef\u7528\u7684\u4e13\u95e8\u94fe\u63a5\uff0c\u7cfb\u7edf\u4e2d\u7684\u4efb\u4f55\u4e00\u4e2a\u8fdb\u7a0b\u90fd\u6709\u4e00\u4e2a\u5355\u72ec\u7684\u81ea\u94fe\u63a5\u6307\u5411\u8fdb\u7a0b\u4fe1\u606f\uff0c\u5176\u7528\u5904\u5c31\u662f\u4ece\u8fdb\u7a0b\u4e2d\u83b7\u53d6\u547d\u4ee4\u884c\u4fe1\u606f\u3002<\/p>\n

\u7cfb\u7edf\u4fe1\u606f\uff1a\u5982\u679c\u9700\u8981\u4e86\u89e3\u6574\u4e2a\u7cfb\u7edf\u4fe1\u606f\u4e2d\u4e5f\u53ef\u4ee5\u4ece\/proc\/stat \u4e2d\u83b7\u5f97\uff0c\u5176\u4e2d\u5305\u62ec CPU \u5360\u7528\u60c5\u51b5\u3001\u78c1\u76d8\u7a7a\u95f4\u3001\u5185\u5b58\u5bf9\u6362\u3001\u4e2d\u65ad\u7b49\u3002<\/p>\n

CPU \u4fe1\u606f\uff1a\u5229\u7528\/proc\/CPUinfo \u6587\u4ef6\u53ef\u4ee5\u83b7\u5f97\u4e2d\u592e\u5904\u7406\u5668\u7684\u5f53\u524d\u51c6\u786e\u4fe1\u606f\u3002<\/p>\n

\u8d1f\u8f7d\u4fe1\u606f\uff1a\/proc\/loadavg \u6587\u4ef6\u5305\u542b\u7cfb\u7edf\u8d1f\u8f7d\u4fe1\u606f\u3002<\/p>\n

\u7cfb\u7edf\u5185\u5b58\u4fe1\u606f\uff1a\/proc\/meminfo \u6587\u4ef6\u5305\u542b\u7cfb\u7edf\u5185\u5b58\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u5176\u4e2d\u663e\u793a\u7269\u7406\u5185\u5b58\u7684\u6570\u91cf\u3001\u53ef\u7528\u4ea4\u6362\u7a7a\u95f4\u7684\u6570\u91cf\uff0c\u4ee5\u53ca\u7a7a\u95f2\u5185\u5b58\u7684\u6570\u91cf\u7b49\u3002<\/p>\n

\/proc \u76ee\u5f55\u4e2d\u7684\u4e3b\u8981\u6587\u4ef6\u7684\u8bf4\u660e<\/strong><\/div>\n

\n- apm \u9ad8\u7ea7\u7535\u6e90\u7ba1\u7406\u4fe1\u606f<\/p>\n

- cmdline \u8fd9\u4e2a\u6587\u4ef6\u7ed9\u51fa\u4e86\u5185\u6838\u542f\u52a8\u7684\u547d\u4ee4\u884c<\/p>\n

- CPUinfo \u4e2d\u592e\u5904\u7406\u5668\u4fe1\u606f<\/p>\n

- devices \u53ef\u4ee5\u7528\u5230\u7684\u8bbe\u5907\uff08\u5757\u8bbe\u5907\/\u5b57\u7b26\u8bbe\u5907\uff09<\/p>\n

- dma \u663e\u793a\u5f53\u524d\u4f7f\u7528\u7684 DMA \u901a\u9053<\/p>\n

- filesystems \u6838\u5fc3\u914d\u7f6e\u7684\u6587\u4ef6\u7cfb\u7edf<\/p>\n

- ioports \u5f53\u524d\u4f7f\u7528\u7684 I\/O \u7aef\u53e3<\/p>\n

- interrupts \u8fd9\u4e2a\u6587\u4ef6\u7684\u6bcf\u4e00\u884c\u90fd\u6709\u4e00\u4e2a\u4fdd\u7559\u7684\u4e2d\u65ad<\/p>\n

- kcore \u7cfb\u7edf\u7269\u7406\u5185\u5b58\u6620\u50cf<\/p>\n

- kmsg \u6838\u5fc3\u8f93\u51fa\u7684\u6d88\u606f\uff0c\u88ab\u9001\u5230\u65e5\u5fd7\u6587\u4ef6<\/p>\n

- mdstat \u8fd9\u4e2a\u6587\u4ef6\u5305\u542b\u4e86\u7531 md \u8bbe\u5907\u9a71\u52a8\u7a0b\u5e8f\u63a7\u5236\u7684 RAID \u8bbe\u5907\u4fe1\u606f<\/p>\n

- loadavg \u7cfb\u7edf\u5e73\u5747\u8d1f\u8f7d\u5747\u8861<\/p>\n

- meminfo \u5b58\u50a8\u5668\u4f7f\u7528\u4fe1\u606f\uff0c\u5305\u62ec\u7269\u7406\u5185\u5b58\u548c\u4ea4\u6362\u5185\u5b58<\/p>\n

- modules \u8fd9\u4e2a\u6587\u4ef6\u7ed9\u51fa\u53ef\u52a0\u8f7d\u5185\u6838\u6a21\u5757\u7684\u4fe1\u606f\u3002lsmod \u7a0b\u5e8f\u7528\u8fd9\u4e9b\u4fe1\u606f\u663e\u793a\u6709\u5173\u6a21\u5757\u7684\u540d\u79f0\uff0c\u5927\u5c0f\uff0c\u4f7f\u7528\u6570\u76ee\u65b9\u9762\u7684\u4fe1\u606f<\/p>\n

- net \u7f51\u7edc\u534f\u8bae\u72b6\u6001\u4fe1\u606f<\/p>\n

- partitions \u7cfb\u7edf\u8bc6\u522b\u7684\u5206\u533a\u8868<\/p>\n

- pci pci \u8bbe\u5907\u4fe1\u606f<\/p>\n

- scsi scsi \u8bbe\u5907\u4fe1\u606f<\/p>\n

- self \u5230\u67e5\u770b\/proc \u7a0b\u5e8f\u8fdb\u7a0b\u76ee\u5f55\u7684\u7b26\u53f7\u8fde\u63a5<\/p>\n

- stat \u8fd9\u4e2a\u6587\u4ef6\u5305\u542b\u7684\u4fe1\u606f\u6709 CPU \u5229\u7528\u7387\uff0c\u78c1\u76d8\uff0c\u5185\u5b58\u9875\uff0c\u5185\u5b58\u5bf9\u6362\uff0c\u5168\u90e8\u4e2d\u65ad\uff0c\u63a5\u89e6\u5f00\u5173\u4ee5\u53ca\u8d4f\u8d50\u81ea\u4e3e\u65f6\u95f4<\/p>\n

- swaps \u663e\u793a\u7684\u662f\u4ea4\u6362\u5206\u533a\u7684\u4f7f\u7528\u60c5\u51b5<\/p>\n

- uptime \u8fd9\u4e2a\u6587\u4ef6\u7ed9\u51fa\u81ea\u4ece\u4e0a\u6b21\u7cfb\u7edf\u81ea\u4e3e\u4ee5\u6765\u7684\u79d2\u6570\uff0c\u4ee5\u53ca\u5176\u4e2d\u6709\u591a\u5c11\u79d2\u5904\u4e8e\u7a7a\u95f2<\/p>\n

- version \u8fd9\u4e2a\u6587\u4ef6\u53ea\u6709\u4e00\u884c\u5185\u5bb9\uff0c\u8bf4\u660e\u6b63\u5728\u8fd0\u884c\u7684\u5185\u6838\u7248\u672c\u3002\u53ef\u4ee5\u7528\u6807\u51c6\u7684\u7f16\u7a0b\u65b9\u6cd5\u8fdb\u884c\u5206\u6790\u83b7\u5f97\u6240\u9700\u7684\u7cfb\u7edf\u4fe1\u606f\n<\/p>\n

\"\"<\/p>\n

\u83b7\u53d6 CPU \u7684\u4fe1\u606f<\/strong><\/div>\n
#!\/usr\/bin\/env Python\r\nfrom __future__ import print_function\r\nfrom collections import OrderedDict\r\nimport pprint\r\ndef CPUinfo():\r\n''' Return the information in \/proc\/CPUinfo\r\nas a dictionary in the following format:\r\nCPU_info['proc0']={...}\r\nCPU_info['proc1']={...}\r\n'''\r\nCPUinfo=OrderedDict()\r\nprocinfo=OrderedDict()\r\nnprocs = 0\r\nwith open('\/proc\/CPUinfo') as f:\r\nfor line in f:\r\nif not line.strip():\r\n# end of one processor\r\nCPUinfo['proc%s' % nprocs] = procinfo\r\nnprocs=nprocs+1\r\n# Reset\r\nprocinfo=OrderedDict()\r\nelse:\r\nif len(line.split(':')) == 2:\r\nprocinfo[line.split(':')[0].strip()] = line.split(':')[1].strip()\r\nelse:\r\nprocinfo[line.split(':')[0].strip()] = ''\r\nreturn CPUinfo\r\nif __name__=='__main__':\r\nCPUinfo = CPUinfo()\r\nfor processor in CPUinfo.keys():\r\nprint(CPUinfo[processor]['model name'])<\/pre>\n

\u7b80\u5355\u8bf4\u660e\u4e00\u4e0b\u6e05\u5355 1\uff0c\u8bfb\u53d6\/proc\/CPUinfo \u4e2d\u7684\u4fe1\u606f\uff0c\u8fd4\u56de list\uff0c\u6bcf\u6838\u5fc3\u4e00\u4e2a dict\u3002\u5176\u4e2d list \u662f\u4e00\u4e2a\u4f7f\u7528\u65b9\u62ec\u53f7\u62ec\u8d77\u6765\u7684\u6709\u5e8f\u5143\u7d20\u96c6\u5408\u3002List \u53ef\u4ee5\u4f5c\u4e3a\u4ee5 0 \u4e0b\u6807\u5f00\u59cb\u7684\u6570\u7ec4\u3002Dict \u662f Python \u7684\u5185\u7f6e\u6570\u636e\u7c7b\u578b\u4e4b\u4e00, \u5b83\u5b9a\u4e49\u4e86\u952e\u548c\u503c\u4e4b\u95f4\u4e00\u5bf9\u4e00\u7684\u5173\u7cfb\u3002OrderedDict \u662f\u4e00\u4e2a\u5b57\u5178\u5b50\u7c7b\uff0c\u53ef\u4ee5\u8bb0\u4f4f\u5176\u5185\u5bb9\u589e\u52a0\u7684\u987a\u5e8f\u3002\u5e38\u89c4 dict \u5e76\u4e0d\u8ddf\u8e2a\u63d2\u5165\u987a\u5e8f\uff0c\u8fed\u4ee3\u5904\u7406\u65f6\u4f1a\u6839\u636e\u952e\u5728\u6563\u5217\u8868\u4e2d\u5b58\u50a8\u7684\u987a\u5e8f\u6765\u751f\u6210\u503c\u3002\u5728 OrderedDict \u4e2d\u5219\u76f8\u53cd\uff0c\u5b83\u4f1a\u8bb0\u4f4f\u5143\u7d20\u63d2\u5165\u7684\u987a\u5e8f\uff0c\u5e76\u5728\u521b\u5efa\u8fed\u4ee3\u5668\u65f6\u4f7f\u7528\u8fd9\u4e2a\u987a\u5e8f\u3002<\/p>\n

\u83b7\u53d6\u7cfb\u7edf\u7684\u8d1f\u8f7d\u4fe1\u606f<\/strong><\/div>\n
#!\/usr\/bin\/env Python  \r\nimport os \r\ndef load_stat(): \r\nloadavg = {} \r\nf = open(\"\/proc\/loadavg\") \r\ncon = f.read().split() \r\nf.close() \r\nloadavg['lavg_1']=con[0] \r\nloadavg['lavg_5']=con[1] \r\nloadavg['lavg_15']=con[2] \r\nloadavg['nr']=con[3] \r\nloadavg['last_pid']=con[4] \r\nreturn loadavg \r\nprint \"loadavg\",load_stat()['lavg_15']<\/pre>\n

\u7b80\u5355\u8bf4\u660e\u4e00\u4e0b\u6e05\u5355 2\uff1a\u6e05\u5355 2 \u8bfb\u53d6\/proc\/loadavg \u4e2d\u7684\u4fe1\u606f\uff0cimport os \uff1aPython \u4e2d import \u7528\u4e8e\u5bfc\u5165\u4e0d\u540c\u7684\u6a21\u5757\uff0c\u5305\u62ec\u7cfb\u7edf\u63d0\u4f9b\u548c\u81ea\u5b9a\u4e49\u7684\u6a21\u5757\u3002\u5176\u57fa\u672c\u5f62\u5f0f\u4e3a\uff1aimport \u6a21\u5757\u540d [as \u522b\u540d]\uff0c\u5982\u679c\u53ea\u9700\u8981\u5bfc\u5165\u6a21\u5757\u4e2d\u7684\u90e8\u5206\u6216\u5168\u90e8\u5185\u5bb9\u53ef\u4ee5\u7528\u5f62\u5f0f\uff1afrom \u6a21\u5757\u540d import *\u6765\u5bfc\u5165\u76f8\u5e94\u7684\u6a21\u5757\u3002OS \u6a21\u5757 os \u6a21\u5757\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7edf\u4e00\u7684\u64cd\u4f5c\u7cfb\u7edf\u63a5\u53e3\u51fd\u6570\uff0cos \u6a21\u5757\u80fd\u5728\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u5e73\u53f0\u5982 nt\uff0cposix \u4e2d\u7684\u7279\u5b9a\u51fd\u6570\u95f4\u81ea\u52a8\u5207\u6362\uff0c\u4ece\u800c\u5b9e\u73b0\u8de8\u5e73\u53f0\u64cd\u4f5c\u3002<\/p>\n

\u83b7\u53d6\u5185\u5b58\u4f7f\u7528\u60c5\u51b5<\/strong><\/div>\n
!\/usr\/bin\/env Python\r\nfrom __future__ import print_function\r\nfrom collections import OrderedDict\r\ndef meminfo():\r\n''' Return the information in \/proc\/meminfo\r\nas a dictionary '''\r\nmeminfo=OrderedDict()\r\nwith open('\/proc\/meminfo') as f:\r\nfor line in f:\r\nmeminfo[line.split(':')[0]] = line.split(':')[1].strip()\r\nreturn meminfo\r\nif __name__=='__main__':\r\n#print(meminfo())\r\nmeminfo = meminfo()\r\nprint('Total memory: {0}'.format(meminfo['MemTotal']))\r\nprint('Free memory: {0}'.format(meminfo['MemFree']))<\/pre>\n
net.py \u83b7\u53d6\u7f51\u7edc\u63a5\u53e3\u7684\u8f93\u5165\u548c\u8f93\u51fa<\/strong><\/div>\n
#!\/usr\/bin\/env Python\r\n  import time\r\n  import sys\r\n  if len(sys.argv) > 1:\r\n    INTERFACE = sys.argv[1]\r\n  else:\r\n    INTERFACE = 'eth0'\r\n  STATS = []\r\n  print 'Interface:',INTERFACE\r\n  def rx():\r\n    ifstat = open('\/proc\/net\/dev').readlines()\r\n    for interface in ifstat:\r\n      if INTERFACE in interface:\r\n        stat = float(interface.split()[1])\r\n        STATS[0:] = [stat]\r\n  def tx():\r\n    ifstat = open('\/proc\/net\/dev').readlines()\r\n    for interface in ifstat:\r\n      if INTERFACE in interface:\r\n        stat = float(interface.split()[9])\r\n        STATS[1:] = [stat]\r\n  print  'In     Out'\r\n  rx()\r\n  tx()\r\n  while  True:\r\n    time.sleep(1)\r\n    rxstat_o = list(STATS)\r\n    rx()\r\n    tx()\r\n    RX = float(STATS[0])\r\n    RX_O = rxstat_o[0]\r\n    TX = float(STATS[1])\r\n    TX_O = rxstat_o[1]\r\n    RX_RATE = round((RX - RX_O)\/1024\/1024,3)\r\n    TX_RATE = round((TX - TX_O)\/1024\/1024,3)\r\n    print RX_RATE ,'MB   ',TX_RATE ,'MB'<\/pre>\n
crtrl.py \u76d1\u63a7 Apache \u670d\u52a1\u5668\u8fdb\u7a0b\u7684 Python \u811a\u672c<\/strong><\/div>\n
#!\/usr\/bin\/env Python \r\nimport os, sys, time \r\nwhile True: \r\ntime.sleep(4) \r\ntry: \r\nret = os.popen('ps -C apache -o pid,cmd').readlines() \r\nif len(ret) < 2: \r\nprint \"apache \u8fdb\u7a0b\u5f02\u5e38\u9000\u51fa\uff0c 4 \u79d2\u540e\u91cd\u65b0\u542f\u52a8\"\r\ntime.sleep(3) \r\nos.system(\"service apache2 restart\") \r\nexcept: \r\nprint \"Error\", sys.exc_info()[1]<\/pre>\n
\u603b\u7ed3<\/strong><\/div>\n

\u4ee5\u4e0a\u6240\u8ff0\u662f\u5c0f\u7f16\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u7684Python\u5b9e\u73b0Linux\u76d1\u63a7\u7684\u65b9\u6cd5\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u6709\u6240\u5e2e\u52a9\uff0c\u5982\u679c\u5927\u5bb6\u6709\u4efb\u4f55\u7591\u95ee\u6b22\u8fce\u7ed9\u6211\u7559\u8a00\uff0c\u5c0f\u7f16\u4f1a\u53ca\u65f6\u56de\u590d\u5927\u5bb6\u7684\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"

Linux \u7cfb\u7edf\u4e3a\u7ba1\u7406\u5458\u63d0\u4f9b\u4e86\u975e\u5e38\u597d\u7684\u65b9\u6cd5\uff0c\u4f7f\u5176\u53ef\u4ee5\u5728\u7cfb\u7edf\u8fd0\u884c\u65f6\u66f4\u6539\u5185\u6838\uff0c\u800c\u4e0d\u9700\u8981\u91cd\u65b0\u5f15\u5bfc\u5185\u6838\u7cfb\u7edf\uff0c\u8fd9\u662f\u901a\u8fc7\/ […]<\/p>\n","protected":false},"author":310,"featured_media":222130,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-222122","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/222122","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/310"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=222122"}],"version-history":[{"count":9,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/222122\/revisions"}],"predecessor-version":[{"id":222328,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/222122\/revisions\/222328"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/222130"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=222122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=222122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=222122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}