首页 > 解决方案 > Python-从字符串创建表

问题描述

在此处输入图像描述

是否可以在 Python 中创建此表,我有为此的 bash 代码,但它在 python 中不起作用

"description":"Patch the following servers for any\\u00a0Windows Updates and Application Updates.\\r\\n\\r\\nSQL Updates or rollups will not be done. All the servers to be put in maintenance mode on Zabbix before commencing the maintenance on all the servers.\\u00a0Once the update or maintenance is completed, the table below will be completed to show the status of the updates and added to JIRA comments.\\r\\n\\r\\nPlease review infrastructure for new servers and add to the list.\\r\\n\\r\\n\\u00a0\\r\\n|Server Name|OS Updates Completed|Application Updates Completed (list)|Remarks|\\r\\n|PEL-ACD-01A|\\u00a0Yes/No|\\u00a0Java, Chrome etc|\\u00a0|\\r\\n|PEL-ACD-01B|\\u00a0|\\u00a0|\\u00a0|\\r\\n|PEL-JMP-01A|\\u00a0|\\u00a0|\\u00a0|\\r\\n|PEL-SQL-01A|\\u00a0|\\u00a0|\\u00a0|\\r\\n|PEL-TLS-01A|\\u00a0|\\u00a0|\\u00a0|"

这就是我使用 python 得到的

在此处输入图像描述

标签: python

解决方案


感谢@Lomtur 引导我走向正确的方向,我需要删除双反斜杠并且必须放入空间| |以获得空行。

   "description":"Patch the following servers for any Windows Updates and Application Updates.\n \nSQL Updates or rollups will not be done. All the servers to be put in maintenance mode on Zabbix before commencing the maintenance on all the servers.\\u00a0Once the update or maintenance is completed, the table below will be completed to show the status of the updates and added to JIRA comments.\r\n\nPlease review infrastructure for new servers and add to the list.\r\n\r\n\r\n|Server Name|OS Updates Completed|Application Updates Completed (list)|Remarks|\r\n|PEL-ACD-01A|Yes/No|Java, Chrome etc| |\r\n|PEL-ACD-01B| | | |\r\n|PEL-JMP-01A| | | |\r\n|PEL-SQL-01A| | | |\r\n|PEL-TLS-01A| | | |"

推荐阅读