{"id":1626,"date":"2018-12-09T07:42:16","date_gmt":"2018-12-09T06:42:16","guid":{"rendered":"https:\/\/pythonprogramming.altervista.org\/?p=1626"},"modified":"2018-12-09T10:42:04","modified_gmt":"2018-12-09T09:42:04","slug":"pgp-aka-pygamepresentation-project","status":"publish","type":"post","link":"https:\/\/pythonprogramming.altervista.org\/pgp-aka-pygamepresentation-project\/","title":{"rendered":"PGP aka PyPresent a Presentation with Python project"},"content":{"rendered":"<h1>Make a presentation with Python and Pygame<\/h1>\n<p><a href=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/12\/Cattura.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1629\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/12\/Cattura.png\" alt=\"\" width=\"470\" height=\"266\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/12\/Cattura.png 470w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/12\/Cattura-320x181.png 320w\" sizes=\"auto, (max-width: 470px) 100vw, 470px\" \/><\/a><\/p>\n<p>If you want to impress your audience you have to create something unique. You will use powerpoint? I do not think so. If you are a programmer, you want to use Python and if you want envolvment you will use the pygame libraries, right? Let&#8217;s dive into this project and show you a way, my own way, to do it, step by step.<\/p>\n<p>A long journey starts from a little step. (anonymous)<\/p>\n<h2>First things first (the window)<\/h2>\n<p>The following code will make a window for you. Nothing in it, but you can close it.<\/p>\n<pre class=\"lang:default decode:true \">import pygame as pg\r\n\r\n# THE SCREEN SIZE AND DISPLAY + WINDOW NAME + CLOCK\r\ndef windowinit():\r\n\t\"\"\"Initialize the window with a way to quit it\"\"\"\r\n\tW, H = 800, 600\r\n\tdisplay = pg.display.set_mode((W, H))\r\n\tpg.display.set_caption(\"Mario Game\")\r\n\tclock = pg.time.Clock()\r\n\tcrashed = False\r\n\twhile not crashed:\r\n\t\tfor event in pg.event.get():\r\n\t\t\tif event.type == pg.QUIT:\r\n\t\t\t\tcrashed = True\r\n\t\tpg.display.update()\r\n\t\tclock.tick(60)\r\n\tpg.quit()\r\n\r\n\r\nif __name__ == \"__main__\":\r\n\twindowinit()<\/pre>\n<h2>Let&#8217;s add some text to the window<\/h2>\n<p>Let&#8217;s create a class Text that displays the text of single objects<\/p>\n<pre class=\"lang:default decode:true\">class Text:\r\n\tdef __init__(self, screen, t, x=0, y=0, dim = 30, color=(0,0,0)):\r\n\t\tself.myfont = pg.font.SysFont(\"Comic sans MS\", dim)\r\n\t\tself.textsurface = self.myfont.render(t, False, color)\r\n\t\tscreen.blit(self.textsurface,(x,y))<\/pre>\n<p>In the function windowinit() we will create a list of string that will be our rows of text for each slide and then we will iterate the list with a for loop that will call for each string the class Text to render the text of the string in different positions (one under the previous).<\/p>\n<pre class=\"lang:default decode:true \">\ttextrows = [\r\n\t\t\t\t\"FULL COSTING\",\r\n\t\t\t\t\"Metodo per attribuire i costi ad\",\r\n\t\t\t\t\" un oggetto di calcolo (un prodotto).\",\r\n\t\t\t\t\" -------------------------\",\r\n\t\t\t\t\"Costi diretti + indiretti\",\r\n\t\t\t\t\"Costi diretti: facili da calcolare\",\r\n\t\t\t\t\"Costi indiretti:\",\r\n\t\t\t\t\"    sono comuni a pi\u00f9 oggetti di calcolo\"\r\n\t\t\t\t\" e quindi occorre dividere i\",\r\n\t\t\t\t\" costi comuni in base a dei criteri di riparto.\"\r\n\t\t\t\t]\r\n\tz = 0\r\n\tdim = 50\r\n\tfor row in textrows:\r\n\t\tif z==0:\r\n\t\t\ttextsurface = Text(screen, row, 0, z, 50, (0,255,0))\r\n\t\telse:\r\n\t\t\ttextsurface = Text(screen, row, 0, z, 50, (255,255,0))\r\n\t\tz += dim<\/pre>\n<p>The whole code will be this:<\/p>\n<pre class=\"lang:default decode:true \">import pygame as pg\r\n\r\n# THE SCREEN SIZE AND DISPLAY + WINDOW NAME + CLOCK\r\n\r\npg.init()\r\npg.font.init()\r\n\r\nclass Text:\r\n\tdef __init__(self, screen, t, x=0, y=0, dim = 30, color=(0,0,0)):\r\n\t\tself.myfont = pg.font.SysFont(\"Comic sans MS\", dim)\r\n\t\tself.textsurface = self.myfont.render(t, False, color)\r\n\t\tscreen.blit(self.textsurface,(x,y))\r\n\r\n\r\ndef windowinit():\r\n\t\"\"\"Initialize the window with a way to quit it\"\"\"\r\n\tW, H = 1100, 600\r\n\tscreen = pg.display.set_mode((W, H))\r\n\tpg.display.set_caption(\"Mario Game\")\r\n\tclock = pg.time.Clock()\r\n\t# ======== text =================\r\n\ttextrows = [\r\n\t\t\t\t\"FULL COSTING\",\r\n\t\t\t\t\"Metodo per attribuire i costi ad\",\r\n\t\t\t\t\" un oggetto di calcolo (un prodotto).\",\r\n\t\t\t\t\" -------------------------\",\r\n\t\t\t\t\"Costi diretti + indiretti\",\r\n\t\t\t\t\"Costi diretti: facili da calcolare\",\r\n\t\t\t\t\"Costi indiretti:\",\r\n\t\t\t\t\"    sono comuni a pi\u00f9 oggetti di calcolo\"\r\n\t\t\t\t\" e quindi occorre dividere i\",\r\n\t\t\t\t\" costi comuni in base a dei criteri di riparto.\"\r\n\t\t\t\t]\r\n\tz = 0\r\n\tdim = 50\r\n\tfor row in textrows:\r\n\t\tif z==0:\r\n\t\t\ttextsurface = Text(screen, row, 0, z, 50, (0,255,0))\r\n\t\telse:\r\n\t\t\ttextsurface = Text(screen, row, 0, z, 50, (255,255,0))\r\n\t\tz += dim\r\n\tcrashed = False\r\n\twhile not crashed:\r\n\t\tfor event in pg.event.get():\r\n\t\t\tif event.type == pg.QUIT:\r\n\t\t\t\tcrashed = True\r\n\t\tpg.display.update()\r\n\t\tclock.tick(60)\r\n\tpg.quit()\r\n\r\n\r\nif __name__ == \"__main__\":\r\n\twindowinit()\r\n<\/pre>\n<p>Below is the first slide, now, let&#8217;s add the others.<\/p>\n<p><a href=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/12\/present.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1631\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/12\/present.png\" alt=\"\" width=\"464\" height=\"266\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/12\/present.png 1104w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/12\/present-320x183.png 320w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/12\/present-768x440.png 768w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/12\/present-960x550.png 960w\" sizes=\"auto, (max-width: 464px) 100vw, 464px\" \/><\/a><\/p>\n<h2>The whole code of the program<\/h2>\n<pre class=\"lang:default decode:true \">import pygame as pg\r\nimport time\r\n\r\n# THE SCREEN SIZE AND DISPLAY + WINDOW NAME + CLOCK\r\n# PygamePresent\r\npg.init()\r\npg.font.init()\r\n\r\nclass Text:\r\n\tdef __init__(self, screen, t, x=0, y=0, dim = 30, color=(0,0,0)):\r\n\t\tself.myfont = pg.font.SysFont(\"Comic sans MS\", dim)\r\n\t\tself.textsurface = self.myfont.render(t, False, color)\r\n\t\tscreen.blit(self.textsurface,(x,y))\r\n\r\n\r\n\r\ndef nextpage(numpage):\r\n\tz = 0\r\n\r\n\tfor row in textrows[numpage]:\r\n\t\tif z==0:\r\n\t\t\ttextsurface = Text(screen, row, 0, z, 50, (0,255,0))\r\n\t\telse:\r\n\t\t\ttextsurface = Text(screen, row, 0, z, 50, (255,255,0))\r\n\t\tz += dim\r\n\r\ndef windowinit():\r\n\t\"\"\"Initialize the window with a way to quit it\"\"\"\r\n\tglobal textrows, screen, dim\r\n\tW, H = 1100, 600\r\n\tscreen = pg.display.set_mode((W, H))\r\n\tpg.display.set_caption(\"Mario Game\")\r\n\tclock = pg.time.Clock()\r\n\t# ======== text =================\r\n\ttextrows = [\r\n\t\t\t\t\r\n\t\t\t\t#page 1 - This appears\r\n\t\t\t\t[\"Giovanni Gatto presenta:\"],\r\n\r\n\t\t\t\t[\"FULL COSTING\",\r\n\t\t\t\t\"Metodo per attribuire i costi ad\",\r\n\t\t\t\t\" un oggetto di calcolo (un prodotto).\",\r\n\t\t\t\t\" -------------------------\",\r\n\t\t\t\t\"Costi diretti + indiretti\",\r\n\t\t\t\t\"Costi diretti: facili da calcolare\",\r\n\t\t\t\t\"Costi indiretti:\",\r\n\t\t\t\t\"    sono comuni a pi\u00f9 oggetti di calcolo\"\r\n\t\t\t\t\" e quindi occorre dividere i\",\r\n\t\t\t\t\" costi comuni in base a dei criteri di riparto.\"\r\n\t\t\t\t],\r\n\r\n\t\t\t\t# Di cosa parlo?\r\n\t\t\t\t[\"Terza slide\"]\r\n\r\n\r\n\t\t\t\t\r\n\t\t\t\t# end of list of lists\r\n\t\t\t\t]\r\n\tz = 0\r\n\tdim = 50\r\n\tnumpage = 0\r\n\tfor row in textrows[0]:\r\n\t\tif z==0:\r\n\t\t\ttextsurface = Text(screen, row, 0, z, 50, (0,255,0))\r\n\t\telse:\r\n\t\t\ttextsurface = Text(screen, row, 0, z, 50, (255,255,0))\r\n\t\tz += dim\r\n\tcrashed = False\r\n\twhile not crashed:\r\n\t\tfor event in pg.event.get():\r\n\t\t\tif event.type == pg.QUIT:\r\n\t\t\t\tcrashed = True\r\n\t\t\telif event.type == pg.MOUSEBUTTONUP:\r\n\t\t\t\tnumpage += 1\r\n\t\t\t\tif numpage &lt; len(textrows):\r\n\t\t\t\t\tscreen.fill((0,0,0))\r\n\t\t\t\t\tnextpage(numpage)\r\n\t\t\t\telif numpage == len(textrows):\r\n\t\t\t\t\tscreen.fill((0,0,0))\r\n\t\t\t\t\tText(screen, \"Fine della presentazione\", 0, 50, 50, (0,255,0))\r\n\t\t\t\t\tText(screen, \"Grazie per la cortese attenzione\", 0, 150, 50, (255,255,0))\r\n\t\t\t\t\tnumpage = 0\r\n\t\t\t\t\t#time.sleep(2)\r\n\r\n\t\tpg.display.update()\r\n\t\tclock.tick(60)\r\n\tpg.quit()\r\n\r\n\r\nif __name__ == \"__main__\":\r\n\twindowinit()\r\n<\/pre>\n<h2>Some adjustement in the code<\/h2>\n<pre class=\"lang:default decode:true \">import pygame as pg\r\nimport time\r\n\r\n# THE SCREEN SIZE AND DISPLAY + WINDOW NAME + CLOCK\r\n# PygamePresent\r\npg.init()\r\npg.font.init()\r\n\r\nclass Text:\r\n\tdef __init__(self, screen, t, x=0, y=0, dim = 30, color=(0,0,0)):\r\n\t\tself.myfont = pg.font.SysFont(\"Comic sans MS\", dim)\r\n\t\tself.textsurface = self.myfont.render(t, False, color)\r\n\t\tscreen.blit(self.textsurface,(x,y))\r\n\r\n\r\n\r\ndef nextpage(numpage):\r\n\tz = 0\r\n\tslide = textrows[numpage].splitlines()[1:]\r\n\tfor row in slide:\r\n\t\tif z==0:\r\n\t\t\ttextsurface = Text(screen, row, 0, z, 50, (0,255,0))\r\n\t\telse:\r\n\t\t\ttextsurface = Text(screen, row, 0, z, 50, (255,255,0))\r\n\t\tz += dim\r\n\r\ndef windowinit():\r\n\t\"\"\"Initialize the window with a way to quit it\"\"\"\r\n\tglobal textrows, screen, dim\r\n\tW, H = 1100, 600\r\n\tscreen = pg.display.set_mode((W, H))\r\n\tpg.display.set_caption(\"Mario Game\")\r\n\tclock = pg.time.Clock()\r\n\t# ======== text =================\r\n\ttextrows = [\r\n\"\"\"\r\nL'azienda\r\n\"\"\",\r\n\r\n\"\"\"\r\nL'azienda \u00e8 formata da:\r\n- organizzazione\r\n- beni economici\r\n- persone\r\n- fine\r\n\"\"\",\r\n\"\"\"\r\nL'azienda \u00e8 formata da:\r\n- organizzazione: durevole\r\n----------------------------------\r\nNon si pu\u00f2 trattare di un affare\r\nuna tantum. L'azienda \u00e8 destinata\r\na durare a tempo indefinito.\r\n----------------------------------\r\n\"\"\",\r\n\"\"\"\r\nL'azienda \u00e8 formata inoltre da:\r\n-------------------------\r\n- beni economici:\r\nSi dividono in:\r\n  - beni durevoli\r\n  - beni a breve ciclo di utilizzo\r\n\"\"\",\r\n]\r\n\r\n\tz = 0\r\n\tdim = 50\r\n\tnumpage = 0\r\n\tcrashed = False\r\n\tnextpage(0)\r\n\twhile not crashed:\r\n\t\tfor event in pg.event.get():\r\n\t\t\tif event.type == pg.QUIT:\r\n\t\t\t\tcrashed = True\r\n\t\t\telif event.type == pg.MOUSEBUTTONUP:\r\n\t\t\t\tnumpage += 1\r\n\t\t\t\tif numpage &lt; len(textrows):\r\n\t\t\t\t\tscreen.fill((0,0,0))\r\n\t\t\t\t\tnextpage(numpage)\r\n\t\t\t\telif numpage == len(textrows):\r\n\t\t\t\t\tscreen.fill((0,0,0))\r\n\t\t\t\t\tText(screen, \"FINE\", 0, 50, 50, (0,255,0))\r\n\t\t\t\t\tText(screen, \"CLICK TO RESTART\", 0, 150, 50, (255,255,0))\r\n\t\t\t\t\tnumpage = 0\r\n\t\t\t\t\t#time.sleep(2)\r\n\r\n\t\tpg.display.update()\r\n\t\tclock.tick(60)\r\n\tpg.quit()\r\n\r\n\r\nif __name__ == \"__main__\":\r\n\twindowinit()\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h3>Pygame's Platform Game<\/h3>\r\n\r\n<a href=\"https:\/\/pythonprogramming.altervista.org\/pygame-platform-game-5-sounds-and-mixer\/\"><img decoding=\"async\" src=\"https:\/\/i1.wp.com\/pythonprogramming.altervista.org\/wp-content\/uploads\/2020\/01\/climbercover.png?w=557&ssl=1\"\/ width=\"50%\"><\/a>\r\n<script>\r\nvar title = \"Platform Pygame\";\r\n\t\tvar links = [\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-animation-of-a-sprite-v-1-3\/\",\"Animation 1.3\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-sprite-animation-v-2-better-coding-test-it-checking-fps-on-the-screen\/\",\"Animation 1.2\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-how-to-display-the-frame-rate-fps-on-the-screen\/\",\"Display Frame rate\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-sprite-animation-update\/\",\"Animation 1.1\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-platformer-1\/\",\"Pygame Platform Game 1\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/python-platform-game-2\/\",\"Pygame Platform 2\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-platform-game-3-recap-cheatsheet\/\",\"Pygame PLatform 3 - recap and some Cheat Sheet\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-platform-game-4-background-and-stuffs\/\",\"Pygame Platform 4 - Background & organizing code\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-platform-game-5-sounds-and-mixer\/\",\"Pygame Platform 5 - Sounds\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/platform-game-in-detail-part-1\/\",\"Game in detail part 1\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/map-maker-1-2\/\", \"Map maker 1.2\"]\r\n\t\t];\r\n\t\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>\r\n\r\n<h3>Other Pygame's posts<\/h3>\r\n\r\n<script>\r\nvar title = \"Pygame's Posts\"\r\nvar links = [\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-platformer-1\/\",\"Platform game 1\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/make-a-platform-game-with-pygame-dafluffypotato\/\",\"DaFluffyPotato Platform Tutorials\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/python-and-classic-arcade-games-pong\/\",\"Pong Game Full\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/python-draws-in-colors-app-to-draw-with-pygame\/\",\"PyGameGIF 2\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-draw-app-with-animation\/\",\"PyGameGIF 1\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pydraw-2-0-app-to-draw-gif\/\",\"PyDraw 2.0\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-drawing-2\/\",\"Draw with Pygame\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/animation-with-pygame\",\"Sprite animation 1\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/animation-on-pygame-2-free-characters-and-more-actions\/\",\"Sprite animation 2\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/starting-with-pygame\/\",\"Starting movements with Pygame\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-3-move-sprite\/\", \"Move a Sprite\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-4-fonts\/\",\"Text and Fonts\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-animate-a-sprite\/\", \"Animate a sprite\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pygame-and-mouse-events\/\",\"Mouse events\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/pgp-aka-pygamepresentation-project\/\",\"Pygame presentation\"],\r\n\t[\"https:\/\/pythonprogramming.altervista.org\/moving-the-player-in-pygame-with-key-get_pressed\/\",\"How to use key.get_pressed()\"]\r\n]\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>\n","protected":false},"excerpt":{"rendered":"A presentation with Python and pygame module, first part, creating a window and placing text on it with examples\n<a class=\"moretag\" href=\"https:\/\/pythonprogramming.altervista.org\/pgp-aka-pygamepresentation-project\/\"> [...]<\/a>","protected":false},"author":1,"featured_media":1629,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-1626","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-examples"],"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\/1626","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=1626"}],"version-history":[{"count":7,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/1626\/revisions"}],"predecessor-version":[{"id":1638,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/1626\/revisions\/1638"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media\/1629"}],"wp:attachment":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media?parent=1626"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/categories?post=1626"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/tags?post=1626"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}