{"id":4943,"date":"2020-01-31T18:19:07","date_gmt":"2020-01-31T17:19:07","guid":{"rendered":"https:\/\/pythonprogramming.altervista.org\/?p=4943"},"modified":"2020-02-02T09:33:30","modified_gmt":"2020-02-02T08:33:30","slug":"create-a-beautiful-html-table-with-python","status":"publish","type":"post","link":"https:\/\/pythonprogramming.altervista.org\/create-a-beautiful-html-table-with-python\/","title":{"rendered":"Create A Beautiful Html Table with Python"},"content":{"rendered":"<p>I made a lot of script to find a nice way to automate the creation of nice html tables using Python. This is the last one. I think this is a nice script. The result is this:<\/p>\n<p><a href=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2020\/01\/table_easy.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4944\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2020\/01\/table_easy.png\" alt=\"\" width=\"522\" height=\"266\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2020\/01\/table_easy.png 522w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2020\/01\/table_easy-320x163.png 320w\" sizes=\"auto, (max-width: 522px) 100vw, 522px\" \/><\/a><\/p>\n<p>I think it&#8217;s nice. You can change the structure of the table changing this:<\/p>\n<pre class=\"lang:default decode:true \">conto = \"\"\"\r\n&lt;tr&gt;\r\n&lt;td data-th=\"Movie Title\"&gt;{}&lt;\/td&gt;\r\n&lt;td data-th=\"Genre\"&gt;{}&lt;\/td&gt;\r\n&lt;td data-th=\"Year\"&gt;{}&lt;\/td&gt;\r\n&lt;td data-th=\"Gross\"&gt;{}&lt;\/td&gt;\r\n&lt;\/tr&gt;\"\"\"*2<\/pre>\n<p>This is where the data go. The data, for example, can be these:<\/p>\n<pre class=\"lang:default decode:true \">replace = \"\"\"Banca x c\/c\r\nVersamento\r\n500\u20ac\r\n\r\nDenaro in cassa\r\nprelievo depositato in banca\r\n\r\n500 \u20ac\"\"\"<\/pre>\n<p>There are 2 rows (if you want more row, multiplicate for 3, 4 &#8230; the conto variable).<\/p>\n<p>You just have to write on each line the 4 data for the first line and another 4 data for line after those. If you want to leave a cell empty, leave the line empty.<\/p>\n<p>Here is the whole code. Most of it is css. The python code is at the end, just 10ish line of code.<\/p>\n<pre class=\"lang:default decode:true\">import os\r\n\r\nhtml = \"\"\"&lt;style&gt;\r\n@import \"https:\/\/fonts.googleapis.com\/css?family=Montserrat:300,400,700\";\r\n.rwd-table {\r\n  margin: 1em 0;\r\n  min-width: 300px;\r\n}\r\n.rwd-table tr {\r\n  border-top: 1px solid #ddd;\r\n  border-bottom: 1px solid #ddd;\r\n}\r\n.rwd-table th {\r\n  display: none;\r\n}\r\n.rwd-table td {\r\n  display: block;\r\n}\r\n.rwd-table td:first-child {\r\n  padding-top: .5em;\r\n}\r\n.rwd-table td:last-child {\r\n  padding-bottom: .5em;\r\n}\r\n.rwd-table td:before {\r\n  content: attr(data-th) \": \";\r\n  font-weight: bold;\r\n  width: 6.5em;\r\n  display: inline-block;\r\n}\r\n@media (min-width: 480px) {\r\n  .rwd-table td:before {\r\n    display: none;\r\n  }\r\n}\r\n.rwd-table th, .rwd-table td {\r\n  text-align: left;\r\n}\r\n@media (min-width: 480px) {\r\n  .rwd-table th, .rwd-table td {\r\n    display: table-cell;\r\n    padding: .25em .5em;\r\n  }\r\n  .rwd-table th:first-child, .rwd-table td:first-child {\r\n    padding-left: 0;\r\n  }\r\n  .rwd-table th:last-child, .rwd-table td:last-child {\r\n    padding-right: 0;\r\n  }\r\n}\r\n\r\n\r\nh1 {\r\n  font-weight: normal;\r\n  letter-spacing: -1px;\r\n  color: #34495E;\r\n}\r\n\r\n.rwd-table {\r\n  background: #34495E;\r\n  color: #fff;\r\n  border-radius: .4em;\r\n  overflow: hidden;\r\n}\r\n.rwd-table tr {\r\n  border-color: #46637f;\r\n}\r\n.rwd-table th, .rwd-table td {\r\n  margin: .5em 1em;\r\n}\r\n@media (min-width: 480px) {\r\n  .rwd-table th, .rwd-table td {\r\n    padding: 1em !important;\r\n  }\r\n}\r\n.rwd-table th, .rwd-table td:before {\r\n  color: #dd5;\r\n}\r\n&lt;\/style&gt;\r\n&lt;script&gt;\r\n  window.console = window.console || function(t) {};\r\n&lt;\/script&gt;\r\n&lt;script&gt;\r\n  if (document.location.search.match(\/type=embed\/gi)) {\r\n    window.parent.postMessage(\"resize\", \"*\");\r\n  }\r\n&lt;\/script&gt;\r\n\r\n\r\n&lt;h1&gt;Libro giornale&lt;\/h1&gt;\r\n&lt;table class=\"rwd-table\"&gt;\r\n&lt;tr&gt;\r\n\r\n  &lt;table class=\"rwd-table\"&gt;\r\n&lt;tr&gt;\r\n&lt;th&gt;Conto&lt;\/th&gt;\r\n&lt;th&gt;Descrizione&lt;\/th&gt;\r\n&lt;th&gt;Dare&lt;\/th&gt;\r\n&lt;th&gt;Avere&lt;\/th&gt;\r\n&lt;\/tr&gt;\r\n\r\n\r\n&lt;---conti---&gt;\r\n\r\n\r\n&lt;\/table&gt;\"\"\"\r\n\r\n\r\nconto = \"\"\"\r\n&lt;tr&gt;\r\n&lt;td data-th=\"Movie Title\"&gt;{}&lt;\/td&gt;\r\n&lt;td data-th=\"Genre\"&gt;{}&lt;\/td&gt;\r\n&lt;td data-th=\"Year\"&gt;{}&lt;\/td&gt;\r\n&lt;td data-th=\"Gross\"&gt;{}&lt;\/td&gt;\r\n&lt;\/tr&gt;\"\"\"*2\r\n\r\nreplace = \"\"\"Banca x c\/c\r\nVersamento\r\n500\u20ac\r\n\r\nDenaro in cassa\r\nprelievo depositato in banca\r\n\r\n500 \u20ac\"\"\"\r\n\r\nreplace = replace.split(\"\\n\")\r\nprint(replace)\r\nconto = conto.format(*replace)\r\nhtml = html.replace(\"&lt;---conti---&gt;\", conto)\r\n\r\nwith open(myfile := \"table.html\", \"w\") as file:\r\n    file.write(html)\r\n\r\nos.startfile(myfile)\r\n<\/pre>\n<h2>A version for &#8220;csv&#8221; type of data, comma separated value<\/h2>\n<p>This version let you input the data separated by comma. Perhaps it&#8217;s more handy<\/p>\n<pre class=\"lang:default decode:true \">import os\r\n\r\nhtml = \"\"\"&lt;style&gt;\r\n@import \"https:\/\/fonts.googleapis.com\/css?family=Montserrat:300,400,700\";\r\n.rwd-table {\r\n  margin: 1em 0;\r\n  min-width: 300px;\r\n}\r\n.rwd-table tr {\r\n  border-top: 1px solid #ddd;\r\n  border-bottom: 1px solid #ddd;\r\n}\r\n.rwd-table th {\r\n  display: none;\r\n}\r\n.rwd-table td {\r\n  display: block;\r\n}\r\n.rwd-table td:first-child {\r\n  padding-top: .5em;\r\n}\r\n.rwd-table td:last-child {\r\n  padding-bottom: .5em;\r\n}\r\n.rwd-table td:before {\r\n  content: attr(data-th) \": \";\r\n  font-weight: bold;\r\n  width: 6.5em;\r\n  display: inline-block;\r\n}\r\n@media (min-width: 480px) {\r\n  .rwd-table td:before {\r\n    display: none;\r\n  }\r\n}\r\n.rwd-table th, .rwd-table td {\r\n  text-align: left;\r\n}\r\n@media (min-width: 480px) {\r\n  .rwd-table th, .rwd-table td {\r\n    display: table-cell;\r\n    padding: .25em .5em;\r\n  }\r\n  .rwd-table th:first-child, .rwd-table td:first-child {\r\n    padding-left: 0;\r\n  }\r\n  .rwd-table th:last-child, .rwd-table td:last-child {\r\n    padding-right: 0;\r\n  }\r\n}\r\n\r\n\r\nh1 {\r\n  font-weight: normal;\r\n  letter-spacing: -1px;\r\n  color: #34495E;\r\n}\r\n\r\n.rwd-table {\r\n  background: #34495E;\r\n  color: #fff;\r\n  border-radius: .4em;\r\n  overflow: hidden;\r\n}\r\n.rwd-table tr {\r\n  border-color: #46637f;\r\n}\r\n.rwd-table th, .rwd-table td {\r\n  margin: .5em 1em;\r\n}\r\n@media (min-width: 480px) {\r\n  .rwd-table th, .rwd-table td {\r\n    padding: 1em !important;\r\n  }\r\n}\r\n.rwd-table th, .rwd-table td:before {\r\n  color: #dd5;\r\n}\r\n&lt;\/style&gt;\r\n&lt;script&gt;\r\n  window.console = window.console || function(t) {};\r\n&lt;\/script&gt;\r\n&lt;script&gt;\r\n  if (document.location.search.match(\/type=embed\/gi)) {\r\n    window.parent.postMessage(\"resize\", \"*\");\r\n  }\r\n&lt;\/script&gt;\r\n\r\n\r\n&lt;h1&gt;Libro giornale&lt;\/h1&gt;\r\n&lt;table class=\"rwd-table\"&gt;\r\n&lt;tr&gt;\r\n\r\n  &lt;table class=\"rwd-table\"&gt;\r\n&lt;tr&gt;\r\n&lt;th&gt;Conto&lt;\/th&gt;\r\n&lt;th&gt;Descrizione&lt;\/th&gt;\r\n&lt;th&gt;Dare&lt;\/th&gt;\r\n&lt;th&gt;Avere&lt;\/th&gt;\r\n&lt;\/tr&gt;\r\n\r\n\r\n&lt;---conti---&gt;\r\n\r\n\r\n&lt;\/table&gt;\"\"\"\r\n\r\n# ================================== Python ===\r\n\r\nreplace = \"\"\"\r\nBanca x c\/c, Versamento,500 \u20ac,,\r\nDenaro in cassa, prelievo depositato in banca,,500 \u20ac,\r\nMerci c\/acquisto, ricevuta ft. n. 3, 100 \u20ac,,\r\n------,-----,-----,----,\r\nIVA a Credito, iva su ft. nr. 3, 22 \u20ac,,\r\nDebiti v\/fornitori, ft. 3,,122 \u20ac\r\n\"\"\"\r\n\r\nreplace = replace.split(\",\")\r\nlines = len(replace) \/\/ 4\r\n\r\nconto = \"\"\"\r\n&lt;tr&gt;\r\n&lt;td data-th=\"Movie Title\"&gt;{}&lt;\/td&gt;\r\n&lt;td data-th=\"Genre\"&gt;{}&lt;\/td&gt;\r\n&lt;td data-th=\"Year\"&gt;{}&lt;\/td&gt;\r\n&lt;td data-th=\"Gross\"&gt;{}&lt;\/td&gt;\r\n&lt;\/tr&gt;\"\"\"*lines\r\n\r\n\r\nprint(replace)\r\nconto = conto.format(*replace)\r\nhtml = html.replace(\"&lt;---conti---&gt;\", conto)\r\n\r\nwith open(myfile := \"table.html\", \"w\") as file:\r\n    file.write(html)\r\n\r\nos.startfile(myfile)\r\n<\/pre>\n<h2>Video about this code to make html table with Python<\/h2>\n<p><iframe loading=\"lazy\" title=\"Create a beautiful Html table with many data using Python\" width=\"747\" height=\"420\" src=\"https:\/\/www.youtube.com\/embed\/zfZuM3TmYS4?feature=oembed&amp;enablejsapi=1\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<h2>A version that uses pandas to make html tables from Excel<\/h2>\n<p>Go <a href=\"https:\/\/pythonprogramming.altervista.org\/make-html-tables-with-pandas\/\">here<\/a> to read about how to<\/p>\n<ul>\n<li>make a table into Excel<\/li>\n<li>grab it with Pandas<\/li>\n<li>get some style to it<\/li>\n<li>make an html table with &#8216;style&#8217;<\/li>\n<\/ul>\n<p>Click here to <a href=\"https:\/\/pythonprogramming.altervista.org\/make-html-tables-with-pandas\/\">create a table with style from Excel<\/a>.<\/p>\n<script>\r\nvar title = \"Python to Html\";\r\n\t\tvar links = [\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/make-html-tables-with-pandas\/\",\"Excel to Html Table with Pandas\"],\r\n\t\t\t\/\/ ------------------- 9.9.2019 ---------------------------------\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/transform-a-python-multiline-string-into-html-table\",\r\n\t\"From Python multiline string to Html table (9 9 2019)\"],\r\n\t\t\t\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/python-to-make-html-tables-code\/\",\r\n\t\t\t \"Python to make Html tables code (22 7 2019)\"],\r\n\t\t\t\r\n\t\t\t [\"https:\/\/pythonprogramming.altervista.org\/creare-una-tabella-html-con-python\/\",\r\n\t\t\t \"Create Html table with Python (24 4 2019)\"],\r\n\t\t\t\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/excel-data-to-html-report-the-easy-way\/\",\r\n\t\t\t \"From Excel to Html report easy (5 8 2019)\"],\r\n\t\t\t\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/1563-2\/\",\r\n\t\t\t \"Create a table, but with Python (14 11 2018)\"],\r\n\t\t\t\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/creare-una-tabella-con-python\/\",\r\n\t\t\t \"Creare una tabella Html con Python (18 11 2018)\"],\r\n\t\t\t\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/python-and-javascript-a-quiz-made-in-javascript\/\",\r\n\t\t\t \"A quiz made in javascript (3 9 2019)\"]\r\n\t\t];\r\n\t\t\r\n\t<\/script>\r\n<script>\r\n\t\r\nif (typeof next2 != \"undefined\"){let next2 = 0;}\r\n\t\r\nnext2 = 0;\r\n\thtml = \"\";\/\/<b style='color:coral;font-size:1.2em'>Other posts about \" + title + \"<\/b><br>\";\r\nfor (address of links) \r\n{\r\n\r\n\tif (next2 == 1){\r\n\t\thtml += \"<div style='background:coral'>\";\r\n\t\thtml += \"Next link => <a href='\" + address[0] + \"'>\" + address[1] + \"<\/a>\";\r\n\t\thtml += \"<\/div><br>\";\r\n\t\tnext2 = 0;\r\n\t}\r\n\tif (address[0] == document.URL) {\r\n\t\tnext2 = 1;\r\n\t}\r\n}\r\n\r\nif (typeof next != \"undefined\") {let next = 0;}\r\nif (typeof addressStart != \"undefined\") {let addressStart = \"\";}\r\nnext = 0;\r\naddressStart = \"<a href='\";\r\nfor (address of links) {\r\n\tif (next == 1){\r\n\t\thtml += \">>>\" + addressStart + address[0] + \"'>\" + address[1] + \"<\/a><br>\";\r\n\t\tnext = 0;\r\n\t}\r\n\telse if (addressStart + address[0] != document.URL)\r\n\t{\r\n\t\thtml += addressStart + address[0] + \"'>\" + address[1] + \"<\/a><br>\";\r\n\t}\r\n\telse\r\n\t{\r\n\t\tnext = 1;\r\n\t\tnext_address = address[0]\r\n\t\tnext_title = address[1]\r\n\t\thtml += \"<span style='color:gray'>\" + address[1] + \"<\/span><br>\";\r\n\t}\r\n\r\n}\r\n\r\n\thtml += `<span style=\"font-size:8px\">Powered by <a href=\"https:\/\/pythonprogramming.altervista.org\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2673\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2.png\" alt=\"\" width=\"70\" height=\"25\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2.png 156w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2-150x56.png 150w\" sizes=\"auto, (max-width: 70px) 100vw, 70px\" \/>pythonprogramming.altervista.org<\/a><\/span>`\r\n\thtml = \"<div style='background:yellow'>\" + html + \"<\/div>\";\r\n\tdocument.write(html)\r\n<\/script>\n<h4>Utilities<\/h4>\r\n<a href=\"https:\/\/pythonprogramming.altervista.org\/mind-map-with-python\/\">\r\n<img decoding=\"async\" src=\"https:\/\/i1.wp.com\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/12\/PYDOT.png?resize=321%2C229&ssl=1\"><\/a>\r\n<script>\r\nvar title = \"Utility\";\r\nvar links = [Mak\r\n\t\t\t e\r\n\t[\"https:\/\/pythonprogramming.altervista.org\/create-exe-from-python-script-with-images-with-pyinstaller\/\",\"Make Exe cointaining Images\"],\r\n\t[\"https:\/\/pythonprogramming.altervista.org\/send-email-to-different-people-with-python\/\",\"Send More Email at the same time\"],\r\n\t[\"https:\/\/pythonprogramming.altervista.org\/convert-some-data-into-another-format\/\",\"Convert data separation type into another\"],\r\n\t[\"https:\/\/pythonprogramming.altervista.org\/use-sublime-integrated-with-github\/\",\"Github + Sublime text 3\"],\r\n\t[\"https:\/\/pythonprogramming.altervista.org\/make-html-tables-with-pandas\/\",\"Excel to Html Table with Pandas\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/create-a-beautiful-html-table-with-python\/\",\"Beautiful Html Table made with Python\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/split-images-with-pil-aka-pillow-and-python-for-sprite-animation\/\",\"Crop images\"],\r\n\t[\"https:\/\/pythonprogramming.altervista.org\/sublime-text-snippets-how-to-use-them\/\",\"Snippets in Sublime Text\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/create-a-presentation-html-page-with-all-the-images-in-a-folder-in-a-second\/\",\"Create Html page with images using Python in seconds\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/mind-map-with-python\/\",\"Mind Maps & Python (Pydot)\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pixelize-an-image-with-pil-and-python\/\",\"Pixelize images\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/tkinter-to-make-pdf-fast-and-free-with-text-or-html\/\",\"Create PDF with Tkinter\"],\r\n[\"\",\"Python Lauches a file in Chrome 2\"],\r\n [\"https:\/\/pythonprogramming.altervista.org\/create-an-html-page-and-launch-it-with-cefpython3-in-chrome\/\",\r\n  \"Python launches a local file in Chrome 2\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/python-to-powerpoint-2-0\/\",\"Python vs Powerpoint v.2\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/what-if-you-got-dns_probe_finished_nxdomain-with-glitch-me-sites\/\",\"Cannot open a site (dns solution)\"],\r\n['https:\/\/pythonprogramming.altervista.org\/convert-text-to-html-docx-and-pdf\/', 'Covert txt to html, docx and pdf'],\r\n['https:\/\/pythonprogramming.altervista.org\/capture-screenshot-with-python-and-lackey\/', 'Capture screenshot'],\r\n['https:\/\/pythonprogramming.altervista.org\/check-if-a-directory-exists-with-python\/', 'Check if a directory exists'],\r\n['https:\/\/pythonprogramming.altervista.org\/how-to-copy-all-the-files-in-a-directory\/', 'Copy all files in a folder'],\r\n['https:\/\/pythonprogramming.altervista.org\/put-some-order-in-my-files-with-python-with-filecollector\/', 'Copy many file on pc in one folder'],\r\n['https:\/\/pythonprogramming.altervista.org\/creare-una-tabella-con-python\/', 'Creare tabelle html con python'],\r\n['https:\/\/pythonprogramming.altervista.org\/make-an-image-with-text-with-python\/', 'Create an image with text'],\r\n['https:\/\/pythonprogramming.altervista.org\/create-an-exe-with-pyinstaller\/', 'Exe from .py (pyinstaller)'],\r\n['https:\/\/pythonprogramming.altervista.org\/create-a-test-in-html-from-a-txt-file\/', 'Format test in html from txt file'],\r\n['https:\/\/pythonprogramming.altervista.org\/freezing-dependencies-hell-on-python-2018\/', 'Freeze dependencies'],\r\n['https:\/\/pythonprogramming.altervista.org\/google-text-to-speech-example-of-gui-to-create-mp3-from-text\/', 'GUI to create MP3 (gtts)'],\r\n['https:\/\/pythonprogramming.altervista.org\/git-basic-commands-to-keep-track-of-your-project\/', 'Git and Github'],\r\n['https:\/\/pythonprogramming.altervista.org\/grab-a-web-page-without-strange-characters\/', 'Grab a web page without strange characters'],\r\n['https:\/\/pythonprogramming.altervista.org\/grab-the-text-from-a-word-document\/', 'Grab text from Word documents'],\r\n['https:\/\/pythonprogramming.altervista.org\/grab-data-text-from-the-web-with-python-and-urllib\/', 'Grab web text'],\r\n['https:\/\/pythonprogramming.altervista.org\/1563-2\/', 'Html Tables with Python'],\r\n['https:\/\/pythonprogramming.altervista.org\/join-all-images-vertically-or-horizontally\/', 'Join Images'],\r\n['https:\/\/pythonprogramming.altervista.org\/repl-with-sublime-keybinding-to-use-python-interactively\/', 'Keybind Sublime'],\r\n['https:\/\/pythonprogramming.altervista.org\/how-to-get-all-the-file-in-a-directory\/', 'List all files in the directory'],\r\n['https:\/\/pythonprogramming.altervista.org\/all-the-files-in-your-hard-drive-with-os-walk\/', \"List all hard drive's files\"],\r\n['https:\/\/pythonprogramming.altervista.org\/transform-a-png-in-a-thumbnail\/', 'Make a thumbnail (PIL)'],\r\n['https:\/\/pythonprogramming.altervista.org\/a-simple-calculator-with-tkinter\/', 'Mini-Calculator'],\r\n['https:\/\/pythonprogramming.altervista.org\/how-to-merge-all-pdf-files-present-in-a-folder\/', 'Pdf merger'],\r\n['https:\/\/pythonprogramming.altervista.org\/tkinter-a-program-start-mp4-with-ffplay\/', 'Play video with ffplay \/ os'],\r\n['https:\/\/pythonprogramming.altervista.org\/png-to-gif\/', 'Png to Gif (PIL)'],\r\n['https:\/\/pythonprogramming.altervista.org\/using-the-re-module-to-grab-numbers-in-a-text-and-make-different-tests-with-few-code\/', 'Practical example with Regex'],\r\n['https:\/\/pythonprogramming.altervista.org\/python-to-make-svg-easier-for-html-pages\/', 'Python and SVG'],\r\n['https:\/\/pythonprogramming.altervista.org\/make-python-use-your-modules\/', 'Python modules finder'],\r\n['https:\/\/pythonprogramming.altervista.org\/how-to-read-and-write-files-in-python\/', 'Read and write files'],\r\n['https:\/\/pythonprogramming.altervista.org\/rename-all-files-in-a-directory-with-python\/', 'Rename all files'],\r\n['https:\/\/pythonprogramming.altervista.org\/find-all-the-files-on-your-computer\/', 'Search all files of a type'],\r\n['https:\/\/pythonprogramming.altervista.org\/split-square-images-into-many-images-with-python-and-image_slicer\/', 'Split images'],\r\n['https:\/\/pythonprogramming.altervista.org\/split-an-image-and-rename-the-output-images\/', 'Split images'],\r\n['https:\/\/pythonprogramming.altervista.org\/python-inserting-subtitles-to-youtube-videos-on-your-wordpress-site\/', 'Subtitles for Youtube'],\r\n['https:\/\/pythonprogramming.altervista.org\/from-text-to-mp3-with-gtts-reading-external-file\/', 'Text to Mp3 (gtts)'],\r\n['https:\/\/pythonprogramming.altervista.org\/if-you-get-an-error-using-gtts-module\/', 'The gtts error'],\r\n['https:\/\/pythonprogramming.altervista.org\/create-a-true-false-test-with-random-order-of-sentences-with-python\/', 'True false test with Python'],\r\n['https:\/\/pythonprogramming.altervista.org\/unzip-and-unrar-to-extract-zipped-files-with-python-and-7zip\/', 'Unzip and Unrar'],\r\n['https:\/\/pythonprogramming.altervista.org\/use-your-own-module-on-python\/', 'Use your own modules'],\r\n['https:\/\/pythonprogramming.altervista.org\/download-a-video-from-youtube\/', 'Youtube video download']\r\n\t\t];\r\n<\/script>\r\n\r\n\r\n<script>\r\n\t\r\nif (typeof next2 != \"undefined\"){let next2 = 0;}\r\n\t\r\nnext2 = 0;\r\n\thtml = \"\";\/\/<b style='color:coral;font-size:1.2em'>Other posts about \" + title + \"<\/b><br>\";\r\nfor (address of links) \r\n{\r\n\r\n\tif (next2 == 1){\r\n\t\thtml += \"<div style='background:coral'>\";\r\n\t\thtml += \"Next link => <a href='\" + address[0] + \"'>\" + address[1] + \"<\/a>\";\r\n\t\thtml += \"<\/div><br>\";\r\n\t\tnext2 = 0;\r\n\t}\r\n\tif (address[0] == document.URL) {\r\n\t\tnext2 = 1;\r\n\t}\r\n}\r\n\r\nif (typeof next != \"undefined\") {let next = 0;}\r\nif (typeof addressStart != \"undefined\") {let addressStart = \"\";}\r\nnext = 0;\r\naddressStart = \"<a href='\";\r\nfor (address of links) {\r\n\tif (next == 1){\r\n\t\thtml += \">>>\" + addressStart + address[0] + \"'>\" + address[1] + \"<\/a><br>\";\r\n\t\tnext = 0;\r\n\t}\r\n\telse if (addressStart + address[0] != document.URL)\r\n\t{\r\n\t\thtml += addressStart + address[0] + \"'>\" + address[1] + \"<\/a><br>\";\r\n\t}\r\n\telse\r\n\t{\r\n\t\tnext = 1;\r\n\t\tnext_address = address[0]\r\n\t\tnext_title = address[1]\r\n\t\thtml += \"<span style='color:gray'>\" + address[1] + \"<\/span><br>\";\r\n\t}\r\n\r\n}\r\n\r\n\thtml += `<span style=\"font-size:8px\">Powered by <a href=\"https:\/\/pythonprogramming.altervista.org\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2673\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2.png\" alt=\"\" width=\"70\" height=\"25\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2.png 156w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2-150x56.png 150w\" sizes=\"auto, (max-width: 70px) 100vw, 70px\" \/>pythonprogramming.altervista.org<\/a><\/span>`\r\n\thtml = \"<div style='background:yellow'>\" + html + \"<\/div>\";\r\n\tdocument.write(html)\r\n<\/script>\r\n\r\n\n","protected":false},"excerpt":{"rendered":"How to make html tables with Python\n<a class=\"moretag\" href=\"https:\/\/pythonprogramming.altervista.org\/create-a-beautiful-html-table-with-python\/\"> [...]<\/a>","protected":false},"author":1,"featured_media":4947,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[370,542,704],"tags":[706,321,4,705,320,529],"class_list":["post-4943","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-html","category-html-with-python","category-table","tag-automate-html","tag-html","tag-python","tag-script","tag-table","tag-tables"],"avopt_banners_inside_post":true,"avopt_banners_on_page":true,"av_copy_from":"","av_sharing_message":"","av_sharing_allowed":true,"av_sharing_on":{"fb":[],"tw":[]},"av_allow_affiliate_banner":false,"av_allow_affiliate_multi_banner":false,"av_show_affiliation_buy_button":false,"av_post_rating":true,"av_have_post_rating_value":false,"av_is_artificial_intelligence_content":false,"_links":{"self":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/4943","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/comments?post=4943"}],"version-history":[{"count":5,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/4943\/revisions"}],"predecessor-version":[{"id":4967,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/4943\/revisions\/4967"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media\/4947"}],"wp:attachment":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media?parent=4943"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/categories?post=4943"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/tags?post=4943"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}