Python从字符串创建表

时间:2018-06-22 07:58:53

标签: python

enter image description here

是否可以在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所得到的

enter image description here

1 个答案:

答案 0 :(得分:0)

感谢@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| | | |"