{"id":25160,"date":"2023-12-14T13:55:50","date_gmt":"2023-12-14T12:55:50","guid":{"rendered":"https:\/\/www.codemotion.com\/magazine\/?p=25160"},"modified":"2024-01-03T12:31:47","modified_gmt":"2024-01-03T11:31:47","slug":"creative-coding-come-creare-splendide-opere-darte-programmando","status":"publish","type":"post","link":"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/","title":{"rendered":"Creative Coding: Come Creare Opere d&#8217;Arte Programmando"},"content":{"rendered":"\n<p>Generalmente, crediamo che scrivere codice sia qualcosa che gli sviluppatori fanno per creare software che \u201cserva a qualcosa\u201d.<\/p>\n\n\n\n<p>Ci\u00f2 che intendo \u00e8 che le persone credono che gli sviluppatori utilizzino le loro capacit\u00e0 logiche per scrivere programmi che possano servire a &#8220;scopi pratici&#8221; come:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Automatizzare attivit\u00e0 giornaliere.<\/li>\n\n\n\n<li>Creare bellissimi frontends.<\/li>\n\n\n\n<li>Creare programmi per sistemi di pagamento.<\/li>\n\n\n\n<li>Realizzare videogiochi.<\/li>\n<\/ul>\n\n\n\n<p>Tanto per nominarne solo alcuni.<\/p>\n\n\n\n<p>Anche se alcuni sviluppatori credono di essere degli artisti (scrivere codice pulito non \u00e8 una vera e propria arte???), la verit\u00e0 \u00e8 che esiste un movimento che si sforza di realizzare veri e propri pezzi creativi fuori con il codice.<\/p>\n\n\n\n<p>Quindi, in questo articolo, parleremo di creative coding e faremo alcuni esempi in <a href=\"https:\/\/www.codemotion.com\/magazine\/it\/linguaggi-programmazione\/programmare-con-python\/\" class=\"ek-link\">Python<\/a>.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"h-cos-e-il-creative-coding\">Cos\u2019\u00e8 il creative coding?<\/h1>\n\n\n\n<p>Il creative coding \u00e8 una pratica che prevede di utilizzare i linguaggi di programmazione per creare arte, design o altre forme di espressione artistica e creativa, visivamente accattivanti, e talvolta anche interattive.<\/p>\n\n\n\n<p>A differenza del coding tradizionale &#8211; che si concentra principalmente su scopi funzionali o utilitaristici, come abbiamo detto prima &#8211; il creative coding enfatizza gli aspetti estetici e artistici della programmazione.&nbsp;<\/p>\n\n\n\n<p>In particolare, implica sperimentare con il codice per generare risultati stimolanti, spingendo la ricerca fino ai confini tra tecnologia e arte.<\/p>\n\n\n\n<p>Facciamo, per\u00f2, subito chiarezza specificando che questo processo non coinvolge l\u2019<a href=\"https:\/\/medium.com\/towards-data-science\/a-gentle-introduction-to-generative-ai-for-beginners-8c8752085900\" class=\"ek-link\">AI generativa<\/a>.<\/p>\n\n\n\n<p>Sappiamo, infatti, che grazie all\u2019intelligenza artificiale generativa possiamo scrivere prompt e, poi, un modello di Deep Learning creer\u00e0 un\u2019immagine dal prompt, utilizzando il codice.<\/p>\n\n\n\n<p>Questo non \u00e8 ci\u00f2 che intendiamo quando parliamo di creazione d\u2019arte graie al codice.<\/p>\n\n\n\n<p>Ci\u00f2 che intendiamo \u00e8 che il codice viene utilizato per generare direttamente, e senza l&#8217;uso di modelli di intelligenza artificiale, un output che pu\u00f2 essere inteso come un&#8217;opera d&#8217;arte.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>Lettura consigliata:<a href=\"https:\/\/www.codemotion.com\/magazine\/it\/intelligenza-artificiale\/gemini-ai-vs-chatgpt-qual-e-il-migliore\/\" class=\"ek-link\"> Gemini AI vs ChatGPT: qual \u00e8 il migliore?<\/a><\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"h-esempi-di-creative-coding-in-python\">Esempi di creative coding in Python<\/h1>\n\n\n\n<p>Dato che Python \u00e8 uno dei linguaggi di programmazione pi\u00f9 utilizzati, pu\u00f2 essere impiegato anche per scopi legati al creative coding.<\/p>\n\n\n\n<p>In precedenza abbiamo parlato della creazione di qualcosa che possa essere considerato arte in quanto risultato del codice.<\/p>\n\n\n\n<p>Poich\u00e9 molte attivit\u00e0 sono considerate arte, di seguito forniremo alcuni esempi di ci\u00f2 che riteniamo possano essere opere d&#8217;arte.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"h-creative-coding-scrivere-storie-e-favole-in-python\">Creative coding: scrivere storie e favole in Python<\/h1>\n\n\n\n<p>La poesia, la narrazione e le fiabe sono tutte forme d&#8217;arte.<\/p>\n\n\n\n<p>La domanda \u00e8: potremmo usare Python per creare una favola, magari guidando i lettori nella scelta tra alcune possibili risposte, per renderla interattiva?<\/p>\n\n\n\n<p>Certo che potremmo!<\/p>\n\n\n\n<p>Ecco un esempio:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">import time\r\n\r\ndef intro():\r\n    <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"Welcome to the Adventure in the Enchanted Forest!\"<\/span>)\r\n    time.sleep(<span class=\"hljs-number\">1<\/span>)\r\n    <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"You find yourself at the entrance of a mysterious forest.\"<\/span>)\r\n    time.sleep(<span class=\"hljs-number\">1<\/span>)\r\n    <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"Your goal is to reach the magical clearing at the center.\"<\/span>)\r\n    time.sleep(<span class=\"hljs-number\">1<\/span>)\r\n    <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"Let the adventure begin!\\n\"<\/span>)\r\n\r\ndef choose_path():\r\n    <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"You stand at a crossroads. Do you go left or right?\"<\/span>)\r\n    choice = input().lower()\r\n\r\n    <span class=\"hljs-keyword\">if<\/span> choice == <span class=\"hljs-string\">\"left\"<\/span>:\r\n        <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"\\nYou venture deeper into the forest.\"<\/span>)\r\n        time.sleep(<span class=\"hljs-number\">1<\/span>)\r\n        encounter_wild_animal()\r\n    elif choice == <span class=\"hljs-string\">\"right\"<\/span>:\r\n        <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"\\nYou follow a narrow path.\"<\/span>)\r\n        time.sleep(<span class=\"hljs-number\">1<\/span>)\r\n        encounter_old_bridge()\r\n    <span class=\"hljs-keyword\">else<\/span>:\r\n        <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"Invalid choice. Try again.\"<\/span>)\r\n        choose_path()\r\n\r\ndef encounter_wild_animal():\r\n    <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"\\nAs you walk through the dense foliage, you encounter a wild animal.\"<\/span>)\r\n    time.sleep(<span class=\"hljs-number\">1<\/span>)\r\n    <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"It's a friendly fox! What do you do?\"<\/span>)\r\n    time.sleep(<span class=\"hljs-number\">1<\/span>)\r\n    <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"1. Approach the fox slowly.\"<\/span>)\r\n    <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"2. Stay still and observe from a distance.\"<\/span>)\r\n    <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"3. Run away in fear.\"<\/span>)\r\n\r\n    choice = input()\r\n\r\n    <span class=\"hljs-keyword\">if<\/span> choice == <span class=\"hljs-string\">\"1\"<\/span>:\r\n        <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"\\nThe fox approaches you and guides you through a hidden shortcut.\"<\/span>)\r\n        time.sleep(<span class=\"hljs-number\">1<\/span>)\r\n        reach_magical_clearing()\r\n    elif choice == <span class=\"hljs-string\">\"2\"<\/span>:\r\n        <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"\\nThe fox acknowledges your respect and disappears into the forest.\"<\/span>)\r\n        time.sleep(<span class=\"hljs-number\">1<\/span>)\r\n        choose_path()\r\n    elif choice == <span class=\"hljs-string\">\"3\"<\/span>:\r\n        <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"\\nThe animal is startled, and you trip over a tree root while running.\"<\/span>)\r\n        time.sleep(<span class=\"hljs-number\">1<\/span>)\r\n        <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"You find yourself back at the crossroads.\"<\/span>)\r\n        time.sleep(<span class=\"hljs-number\">1<\/span>)\r\n        choose_path()\r\n    <span class=\"hljs-keyword\">else<\/span>:\r\n        <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"Invalid choice. Try again.\"<\/span>)\r\n        encounter_wild_animal()\r\n\r\ndef encounter_old_bridge():\r\n    <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"\\nYou reach an old, creaky bridge over a rushing river.\"<\/span>)\r\n    time.sleep(<span class=\"hljs-number\">1<\/span>)\r\n    <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"What will you do?\"<\/span>)\r\n    time.sleep(<span class=\"hljs-number\">1<\/span>)\r\n    <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"1. Cross the bridge cautiously.\"<\/span>)\r\n    <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"2. Look for another way around.\"<\/span>)\r\n    <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"3. Yell for help.\"<\/span>)\r\n\r\n    choice = input()\r\n\r\n    <span class=\"hljs-keyword\">if<\/span> choice == <span class=\"hljs-string\">\"1\"<\/span>:\r\n        <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"\\nYou carefully cross the bridge and continue your journey.\"<\/span>)\r\n        time.sleep(<span class=\"hljs-number\">1<\/span>)\r\n        choose_path()\r\n    elif choice == <span class=\"hljs-string\">\"2\"<\/span>:\r\n        <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"\\nYou explore the area and find a hidden path that leads to a mystical cave.\"<\/span>)\r\n        time.sleep(<span class=\"hljs-number\">1<\/span>)\r\n        explore_mystical_cave()\r\n    elif choice == <span class=\"hljs-string\">\"3\"<\/span>:\r\n        <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"\\nYour yell echoes through the forest, but no one responds.\"<\/span>)\r\n        time.sleep(<span class=\"hljs-number\">1<\/span>)\r\n        <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"You decide to cross the bridge quietly.\"<\/span>)\r\n        time.sleep(<span class=\"hljs-number\">1<\/span>)\r\n        choose_path()\r\n    <span class=\"hljs-keyword\">else<\/span>:\r\n        <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"Invalid choice. Try again.\"<\/span>)\r\n        encounter_old_bridge()\r\n\r\ndef explore_mystical_cave():\r\n    <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"\\nYou enter the mystical cave and discover glowing crystals.\"<\/span>)\r\n    time.sleep(<span class=\"hljs-number\">1<\/span>)\r\n    <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"What do you want to do?\"<\/span>)\r\n    time.sleep(<span class=\"hljs-number\">1<\/span>)\r\n    <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"1. Collect some crystals.\"<\/span>)\r\n    <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"2. Leave the cave and continue your journey.\"<\/span>)\r\n\r\n    choice = input()\r\n\r\n    <span class=\"hljs-keyword\">if<\/span> choice == <span class=\"hljs-string\">\"1\"<\/span>:\r\n        <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"\\nYou carefully collect a few crystals, feeling their magical energy.\"<\/span>)\r\n        time.sleep(<span class=\"hljs-number\">1<\/span>)\r\n        reach_magical_clearing()\r\n    elif choice == <span class=\"hljs-string\">\"2\"<\/span>:\r\n        <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"\\nYou decide to leave the cave and continue your adventure.\"<\/span>)\r\n        time.sleep(<span class=\"hljs-number\">1<\/span>)\r\n        choose_path()\r\n    <span class=\"hljs-keyword\">else<\/span>:\r\n        <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"Invalid choice. Try again.\"<\/span>)\r\n        explore_mystical_cave()\r\n\r\ndef reach_magical_clearing():\r\n    <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"\\nCongratulations! You reach the magical clearing at the center of the forest.\"<\/span>)\r\n    time.sleep(<span class=\"hljs-number\">1<\/span>)\r\n    <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"The clearing is bathed in a soft, otherworldly light.\"<\/span>)\r\n    time.sleep(<span class=\"hljs-number\">1<\/span>)\r\n    <span class=\"hljs-keyword\">print<\/span>(<span class=\"hljs-string\">\"You've completed your adventure in the enchanted forest. Well done!\"<\/span>)\r\n\r\n<span class=\"hljs-comment\"># Start the adventure<\/span>\r\nintro()\r\nchoose_path()\r<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Ecco un&#8217;immagine che mostra come funziona il programma:<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/sRSyPorr7VAJtIeXsntSyEDfQvPLszk1byJj3SQW6oZTjJt56qbM-EwJ_7IqaHfhX8izo_o59nuknRJXNhuH5V8Wy5xEsJxThg81u48ZEIQfoLiUvb19zEbgJBymitJdmNR-IyFWic_sLQL6bQNywX8\" width=\"602\" height=\"557\"><\/p>\n\n\n\n<p>Gli utenti seguono, quindi, un percorso narrativo che cambia a seconda della risposta che inseriscono, fino ad arrivare alla fine del racconto.<\/p>\n\n\n\n<p>Poich\u00e9 la poesia e i racconti sono un&#8217;opera d&#8217;arte, questo \u00e8 un esempio di opera d&#8217;arte interattiva.<\/p>\n\n\n\n<p>Infatti, dato che la Command Line Interface permette agli utenti di interagire con un programma, abbiamo creato una storia che viene in qualche modo modellata sulla base delle risposte scelte dal lettore.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>Lettura consigliata: <a href=\"https:\/\/www.codemotion.com\/magazine\/it\/intelligenza-artificiale\/sviluppo-chatbot-con-python\/\" class=\"ek-link\">Come sviluppare il tuo Chatbot con Python e ChatterBot partendo da zero<\/a><\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Creative coding: utilizzare la matematica per creare opere d\u2019arte<\/h1>\n\n\n\n<p>Ci sono <a href=\"https:\/\/en.wikipedia.org\/wiki\/Mathematics_and_art\">molte persone<\/a> (e io sono tra quelle!) che credono che la matematica sia in qualche modo un\u2019arte.<\/p>\n\n\n\n<p>Quindi, perch\u00e9 non realizzare creazioni artistiche utilizzando la matematica?<\/p>\n\n\n\n<p>Ad esempio, sapevi che in matematica esiste una funzione chiamata \u201ccardioide\u201d che crea la forma del cuore?<\/p>\n\n\n\n<p>Ecco come possiamo creare un cardioide in Python:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">import numpy <span class=\"hljs-keyword\">as<\/span> np\r\nimport matplotlib.pyplot <span class=\"hljs-keyword\">as<\/span> plt\r\n\r\ndef create_cardioid():\r\n    <span class=\"hljs-string\">''<\/span><span class=\"hljs-string\">'Creates the cardioid'<\/span><span class=\"hljs-string\">''<\/span>\r\n    \r\n    <span class=\"hljs-comment\"># Define radious (r) and angle (theta)<\/span>\r\n    theta = np.linspace(<span class=\"hljs-number\">0<\/span>, <span class=\"hljs-number\">2<\/span>*np.pi, <span class=\"hljs-number\">1000<\/span>)\r\n    r = <span class=\"hljs-number\">1<\/span> - np.sin(theta)\r\n    \r\n    <span class=\"hljs-comment\"># Give carthesian coordinates<\/span>\r\n    x = r * np.cos(theta)\r\n    y = r * np.sin(theta)\r\n\r\n    <span class=\"hljs-keyword\">return<\/span> x, y\r\n\r\ndef plot_cardioid(x, y):\r\n    <span class=\"hljs-string\">''<\/span><span class=\"hljs-string\">'Plots the cardioid'<\/span><span class=\"hljs-string\">''<\/span>\r\n    \r\n    fig, ax = plt.subplots()\r\n    \r\n    <span class=\"hljs-comment\"># Plot the cardioid<\/span>\r\n    ax.plot(x, y, label=<span class=\"hljs-string\">'Cardioid'<\/span>, color=<span class=\"hljs-string\">'blue'<\/span>)\r\n\r\n    <span class=\"hljs-comment\"># Fill the inside of the cardioid in red<\/span>\r\n    ax.fill(x, y, color=<span class=\"hljs-string\">'red'<\/span>, alpha=<span class=\"hljs-number\">0.5<\/span>)\r\n\r\n    <span class=\"hljs-comment\"># Set the aspect ratio to be equal<\/span>\r\n    ax.set_aspect(<span class=\"hljs-string\">'equal'<\/span>, adjustable=<span class=\"hljs-string\">'datalim'<\/span>)\r\n\r\n    <span class=\"hljs-comment\"># Set axis labels<\/span>\r\n    ax.set_xlabel(<span class=\"hljs-string\">'X-axis'<\/span>)\r\n    ax.set_ylabel(<span class=\"hljs-string\">'Y-axis'<\/span>)\r\n\r\n    <span class=\"hljs-comment\"># Set the title<\/span>\r\n    ax.set_title(<span class=\"hljs-string\">'Cardioid with Coloring'<\/span>)\r\n\r\n    <span class=\"hljs-comment\"># Display the legend<\/span>\r\n    ax.legend()\r\n\r\n    <span class=\"hljs-comment\"># Show the plot<\/span>\r\n    plt.show()\r\n\r\n<span class=\"hljs-keyword\">if<\/span> __name__ == <span class=\"hljs-string\">\"__main__\"<\/span>:\r\n    x, y = create_cardioid()\r\n    plot_cardioid(x, y)\r\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Otteniamo:<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/EM0uQr_z-6A-iB5cMcUpTGwkMm7VbQmUi3sX9P99F0w4F29Llc2QnS7lyCHsGUYXbDDwk6jzZesnd-DfHguCl96SA7vAKRIQbISpH80iV2W9atLKHIoTlfJQkcafb8kHZXftBA1aorsT_xFgJVKT6mA\" width=\"394\" height=\"278\"><\/p>\n\n\n\n<p>Possiamo fare molto meglio che creare un cardioide, per\u00f2.<\/p>\n\n\n\n<p>Per esempio, possiamo utilizzare la libreria\u00a0 matplotlib per creare un disegno artistico utilizzando forme matematiche come i cerchi:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">import numpy <span class=\"hljs-keyword\">as<\/span> np\r\nimport matplotlib.pyplot <span class=\"hljs-keyword\">as<\/span> plt\r\n\r\ndef generate_art(num_circles=<span class=\"hljs-number\">100<\/span>):\r\n    fig, ax = plt.subplots()\r\n\r\n    <span class=\"hljs-keyword\">for<\/span> _ in range(num_circles):\r\n        <span class=\"hljs-comment\"># Randomly generate circle parameters<\/span>\r\n        radius = np.random.uniform(<span class=\"hljs-number\">0.1<\/span>, <span class=\"hljs-number\">0.5<\/span>)\r\n        x_center = np.random.uniform(<span class=\"hljs-number\">0<\/span>, <span class=\"hljs-number\">1<\/span>)\r\n        y_center = np.random.uniform(<span class=\"hljs-number\">0<\/span>, <span class=\"hljs-number\">1<\/span>)\r\n        color = np.random.rand(<span class=\"hljs-number\">3<\/span>,)  <span class=\"hljs-comment\"># RGB values between 0 and 1<\/span>\r\n\r\n        <span class=\"hljs-comment\"># Plot the circle<\/span>\r\n        circle = plt.Circle((x_center, y_center), radius, color=color, alpha=<span class=\"hljs-number\">0.7<\/span>)\r\n        ax.add_patch(circle)\r\n\r\n    <span class=\"hljs-comment\"># Set the aspect ratio to be equal<\/span>\r\n    ax.set_aspect(<span class=\"hljs-string\">'equal'<\/span>, adjustable=<span class=\"hljs-string\">'datalim'<\/span>)\r\n\r\n    <span class=\"hljs-comment\"># Set axis labels<\/span>\r\n    ax.set_xlabel(<span class=\"hljs-string\">'X-axis'<\/span>)\r\n    ax.set_ylabel(<span class=\"hljs-string\">'Y-axis'<\/span>)\r\n\r\n    <span class=\"hljs-comment\"># Set the title<\/span>\r\n    ax.set_title(<span class=\"hljs-string\">'Circles - Generative Art'<\/span>)\r\n\r\n    <span class=\"hljs-comment\"># Show the plot<\/span>\r\n    plt.show()\r\n\r\n<span class=\"hljs-keyword\">if<\/span> __name__ == <span class=\"hljs-string\">\"__main__\"<\/span>:\r\n    generate_art()\r\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Questo \u00e8 quello che ho ottenuto io:<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/hN80s9xr69KZ5omN-TL7R7zTPke6B-6uyoa55V9Y_NQcm7SOlM4l2EfxWiEkkQj0Vzo8WIH788TkM2U4I4mIR3GLdl400Q1WXz_XlIEzN6btGN3ZHoaa4lAp-DqpSxikcMiHTKX1XyYTkGTZkXSUOHE\" width=\"386\" height=\"278\"><\/p>\n\n\n\n<p>Si noti che, poich\u00e9 i cerchi vengono creati in modo casuale nel programma che abbiamo scritto in Python, si ottiene un risultato diverso ogni volta che eseguiamo il programma.<\/p>\n\n\n\n<p>Ora, cos&#8217;altro potremmo fare? Ebbene, le spirali, abbinate a colori psichedelici, vengono spesso utilizzate per creazioni artistiche.<\/p>\n\n\n\n<p>Ecco come possiamo creare una spirale con colori psichedelici in Python:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">import numpy <span class=\"hljs-keyword\">as<\/span> np\r\nimport matplotlib.pyplot <span class=\"hljs-keyword\">as<\/span> plt\r\nimport matplotlib.cm <span class=\"hljs-keyword\">as<\/span> cm\r\n\r\ndef draw_psychedelic_spiral(num_spirals=<span class=\"hljs-number\">10<\/span>, num_points=<span class=\"hljs-number\">1000<\/span>):\r\n    fig, ax = plt.subplots()\r\n\r\n    <span class=\"hljs-keyword\">for<\/span> _ in range(num_spirals):\r\n        <span class=\"hljs-comment\"># Generate points for the spiral<\/span>\r\n        theta = np.linspace(<span class=\"hljs-number\">0<\/span>, <span class=\"hljs-number\">10<\/span> * np.pi, num_points)\r\n        radius = np.linspace(<span class=\"hljs-number\">0<\/span>, <span class=\"hljs-number\">1<\/span>, num_points)\r\n\r\n        <span class=\"hljs-comment\"># Convert polar coordinates to Cartesian coordinates<\/span>\r\n        x = radius * np.cos(theta)\r\n        y = radius * np.sin(theta)\r\n\r\n        <span class=\"hljs-comment\"># Define psychedelic colors using the 'hsv' colormap<\/span>\r\n        colors = cm.hsv(np.linspace(<span class=\"hljs-number\">0<\/span>, <span class=\"hljs-number\">1<\/span>, num_points))\r\n\r\n        <span class=\"hljs-comment\"># Plot the spiral with psychedelic colors<\/span>\r\n        <span class=\"hljs-keyword\">for<\/span> i in range(num_points - <span class=\"hljs-number\">1<\/span>):\r\n            ax.plot(&#91;x&#91;i], x&#91;i+<span class=\"hljs-number\">1<\/span>]], &#91;y&#91;i], y&#91;i+<span class=\"hljs-number\">1<\/span>]], color=colors&#91;i], linewidth=<span class=\"hljs-number\">2<\/span>, alpha=<span class=\"hljs-number\">0.7<\/span>)\r\n\r\n    <span class=\"hljs-comment\"># Set the aspect ratio to be equal<\/span>\r\n    ax.set_aspect(<span class=\"hljs-string\">'equal'<\/span>, adjustable=<span class=\"hljs-string\">'datalim'<\/span>)\r\n\r\n    <span class=\"hljs-comment\"># Set axis labels<\/span>\r\n    ax.set_xlabel(<span class=\"hljs-string\">'X-axis'<\/span>)\r\n    ax.set_ylabel(<span class=\"hljs-string\">'Y-axis'<\/span>)\r\n\r\n    <span class=\"hljs-comment\"># Set the title<\/span>\r\n    ax.set_title(<span class=\"hljs-string\">'Psychedelic Spirals'<\/span>)\r\n\r\n    <span class=\"hljs-comment\"># Show the plot<\/span>\r\n    plt.show()\r\n\r\n<span class=\"hljs-keyword\">if<\/span> __name__ == <span class=\"hljs-string\">\"__main__\"<\/span>:\r\n    draw_psychedelic_spiral()<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>E si ottiene:<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/mABJUtU_UOAequmSFHJi2Wgjhy_6XE85L6yvI1wkgyTnkuH-Fe9AOujXJ2rOBUD-Q4I-g39rKWog4yG_4rA8HcAaAbZRZJOTRwVnv9xJP6D1HOsGld7woUwO_9XJWGq-JtM-R7OrqE3m4ZTjzCsAH_g\" width=\"400\" height=\"279\"><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Creative coding: la libreria Turtle&nbsp;<\/h1>\n\n\n\n<p>Python ha un modulo integrato chiamato turtle che fornisce la possibilit\u00e0 di introdurre i concetti di programmazione ai principianti attraverso grafica e animazione.<\/p>\n\n\n\n<p>Questo modulo consente agli utenti di disegnare forme e trame e persino di creare semplici giochi utilizzando la finestra grafica di turtle .<\/p>\n\n\n\n<p>Ecco come possiamo usare turtle per creare alcuni cerchi artistici:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-selector-tag\">import<\/span> <span class=\"hljs-selector-tag\">turtle<\/span>\r\n<span class=\"hljs-selector-tag\">import<\/span> <span class=\"hljs-selector-tag\">random<\/span>\r\n\r\n<span class=\"hljs-selector-tag\">turtle<\/span><span class=\"hljs-selector-class\">.speed<\/span>(0)\r\n<span class=\"hljs-selector-tag\">turtle<\/span><span class=\"hljs-selector-class\">.bgcolor<\/span>(\"<span class=\"hljs-selector-tag\">black<\/span>\")\r\n\r\n# <span class=\"hljs-selector-tag\">Function<\/span> <span class=\"hljs-selector-tag\">to<\/span> <span class=\"hljs-selector-tag\">draw<\/span> <span class=\"hljs-selector-tag\">colorful<\/span> <span class=\"hljs-selector-tag\">circles<\/span>\r\n<span class=\"hljs-selector-tag\">def<\/span> <span class=\"hljs-selector-tag\">draw_circles<\/span>():\r\n    <span class=\"hljs-selector-tag\">for<\/span> _ <span class=\"hljs-selector-tag\">in<\/span> <span class=\"hljs-selector-tag\">range<\/span>(100):\r\n        <span class=\"hljs-selector-tag\">turtle<\/span><span class=\"hljs-selector-class\">.color<\/span>(<span class=\"hljs-selector-tag\">random<\/span><span class=\"hljs-selector-class\">.random<\/span>(), <span class=\"hljs-selector-tag\">random<\/span><span class=\"hljs-selector-class\">.random<\/span>(), <span class=\"hljs-selector-tag\">random<\/span><span class=\"hljs-selector-class\">.random<\/span>())\r\n        <span class=\"hljs-selector-tag\">turtle<\/span><span class=\"hljs-selector-class\">.forward<\/span>(100)\r\n        <span class=\"hljs-selector-tag\">turtle<\/span><span class=\"hljs-selector-class\">.right<\/span>(45)\r\n\r\n# <span class=\"hljs-selector-tag\">Create<\/span> <span class=\"hljs-selector-tag\">multiple<\/span> <span class=\"hljs-selector-tag\">circles<\/span>\r\n<span class=\"hljs-selector-tag\">for<\/span> _ <span class=\"hljs-selector-tag\">in<\/span> <span class=\"hljs-selector-tag\">range<\/span>(10):\r\n    <span class=\"hljs-selector-tag\">draw_circles<\/span>()\r\n\r\n<span class=\"hljs-selector-tag\">turtle<\/span><span class=\"hljs-selector-class\">.done<\/span>()\r\n\r\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>E si ottiene la seguente immagine:<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"501\" src=\"https:\/\/lh7-us.googleusercontent.com\/oTHr8YO7HMvy3-uPqvGQrm7soC6jN4JvRPC8dqhcwaVzTT8PrvDKfU5w1v0ZsXu2LvCbFdvz-j1fWlEUK534swC7ly4cY4rCX68obwBQxh6C2vzIDCqk7PqgXXhA7J8khVBQM4IwnJKQ0ZoYuaUXIY4\"><\/p>\n\n\n\n<p>Tieni presente che, poich\u00e9 si tratta di una libreria integrata, una volta eseguito il codice si aprir\u00e0 una nuova finestra come questa, che mostra i risultati del tuo codice.<\/p>\n\n\n\n<p>Questo modulo, quindi, pu\u00f2 essere utilizzato anche per creare immagini animate, migliorando l&#8217;esperienza artistica.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Conclusioni<\/h1>\n\n\n\n<p>In questo articolo abbiamo dimostrato che la codifica non \u00e8 diretta solo verso software che pu\u00f2 avere \u201cscopi di produzione\u201d.<\/p>\n\n\n\n<p>Ci sono molte persone che si sforzano di creare creazioni artistiche partendo dal codice e, poich\u00e9 l&#8217;arte non ha limiti, l&#8217;unico limite che hai \u00e8 la tua fantasia.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Generalmente, crediamo che scrivere codice sia qualcosa che gli sviluppatori fanno per creare software che \u201cserva a qualcosa\u201d. Ci\u00f2 che intendo \u00e8 che le persone credono che gli sviluppatori utilizzino le loro capacit\u00e0 logiche per scrivere programmi che possano servire a &#8220;scopi pratici&#8221; come: Tanto per nominarne solo alcuni. Anche se alcuni sviluppatori credono di&#8230; <a class=\"more-link\" href=\"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/\">Read more<\/a><\/p>\n","protected":false},"author":171,"featured_media":17959,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_editorskit_title_hidden":false,"_editorskit_reading_time":0,"_editorskit_is_block_options_detached":false,"_editorskit_block_options_position":"{}","_uag_custom_page_level_css":"","_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[10263],"tags":[10442,10438],"collections":[],"class_list":{"0":"post-25160","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-backend-it","8":"tag-python-it","9":"tag-sviluppo-software-it","10":"entry"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v26.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Creative Coding: \u00e8 possibile creare opere d&#039;arte programmando<\/title>\n<meta name=\"description\" content=\"In questo articolo parleremo di creative coding e faremo alcuni esempi in Python cercando di capire come creare opere d&#039;arte programmando.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creative Coding: Come Creare Opere d&#039;Arte Programmando\" \/>\n<meta property=\"og:description\" content=\"In questo articolo parleremo di creative coding e faremo alcuni esempi in Python cercando di capire come creare opere d&#039;arte programmando.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/\" \/>\n<meta property=\"og:site_name\" content=\"Codemotion Magazine\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Codemotion.Italy\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-12-14T12:55:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-03T11:31:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/06\/cover_infographic_05.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Federico Trotta\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@CodemotionIT\" \/>\n<meta name=\"twitter:site\" content=\"@CodemotionIT\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Federico Trotta\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/\"},\"author\":{\"name\":\"Federico Trotta\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/98d2abaf70e7d106abab1f38bf20f90d\"},\"headline\":\"Creative Coding: Come Creare Opere d&#8217;Arte Programmando\",\"datePublished\":\"2023-12-14T12:55:50+00:00\",\"dateModified\":\"2024-01-03T11:31:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/\"},\"wordCount\":816,\"publisher\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/06\/cover_infographic_05.png\",\"keywords\":[\"Python\",\"sviluppo software\"],\"articleSection\":[\"Backend\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/\",\"name\":\"Creative Coding: \u00e8 possibile creare opere d'arte programmando\",\"isPartOf\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/06\/cover_infographic_05.png\",\"datePublished\":\"2023-12-14T12:55:50+00:00\",\"dateModified\":\"2024-01-03T11:31:47+00:00\",\"description\":\"In questo articolo parleremo di creative coding e faremo alcuni esempi in Python cercando di capire come creare opere d'arte programmando.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/#primaryimage\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/06\/cover_infographic_05.png\",\"contentUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/06\/cover_infographic_05.png\",\"width\":1920,\"height\":1080,\"caption\":\"hybrid, remote working IT, developers, CTO\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.codemotion.com\/magazine\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Backend\",\"item\":\"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Creative Coding: Come Creare Opere d&#8217;Arte Programmando\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#website\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/\",\"name\":\"Codemotion Magazine\",\"description\":\"We code the future. Together\",\"publisher\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.codemotion.com\/magazine\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#organization\",\"name\":\"Codemotion\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png\",\"contentUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png\",\"width\":225,\"height\":225,\"caption\":\"Codemotion\"},\"image\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/Codemotion.Italy\/\",\"https:\/\/x.com\/CodemotionIT\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/98d2abaf70e7d106abab1f38bf20f90d\",\"name\":\"Federico Trotta\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/69bc8655986054bfe43c7eaa7f00e2ea939b761bd924064ea9b5972568a01714?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/69bc8655986054bfe43c7eaa7f00e2ea939b761bd924064ea9b5972568a01714?s=96&d=mm&r=g\",\"caption\":\"Federico Trotta\"},\"description\":\"I have loved writing since I was a young boy in school, writing detective stories as class exams. Thanks to my curiosity, I discovered programming and AI. Having a burning passion for writing, I couldn't avoid starting to write about these topics, so I decided to change my career to become a Technical Writer. My purpose is to educate people on Python programming, Machine Learning, and Data Science, through writing.\",\"sameAs\":[\"https:\/\/federicotrotta.com\/\",\"https:\/\/www.linkedin.com\/in\/federico-trotta\/?originalSubdomain=it\"],\"url\":\"https:\/\/www.codemotion.com\/magazine\/author\/federico-trotta\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Creative Coding: \u00e8 possibile creare opere d'arte programmando","description":"In questo articolo parleremo di creative coding e faremo alcuni esempi in Python cercando di capire come creare opere d'arte programmando.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/","og_locale":"en_US","og_type":"article","og_title":"Creative Coding: Come Creare Opere d'Arte Programmando","og_description":"In questo articolo parleremo di creative coding e faremo alcuni esempi in Python cercando di capire come creare opere d'arte programmando.","og_url":"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/","og_site_name":"Codemotion Magazine","article_publisher":"https:\/\/www.facebook.com\/Codemotion.Italy\/","article_published_time":"2023-12-14T12:55:50+00:00","article_modified_time":"2024-01-03T11:31:47+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/06\/cover_infographic_05.png","type":"image\/png"}],"author":"Federico Trotta","twitter_card":"summary_large_image","twitter_creator":"@CodemotionIT","twitter_site":"@CodemotionIT","twitter_misc":{"Written by":"Federico Trotta","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/#article","isPartOf":{"@id":"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/"},"author":{"name":"Federico Trotta","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/98d2abaf70e7d106abab1f38bf20f90d"},"headline":"Creative Coding: Come Creare Opere d&#8217;Arte Programmando","datePublished":"2023-12-14T12:55:50+00:00","dateModified":"2024-01-03T11:31:47+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/"},"wordCount":816,"publisher":{"@id":"https:\/\/www.codemotion.com\/magazine\/#organization"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/06\/cover_infographic_05.png","keywords":["Python","sviluppo software"],"articleSection":["Backend"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/","url":"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/","name":"Creative Coding: \u00e8 possibile creare opere d'arte programmando","isPartOf":{"@id":"https:\/\/www.codemotion.com\/magazine\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/#primaryimage"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/06\/cover_infographic_05.png","datePublished":"2023-12-14T12:55:50+00:00","dateModified":"2024-01-03T11:31:47+00:00","description":"In questo articolo parleremo di creative coding e faremo alcuni esempi in Python cercando di capire come creare opere d'arte programmando.","breadcrumb":{"@id":"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/#primaryimage","url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/06\/cover_infographic_05.png","contentUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/06\/cover_infographic_05.png","width":1920,"height":1080,"caption":"hybrid, remote working IT, developers, CTO"},{"@type":"BreadcrumbList","@id":"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/creative-coding-come-creare-splendide-opere-darte-programmando\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codemotion.com\/magazine\/"},{"@type":"ListItem","position":2,"name":"Backend","item":"https:\/\/www.codemotion.com\/magazine\/it\/backend-it\/"},{"@type":"ListItem","position":3,"name":"Creative Coding: Come Creare Opere d&#8217;Arte Programmando"}]},{"@type":"WebSite","@id":"https:\/\/www.codemotion.com\/magazine\/#website","url":"https:\/\/www.codemotion.com\/magazine\/","name":"Codemotion Magazine","description":"We code the future. Together","publisher":{"@id":"https:\/\/www.codemotion.com\/magazine\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codemotion.com\/magazine\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codemotion.com\/magazine\/#organization","name":"Codemotion","url":"https:\/\/www.codemotion.com\/magazine\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/","url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png","contentUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png","width":225,"height":225,"caption":"Codemotion"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Codemotion.Italy\/","https:\/\/x.com\/CodemotionIT"]},{"@type":"Person","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/98d2abaf70e7d106abab1f38bf20f90d","name":"Federico Trotta","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/69bc8655986054bfe43c7eaa7f00e2ea939b761bd924064ea9b5972568a01714?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/69bc8655986054bfe43c7eaa7f00e2ea939b761bd924064ea9b5972568a01714?s=96&d=mm&r=g","caption":"Federico Trotta"},"description":"I have loved writing since I was a young boy in school, writing detective stories as class exams. Thanks to my curiosity, I discovered programming and AI. Having a burning passion for writing, I couldn't avoid starting to write about these topics, so I decided to change my career to become a Technical Writer. My purpose is to educate people on Python programming, Machine Learning, and Data Science, through writing.","sameAs":["https:\/\/federicotrotta.com\/","https:\/\/www.linkedin.com\/in\/federico-trotta\/?originalSubdomain=it"],"url":"https:\/\/www.codemotion.com\/magazine\/author\/federico-trotta\/"}]}},"featured_image_src":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/06\/cover_infographic_05-600x400.png","featured_image_src_square":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/06\/cover_infographic_05-600x600.png","author_info":{"display_name":"Federico Trotta","author_link":"https:\/\/www.codemotion.com\/magazine\/author\/federico-trotta\/"},"uagb_featured_image_src":{"full":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/06\/cover_infographic_05.png",1920,1080,false],"thumbnail":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/06\/cover_infographic_05-150x150.png",150,150,true],"medium":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/06\/cover_infographic_05-300x169.png",300,169,true],"medium_large":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/06\/cover_infographic_05-768x432.png",768,432,true],"large":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/06\/cover_infographic_05-1024x576.png",1024,576,true],"1536x1536":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/06\/cover_infographic_05-1536x864.png",1536,864,true],"2048x2048":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/06\/cover_infographic_05.png",1920,1080,false],"small-home-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/06\/cover_infographic_05.png",100,56,false],"sidebar-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/06\/cover_infographic_05-180x128.png",180,128,true],"genesis-singular-images":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/06\/cover_infographic_05-896x504.png",896,504,true],"archive-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/06\/cover_infographic_05-400x225.png",400,225,true],"gb-block-post-grid-landscape":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/06\/cover_infographic_05-600x400.png",600,400,true],"gb-block-post-grid-square":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/06\/cover_infographic_05-600x600.png",600,600,true]},"uagb_author_info":{"display_name":"Federico Trotta","author_link":"https:\/\/www.codemotion.com\/magazine\/author\/federico-trotta\/"},"uagb_comment_info":0,"uagb_excerpt":"Generalmente, crediamo che scrivere codice sia qualcosa che gli sviluppatori fanno per creare software che \u201cserva a qualcosa\u201d. Ci\u00f2 che intendo \u00e8 che le persone credono che gli sviluppatori utilizzino le loro capacit\u00e0 logiche per scrivere programmi che possano servire a &#8220;scopi pratici&#8221; come: Tanto per nominarne solo alcuni. Anche se alcuni sviluppatori credono di&#8230;&hellip;","lang":"it","_links":{"self":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/25160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/users\/171"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/comments?post=25160"}],"version-history":[{"count":3,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/25160\/revisions"}],"predecessor-version":[{"id":25219,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/25160\/revisions\/25219"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/media\/17959"}],"wp:attachment":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/media?parent=25160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/categories?post=25160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/tags?post=25160"},{"taxonomy":"collections","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/collections?post=25160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}