{"id":1761,"date":"2019-03-28T06:22:20","date_gmt":"2019-03-28T05:22:20","guid":{"rendered":"https:\/\/pythonprogramming.altervista.org\/?p=1761"},"modified":"2019-03-28T06:46:18","modified_gmt":"2019-03-28T05:46:18","slug":"python-to-make-svg-easier-for-html-pages","status":"publish","type":"post","link":"https:\/\/pythonprogramming.altervista.org\/python-to-make-svg-easier-for-html-pages\/","title":{"rendered":"Python to make svg easier for html pages"},"content":{"rendered":"<p>I like to make some svg files to use it for simple image schemes, rather than use regular images that costs memory and time to load, but they are a bit too annoying to build up (without a graphic program). So I tryed this solution. I started with just lines and text.<\/p>\n<pre class=\"lang:default decode:true\"># ===================== Svg construction =================\r\ndef svg_init(x,y):\r\n\t\"\"\"Initializing the svg code\"\"\"\r\n\treturn f\"&lt;br&gt;&lt;svg height='{x}' width='{y}'&gt;\"\r\n# ======================= text ===========================\r\ndef svg_text(t,clr,x,y):\r\n\t\"\"\" a text with color, x and y position \"\"\"\r\n\treturn f\"&lt;text x='{x}' y='{y}' fill='{clr}'&gt;{t}&lt;\/text&gt;\"\r\n# ======================= line ===========================\r\ndef svg_line(xy,xy2,c,s):\r\n\t\"\"\" A line \"\"\"\r\n\treturn f\"&lt;line x1='{xy[0]}' y1='{xy[1]}' x2='{xy2[0]}' y2='{xy2[1]}' style='stroke:rgb({c[0]},{c[1]},{c[2]});stroke-width:{s}' \/&gt;\"\r\n\r\ndef svg_end():\r\n\t\"\"\" Closing the svg html code \"\"\"\r\n\treturn \"Sorry your browser does not support inline SVG&lt;\/svg&gt;\"\r\n# ========================================================<\/pre>\n<p>Whith this code I created a function for the start and end of the svg image. In the start I use the arguments for the height and width. Then I have a function for the text with the text, the color and the coordinates of the text inside the &#8216;box&#8217; and a function for the line, with a list of the coordinates of the first point (xy), of the second (xy2) and for the color (c). The s is for the stroke width.<\/p>\n<pre class=\"lang:default decode:true \">def gBEP():\r\n\tx = [svg_init(228,500),\r\n\tsvg_text(\"\u20ac\",\"green\",0,15),\r\n\tsvg_text(\"q\",\"green\",480,220),\r\n\tsvg_text(\"RT\",\"green\",480,80 ),\r\n\r\n\t# Ricavi\r\n\tsvg_line([10,210],[800,0],[0,0,0],2),\r\n\t# CT = CF + cvq\r\n\tsvg_text(\"CF\",\"red\",480,100),\r\n\tsvg_line([10,100],[500,100],[200,0,0],2),\r\n\tsvg_line([10,210],[500,210],[0,0,0],2),\r\n\tsvg_line([10,210],[10,0],[0,0,0],2),\r\n\tsvg_end()]\r\n\treturn \"\".join(x)<\/pre>\n<p>In the ecxample above I created a grafic with 3 texts and 4 lines. As you can see, the code is very nite, if you compare it to the code you should need to do the same with svg. Look at it below:<\/p>\n<pre class=\"lang:default decode:true \">&lt;br&gt;&lt;svg height='228' width='500'&gt;\r\n&lt;text x='0' y='15' fill='green'&gt;\u20ac&lt;\/text&gt;\r\n&lt;text x='480' y='220' fill='green'&gt;q&lt;\/text&gt;\r\n&lt;text x='480' y='80' fill='green'&gt;RT&lt;\/text&gt;\r\n&lt;line x1='10' y1='210' x2='800' y2='0' style='stroke:rgb(0,0,0);stroke-width:2' \/&gt;\r\n&lt;text x='480' y='100' fill='red'&gt;CF&lt;\/text&gt;\r\n&lt;line x1='10' y1='100' x2='500' y2='100' style='stroke:rgb(200,0,0);stroke-width:2' \/&gt;\r\n&lt;line x1='10' y1='210' x2='500' y2='210' style='stroke:rgb(0,0,0);stroke-width:2' \/&gt;\r\n&lt;line x1='10' y1='210' x2='10' y2='0' style='stroke:rgb(0,0,0);stroke-width:2' \/&gt;\r\nSorry your browser does not support inline SVG&lt;\/svg&gt;<\/pre>\n<p>The result is the same:<\/p>\n<br><svg height='228' width='500'><text x='0' y='15' fill='green'>\u20ac<\/text><text x='480' y='220' fill='green'>q<\/text><text x='480' y='80' fill='green'>RT<\/text><line x1='10' y1='210' x2='800' y2='0' style='stroke:rgb(0,0,0);stroke-width:2' \/><text x='480' y='100' fill='red'>CF<\/text><line x1='10' y1='100' x2='500' y2='100' style='stroke:rgb(200,0,0);stroke-width:2' \/><line x1='10' y1='210' x2='500' y2='210' style='stroke:rgb(0,0,0);stroke-width:2' \/><line x1='10' y1='210' x2='10' y2='0' style='stroke:rgb(0,0,0);stroke-width:2' \/>Sorry your browser does not support inline SVG<\/svg>\n<h2>An example of possible use of the code<\/h2>\n<pre class=\"lang:default decode:true \">#bep.py\r\nimport os\r\nfrom random import choice\r\n\r\n\r\nsol = []\r\n\r\ndef createfile(filename, content):\r\n\t\"Create a file\"\r\n\ttry:\r\n\t\twith open(filename, \"w\", encoding=\"utf-8\") as file:\r\n\t\t\tfile.write(content)\r\n\t\tos.system(filename)\r\n\texcept:\r\n\t\tprint(\"You must use an argument for the filename ('prova.html') and another for the content ('&lt;b&gt;Hello&lt;\/b&gt; World')\")\r\n\r\ndef generaEsercizio(num):\r\n\tglobal pc\r\n\tCF = \"\"\"\r\n100.000\r\n120.000\r\n160.000\r\n80.000\r\n60.000\r\n\"\"\".splitlines()[1:]\r\n\tCF= [x.replace(\".\",\"\") for x in CF]\r\n\tCF= [int(x) for x in CF]\r\n\t# prezzo e costi variabili\r\n\tpc = [5,6,8,9,10,12]\r\n\tp = [2,3,4,6,9]\r\n\r\n\tCF = choice(CF)\r\n\tcv = choice(pc)\r\n\tp = cv + choice(p)\r\n\tdati = [CF,cv,p]\r\n\ttesto = \"Abbiamo costi fissi per {}, costi variabili per {} e un prezzo pari a {}. Calcola la quantit\u00e0 di prodotti da vendere (q) che rende consente di recuperare tutti i costi. Disegna il diagramma di redditivit\u00e0\".format(*dati)\r\n\tsol.append(\"(\" + str(num) + \" \" + str(int(int(dati[0])\/(dati[2]-dati[1]))) + \") \")\r\n\treturn testo\r\n\r\n# ===================== Svg construction =================\r\ndef svg_init(x,y):\r\n\t\"\"\"Initializing the svg code\"\"\"\r\n\treturn f\"&lt;br&gt;&lt;svg height='{x}' width='{y}'&gt;\"\r\n# ======================= text ===========================\r\ndef svg_text(t,clr,x,y):\r\n\t\"\"\" a text with color, x and y position \"\"\"\r\n\treturn f\"&lt;text x='{x}' y='{y}' fill='{clr}'&gt;{t}&lt;\/text&gt;\"\r\n# ======================= line ===========================\r\ndef svg_line(xy,xy2,c,s):\r\n\t\"\"\" A line \"\"\"\r\n\treturn f\"&lt;line x1='{xy[0]}' y1='{xy[1]}' x2='{xy2[0]}' y2='{xy2[1]}' style='stroke:rgb({c[0]},{c[1]},{c[2]});stroke-width:{s}' \/&gt;\"\r\n\r\ndef svg_end():\r\n\t\"\"\" Closing the svg html code \"\"\"\r\n\treturn \"Sorry your browser does not support inline SVG&lt;\/svg&gt;\"\r\n# ========================================================\r\n\r\ndef pagebreak():\r\n\treturn \"&lt;div style='page-break-after:always'&gt;&lt;\/div&gt;\"\r\n\r\ndef gBEP():\r\n\tx = [svg_init(228,500),\r\n\tsvg_text(\"\u20ac\",\"green\",0,15),\r\n\tsvg_text(\"q\",\"green\",480,220),\r\n\tsvg_text(\"RT\",\"green\",480,80 ),\r\n\r\n\t# Ricavi\r\n\tsvg_line([10,210],[800,0],[0,0,0],2),\r\n\t# CT = CF + cvq\r\n\tsvg_text(\"CF\",\"red\",480,100),\r\n\tsvg_line([10,100],[500,100],[200,0,0],2),\r\n\tsvg_line([10,210],[500,210],[0,0,0],2),\r\n\tsvg_line([10,210],[10,0],[0,0,0],2),\r\n\tsvg_end()]\r\n\treturn \"\".join(x)\r\n\r\nhtml = \"\"\r\ndef single():\r\n\tglobal html\r\n\tglobal sol\r\n\tfor n in range(5):\r\n\t\thtml += str(n+1) + \" \" + generaEsercizio(n+1)\r\n\t\thtml += \"&lt;br&gt;&lt;br&gt;\"\r\n\thtml += \" - \".join(sol)\r\n\tsol = []\r\n\thtml += gBEP();\r\n\thtml += gBEP();\r\n\thtml += pagebreak()\r\n\r\nfor i in range(15):\r\n\tsingle()\r\n\r\ncreatefile(\"es1.html\", html)<\/pre>\n<p>This is a part of the output:<\/p>\n<div>1 Abbiamo costi fissi per 60000, costi variabili per 6 e un prezzo pari a 8. Calcola la quantit\u00e0 di prodotti da vendere (q) che rende consente di recuperare tutti i costi. Disegna il diagramma di redditivit\u00e0<br><br>2 Abbiamo costi fissi per 100000, costi variabili per 10 e un prezzo pari a 13. Calcola la quantit\u00e0 di prodotti da vendere (q) che rende consente di recuperare tutti i costi. Disegna il diagramma di redditivit\u00e0<br><br>3 Abbiamo costi fissi per 160000, costi variabili per 10 e un prezzo pari a 12. Calcola la quantit\u00e0 di prodotti da vendere (q) che rende consente di recuperare tutti i costi. Disegna il diagramma di redditivit\u00e0<br><br>4 Abbiamo costi fissi per 120000, costi variabili per 5 e un prezzo pari a 11. Calcola la quantit\u00e0 di prodotti da vendere (q) che rende consente di recuperare tutti i costi. Disegna il diagramma di redditivit\u00e0<br><br>5 Abbiamo costi fissi per 80000, costi variabili per 6 e un prezzo pari a 9. Calcola la quantit\u00e0 di prodotti da vendere (q) che rende consente di recuperare tutti i costi. Disegna il diagramma di redditivit\u00e0<br><br>(1 30000)  - (2 33333)  - (3 80000)  - (4 20000)  - (5 26666) <br><svg height='228' width='500'><text x='0' y='15' fill='green'>\u20ac<\/text><text x='480' y='220' fill='green'>q<\/text><text x='480' y='80' fill='green'>RT<\/text><line x1='10' y1='210' x2='800' y2='0' style='stroke:rgb(0,0,0);stroke-width:2' \/><text x='480' y='100' fill='red'>CF<\/text><line x1='10' y1='100' x2='500' y2='100' style='stroke:rgb(200,0,0);stroke-width:2' \/><line x1='10' y1='210' x2='500' y2='210' style='stroke:rgb(0,0,0);stroke-width:2' \/><line x1='10' y1='210' x2='10' y2='0' style='stroke:rgb(0,0,0);stroke-width:2' \/>Sorry your browser does not support inline SVG<\/svg><br><svg height='228' width='500'><text x='0' y='15' fill='green'>\u20ac<\/text><text x='480' y='220' fill='green'>q<\/text><text x='480' y='80' fill='green'>RT<\/text><line x1='10' y1='210' x2='800' y2='0' style='stroke:rgb(0,0,0);stroke-width:2' \/><text x='480' y='100' fill='red'>CF<\/text><line x1='10' y1='100' x2='500' y2='100' style='stroke:rgb(200,0,0);stroke-width:2' \/><line x1='10' y1='210' x2='500' y2='210' style='stroke:rgb(0,0,0);stroke-width:2' \/><line x1='10' y1='210' x2='10' y2='0' style='stroke:rgb(0,0,0);stroke-width:2' \/>Sorry your browser does not support inline SVG<\/svg><div style='page-break-after:always'><\/\r\n\tdiv>\r\n\t<\/div>\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":"I like to make some svg files to use it for simple image schemes, rather than use regular images that costs memory and \n<a class=\"moretag\" href=\"https:\/\/pythonprogramming.altervista.org\/python-to-make-svg-easier-for-html-pages\/\"> [...]<\/a>","protected":false},"author":1,"featured_media":1766,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[178],"tags":[321,4,345],"class_list":["post-1761","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-utility","tag-html","tag-python","tag-svg"],"avopt_banners_inside_post":true,"avopt_banners_on_page":true,"av_copy_from":"","av_sharing_message":"","av_sharing_allowed":false,"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\/1761","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=1761"}],"version-history":[{"count":5,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/1761\/revisions"}],"predecessor-version":[{"id":1768,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/1761\/revisions\/1768"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media\/1766"}],"wp:attachment":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media?parent=1761"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/categories?post=1761"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/tags?post=1761"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}