<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-156945889618361525</id><updated>2024-11-10T18:02:04.642+08:00</updated><category term="Bigo"/><category term="Docker"/><category term="English"/><category term="SnackVideo"/><title type='text'>Steven&#39;s Blog</title><subtitle type='html'>Anything You Can Find Here</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://www.stevennathaniel.web.id/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default'/><link rel='alternate' type='text/html' href='https://www.stevennathaniel.web.id/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>IT Writer</name><uri>http://www.blogger.com/profile/10445657762034183360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYuEOxtCuH6VmQBKT02CLKSsXzdABdhMAfrZB5ReJVOI_IAuaOINU7EH6XZsvUDgVjVFJuCiRhUtatKXUZ-8b-rAMMsnzp5yZnBEth0o2s8tYmlWmi5BjjQa-Wu-PQNf9jkEVTcJwfL7caD52xwXALYdIa2t6Gx0F8sL7IS1XVcro_A8Y/s220/Foto2.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-156945889618361525.post-896413491076555147</id><published>2024-06-27T11:03:00.003+08:00</published><updated>2024-06-27T11:03:21.128+08:00</updated><title type='text'>Autodesk AutoCAD : Cara Mematikan ACWebbrowser</title><content type='html'>&lt;h1&gt;Cara Mematikannya : &lt;/h1&gt;

https://forums.autodesk.com/t5/maya-forum/what-is-acwebbrowser-exe-and-how-do-i-disable-it/td-p/6285733


</content><link rel='replies' type='application/atom+xml' href='https://www.stevennathaniel.web.id/feeds/896413491076555147/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.stevennathaniel.web.id/2024/06/autodesk-autocad-cara-mematikan.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/896413491076555147'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/896413491076555147'/><link rel='alternate' type='text/html' href='https://www.stevennathaniel.web.id/2024/06/autodesk-autocad-cara-mematikan.html' title='Autodesk AutoCAD : Cara Mematikan ACWebbrowser'/><author><name>IT Writer</name><uri>http://www.blogger.com/profile/10445657762034183360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYuEOxtCuH6VmQBKT02CLKSsXzdABdhMAfrZB5ReJVOI_IAuaOINU7EH6XZsvUDgVjVFJuCiRhUtatKXUZ-8b-rAMMsnzp5yZnBEth0o2s8tYmlWmi5BjjQa-Wu-PQNf9jkEVTcJwfL7caD52xwXALYdIa2t6Gx0F8sL7IS1XVcro_A8Y/s220/Foto2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-156945889618361525.post-917162466663721740</id><published>2024-05-22T12:26:00.010+08:00</published><updated>2024-05-22T12:42:32.634+08:00</updated><title type='text'>Debian : Python programming using Virtual Environment</title><content type='html'>&lt;p&gt;In Debian 12, to install modules like Flask, we have to create a virtual environment first.&lt;p&gt;
  
&lt;br&gt;

&lt;p&gt;To achieve this goal, we need a command to install pip3 on Debian 12. The command is as follows:&lt;/p&gt;

&lt;br&gt;

&lt;p&gt;&lt;b&gt;apt install python3-pip&lt;/b&gt;&lt;/p&gt;


&lt;br&gt;

&lt;p&gt;To install the virtual environment, you can do this via the command:&lt;/p&gt;

&lt;br&gt;

&lt;p&gt;&lt;b&gt;apt instal python3-venv&lt;/b&gt;&lt;/p&gt;

&lt;br&gt;

&lt;p&gt;This is the basic source code for Flask programming : &lt;/p&gt;


&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgavlRW1tr-MDh_jak0mKEa094curHxbwPuFstnE9tKdU4GRRlcpDWIoKpZLbMHoGfn1rBZy_9o9KfeIrAoySiTKFxk4HrmXQkiv1mU5sta9xOapfz_Sdx0PN-orAUYsfFpLqJnq6sPpJh_/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; from flask import Flask  
 aplikasi = Flask(__name__)  
 @aplikasi.route(&#39;/&#39;)  
 def halaman1():  
   return &#39;Web dari Virtual Environment&#39;  
 if __name__ == &#39;__main__&#39;:  
   aplikasi.run(host=&#39;0.0.0.0&#39;,port=8547,debug=True)  
&lt;/code&gt;&lt;/pre&gt;




</content><link rel='replies' type='application/atom+xml' href='https://www.stevennathaniel.web.id/feeds/917162466663721740/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.stevennathaniel.web.id/2024/05/debian-python-programming-using-virtual.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/917162466663721740'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/917162466663721740'/><link rel='alternate' type='text/html' href='https://www.stevennathaniel.web.id/2024/05/debian-python-programming-using-virtual.html' title='Debian : Python programming using Virtual Environment'/><author><name>IT Writer</name><uri>http://www.blogger.com/profile/10445657762034183360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYuEOxtCuH6VmQBKT02CLKSsXzdABdhMAfrZB5ReJVOI_IAuaOINU7EH6XZsvUDgVjVFJuCiRhUtatKXUZ-8b-rAMMsnzp5yZnBEth0o2s8tYmlWmi5BjjQa-Wu-PQNf9jkEVTcJwfL7caD52xwXALYdIa2t6Gx0F8sL7IS1XVcro_A8Y/s220/Foto2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-156945889618361525.post-1582375396446332923</id><published>2024-04-17T16:27:00.004+08:00</published><updated>2024-04-18T11:26:56.765+08:00</updated><title type='text'>Python : Using Modules to Consume JSON Data from RESTful APIs</title><content type='html'>This is the source code for creating a RESTful API server that will send data in JSON format over the network.

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgavlRW1tr-MDh_jak0mKEa094curHxbwPuFstnE9tKdU4GRRlcpDWIoKpZLbMHoGfn1rBZy_9o9KfeIrAoySiTKFxk4HrmXQkiv1mU5sta9xOapfz_Sdx0PN-orAUYsfFpLqJnq6sPpJh_/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; from flask import Flask, render_template, request, url_for, redirect, jsonify  
 from jinja2 import Template, Environment, FileSystemLoader  
 import csv  
 import sys  
 import json  
 aplikasi = Flask(__name__)  
 @aplikasi.route(&#39;/data&#39;)  
 # ini adalah source code untuk membuat server RESTFUL API yang akan mengirimkan data dalam bentuk JSON di jaringan  
 def halaman1():  
   data = {}  
   with open(&#39;/home/steven/proyekFlask/latihan15/templates/file2.csv&#39;,&#39;r&#39;) as file:  
     pembacaCSV = csv.DictReader(file)  
     for rows in pembacaCSV:  
       key = rows[&#39;nomer&#39;]  
       data[key] = rows  
     return jsonify(data)  
 if __name__ == &#39;__main__&#39;:  
   aplikasi.run(host=&quot;0.0.0.0&quot;,port=8543,debug=True)  
&lt;/code&gt;&lt;/pre&gt;

&lt;br&gt;

&lt;p&gt;The following source code is used to consume JSON data sent by the RESTful API server. The RESTful API server is also created using the Python language.&lt;/p&gt;

&lt;br&gt;


&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgavlRW1tr-MDh_jak0mKEa094curHxbwPuFstnE9tKdU4GRRlcpDWIoKpZLbMHoGfn1rBZy_9o9KfeIrAoySiTKFxk4HrmXQkiv1mU5sta9xOapfz_Sdx0PN-orAUYsfFpLqJnq6sPpJh_/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; from flask import Flask  
 from flask_restful import Resource, Api  
 from flask_cors import CORS  
 import requests  
 aplikasi = Flask(__name__)  
 CORS(aplikasi)  
 # ini adalah program komputer untuk mengkonsumsi data JSON yang di kirimkan oleh server lain  
 @aplikasi.route(&#39;/&#39;, methods=[&#39;GET&#39;])  
 def tampilData():  
   r = requests.get(&#39;http://1.1.3.4:8543/data&#39;)  
   return r.json()  
 if __name__ == &#39;__main__&#39;:  
   aplikasi.run(host=&quot;0.0.0.0&quot;,port=8544,debug=True)  
&lt;/code&gt;&lt;/pre&gt;

&lt;br&gt;

&lt;p&gt;Next, we will learn everything about flask_restful. So that we can learn various things related to RESTful API.&lt;/p&gt;













</content><link rel='replies' type='application/atom+xml' href='https://www.stevennathaniel.web.id/feeds/1582375396446332923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.stevennathaniel.web.id/2024/04/python-using-modules-to-consume-json.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/1582375396446332923'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/1582375396446332923'/><link rel='alternate' type='text/html' href='https://www.stevennathaniel.web.id/2024/04/python-using-modules-to-consume-json.html' title='Python : Using Modules to Consume JSON Data from RESTful APIs'/><author><name>IT Writer</name><uri>http://www.blogger.com/profile/10445657762034183360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYuEOxtCuH6VmQBKT02CLKSsXzdABdhMAfrZB5ReJVOI_IAuaOINU7EH6XZsvUDgVjVFJuCiRhUtatKXUZ-8b-rAMMsnzp5yZnBEth0o2s8tYmlWmi5BjjQa-Wu-PQNf9jkEVTcJwfL7caD52xwXALYdIa2t6Gx0F8sL7IS1XVcro_A8Y/s220/Foto2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-156945889618361525.post-2595923859731885364</id><published>2024-03-28T10:07:00.015+08:00</published><updated>2024-04-05T09:24:55.926+08:00</updated><title type='text'>Python : Learning to Connect Between the OS Module and Flask</title><content type='html'>&lt;h1&gt;We will start to integrate Flask with other Python programming code, in this case between Flask and the OS module.&lt;/h1&gt;

&lt;br&gt;


&lt;p&gt;For the first one, we learn to use the OS module.&lt;/p&gt;

&lt;br&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgavlRW1tr-MDh_jak0mKEa094curHxbwPuFstnE9tKdU4GRRlcpDWIoKpZLbMHoGfn1rBZy_9o9KfeIrAoySiTKFxk4HrmXQkiv1mU5sta9xOapfz_Sdx0PN-orAUYsfFpLqJnq6sPpJh_/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; import os  
 alamatFolder = os.getcwd()  
 print(&quot;Lokasi Folder Saat ini : &quot;, alamatFolder)  
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;&lt;/p&gt;



&lt;br&gt;


&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgavlRW1tr-MDh_jak0mKEa094curHxbwPuFstnE9tKdU4GRRlcpDWIoKpZLbMHoGfn1rBZy_9o9KfeIrAoySiTKFxk4HrmXQkiv1mU5sta9xOapfz_Sdx0PN-orAUYsfFpLqJnq6sPpJh_/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; from flask import Flask, render_template, request, url_for, redirect  
 from jinja2 import Template, Environment, FileSystemLoader  
 import mariadb  
 import sys  
 import os  
 aplikasi = Flask(__name__)  
 @aplikasi.route(&#39;/&#39;)  
 def halaman1():  
   return render_template(&quot;halaman4.html&quot;)  
 if __name__ == &#39;__main__&#39;:  
   aplikasi.run(host=&quot;0.0.0.0&quot;,port=8543,debug=True)  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;


&lt;p&gt;This is the initial source code for displaying a message box from JavaScript, using a server made with Flask.&lt;/p&gt;

&lt;br&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgavlRW1tr-MDh_jak0mKEa094curHxbwPuFstnE9tKdU4GRRlcpDWIoKpZLbMHoGfn1rBZy_9o9KfeIrAoySiTKFxk4HrmXQkiv1mU5sta9xOapfz_Sdx0PN-orAUYsfFpLqJnq6sPpJh_/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;!DOCTYPE html&amp;gt;  
 &amp;lt;html&amp;gt;  
      &amp;lt;head&amp;gt;  
           &amp;lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&amp;gt;  
           &amp;lt;style&amp;gt;  
                .button {  
                     background-color: #04AA6D;  
                     border: none;  
                     color: white;  
                     padding: 15px 32px;  
                     text-align: center;  
                     text-decoration: none;  
                     display: block;  
                     font-size: 16px;  
                     margin: 10px 10px;  
                     cursor: pointer;  
                     -webkit-transition-duration: 0.4s;  
                     transition-duration: 0.4s;  
                }  
                .button2:hover {  
                     box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24), 0 17px 50px 0 rgba(0,0,0,0.19)  
                }  
           &amp;lt;/style&amp;gt;  
      &amp;lt;/head&amp;gt;  
      &amp;lt;body&amp;gt;  
           &amp;lt;button class=&quot;button button2&quot; type=&quot;button&quot; onclick=&quot;tampilkanPesan()&quot;&amp;gt;Uji Coba OS dan Flask&amp;lt;/button&amp;gt;  
           &amp;lt;script&amp;gt;  
                function tampilkanPesan() {  
                     alert(&quot;Menampilkan Kotak Pesan&quot;)  
                }  
           &amp;lt;/script&amp;gt;  
      &amp;lt;/body&amp;gt;  
 &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;


&lt;p&gt;We will try to build data delivery over the network using a RESTful API. In building the server and backend RESTFUL API, we use the Python programming language. We will use JavaScript to build the UI. JavaScript will also be used to consume JSON data sent through the RESTFUL API. JavaScript will be used to build AJAX technology.&lt;/p&gt;



&lt;br&gt;


&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgavlRW1tr-MDh_jak0mKEa094curHxbwPuFstnE9tKdU4GRRlcpDWIoKpZLbMHoGfn1rBZy_9o9KfeIrAoySiTKFxk4HrmXQkiv1mU5sta9xOapfz_Sdx0PN-orAUYsfFpLqJnq6sPpJh_/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; import json  
 from flask import Flask  
 import mariadb  
 import sys  
 aplikasi = Flask(__name__)  
 @aplikasi.route(&#39;/&#39;)  
 # di bawah ini adalah source code untuk mengirimkan data dalam bentuk JSON ke jaringan dan ditampilkan di browser  
 def restApi1():  
   return json.dumps({&#39;nama&#39;:&#39;alesandro&#39;,&#39;e-mail&#39;:&#39;alesandro@toto.com&#39;})  
 if __name__ == &#39;__main__&#39;:  
   aplikasi.run(host=&quot;0.0.0.0&quot;,port=8543,debug=True)  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;


&lt;p&gt;The following is the source code for reading a text file. The results of the reading will then be displayed on the web page. Alternatively, the results of the reading can be sent using a RESTful API. Once the reading results are converted to JSON, they will be displayed on the web page using AJAX.&lt;/p&gt;

&lt;br&gt;


&lt;b&gt;Python&lt;/b&gt;

&lt;br&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgavlRW1tr-MDh_jak0mKEa094curHxbwPuFstnE9tKdU4GRRlcpDWIoKpZLbMHoGfn1rBZy_9o9KfeIrAoySiTKFxk4HrmXQkiv1mU5sta9xOapfz_Sdx0PN-orAUYsfFpLqJnq6sPpJh_/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; from flask import Flask, render_template, request, url_for, redirect  
 from jinja2 import Template, Environment, FileSystemLoader  
 import mariadb  
 import sys  
 aplikasi = Flask(__name__)  
 @aplikasi.route(&#39;/&#39;)  
 def halaman1():  
   file = open(&#39;/home/steven/proyekFlask/latihan15/templates/file1.txt&#39;,&#39;r&#39;)  
   angka1 = file.read()  
   file.close()  
   return render_template(&quot;halaman5.html&quot;, angka1 = angka1)  
 if __name__ == &#39;__main__&#39;:  
   aplikasi.run(host=&quot;0.0.0.0&quot;,port=8543,debug=True)  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;


&lt;B&gt;HTML&lt;/B&gt;

&lt;br&gt;


&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgavlRW1tr-MDh_jak0mKEa094curHxbwPuFstnE9tKdU4GRRlcpDWIoKpZLbMHoGfn1rBZy_9o9KfeIrAoySiTKFxk4HrmXQkiv1mU5sta9xOapfz_Sdx0PN-orAUYsfFpLqJnq6sPpJh_/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;!DOCTYPE html&amp;gt;  
 &amp;lt;html&amp;gt;  
      &amp;lt;head&amp;gt;  
      &amp;lt;/head&amp;gt;  
      &amp;lt;body&amp;gt;  
           &amp;lt;p&amp;gt;{{ angka1 }}&amp;lt;p&amp;gt;  
      &amp;lt;/body&amp;gt;  
 &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;br&gt;




</content><link rel='replies' type='application/atom+xml' href='https://www.stevennathaniel.web.id/feeds/2595923859731885364/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.stevennathaniel.web.id/2024/03/python-learning-to-connect-between-os.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/2595923859731885364'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/2595923859731885364'/><link rel='alternate' type='text/html' href='https://www.stevennathaniel.web.id/2024/03/python-learning-to-connect-between-os.html' title='Python : Learning to Connect Between the OS Module and Flask'/><author><name>IT Writer</name><uri>http://www.blogger.com/profile/10445657762034183360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYuEOxtCuH6VmQBKT02CLKSsXzdABdhMAfrZB5ReJVOI_IAuaOINU7EH6XZsvUDgVjVFJuCiRhUtatKXUZ-8b-rAMMsnzp5yZnBEth0o2s8tYmlWmi5BjjQa-Wu-PQNf9jkEVTcJwfL7caD52xwXALYdIa2t6Gx0F8sL7IS1XVcro_A8Y/s220/Foto2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-156945889618361525.post-3827012105663811200</id><published>2024-03-27T09:09:00.003+08:00</published><updated>2024-03-27T09:17:46.653+08:00</updated><title type='text'>JavaScript : Combining Python with Javascript to Run Python Source Code on an HTML Page</title><content type='html'>We are currently learning how to combine Python and Javascript programming code to run a command on a web page.

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgavlRW1tr-MDh_jak0mKEa094curHxbwPuFstnE9tKdU4GRRlcpDWIoKpZLbMHoGfn1rBZy_9o9KfeIrAoySiTKFxk4HrmXQkiv1mU5sta9xOapfz_Sdx0PN-orAUYsfFpLqJnq6sPpJh_/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; from flask import Flask, render_template, request, url_for, redirect  
 from jinja2 import Template, Environment,FileSystemLoader  
 import mariadb  
 import sys  
 aplikasi = Flask(__name__)  
 @aplikasi.route(&#39;/&#39;)  
 def halaman1():  
   return render_template(&quot;halaman2.html&quot;)  
 if __name__ == &#39;__main__&#39;:  
   aplikasi.run(host=&quot;0.0.0.0&quot;,port=8543,debug=True)  
&lt;/code&gt;&lt;/pre&gt;

&lt;br&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgavlRW1tr-MDh_jak0mKEa094curHxbwPuFstnE9tKdU4GRRlcpDWIoKpZLbMHoGfn1rBZy_9o9KfeIrAoySiTKFxk4HrmXQkiv1mU5sta9xOapfz_Sdx0PN-orAUYsfFpLqJnq6sPpJh_/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;!DOCTYPE html&amp;gt;  
 &amp;lt;html&amp;gt;  
      &amp;lt;head&amp;gt;  
           &amp;lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&amp;gt;  
           &amp;lt;style&amp;gt;  
                .button {  
                     background-color: #04AA6D;  
                     border: none;  
                     color: white;  
                     padding: 15px 32px;  
                     text-align: center;  
                     text-decoration: none;  
                     display: block;  
                     font-size: 16px;  
                     margin: 10px 10px;  
                     cursor: pointer;  
                     -webkit-transition-duration: 0.4s;  
                     transition-duration: 0.4s;  
                }  
                .button2:hover {  
                     box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24), 0 17px 50px 0 rgba(0,0,0,0.19);  
                }  
           &amp;lt;/style&amp;gt;  
      &amp;lt;/head&amp;gt;  
      &amp;lt;body&amp;gt;  
           &amp;lt;button class=&quot;button button2&quot; onclick=&quot;document.getElementById(&#39;cetakTanggal&#39;).innerHTML = Date()&quot;&amp;gt;Uji Coba Javascript 1&amp;lt;/button&amp;gt;  
           &amp;lt;p id=&quot;cetakTanggal&quot;&amp;gt;&amp;lt;/p&amp;gt;  
      &amp;lt;/body&amp;gt;  
 &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.stevennathaniel.web.id/feeds/3827012105663811200/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.stevennathaniel.web.id/2024/03/javascript-combining-python-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/3827012105663811200'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/3827012105663811200'/><link rel='alternate' type='text/html' href='https://www.stevennathaniel.web.id/2024/03/javascript-combining-python-with.html' title='JavaScript : Combining Python with Javascript to Run Python Source Code on an HTML Page'/><author><name>IT Writer</name><uri>http://www.blogger.com/profile/10445657762034183360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYuEOxtCuH6VmQBKT02CLKSsXzdABdhMAfrZB5ReJVOI_IAuaOINU7EH6XZsvUDgVjVFJuCiRhUtatKXUZ-8b-rAMMsnzp5yZnBEth0o2s8tYmlWmi5BjjQa-Wu-PQNf9jkEVTcJwfL7caD52xwXALYdIa2t6Gx0F8sL7IS1XVcro_A8Y/s220/Foto2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-156945889618361525.post-5683970722169017283</id><published>2024-03-26T08:25:00.009+08:00</published><updated>2024-03-26T08:40:11.726+08:00</updated><title type='text'>Python : Basic Source Code to Create a Web Page Link to Display a Table</title><content type='html'>&lt;h1&gt;This source code will be further developed to display a table containing data from MariaDB.&lt;/h1&gt;

&lt;br&gt;

&lt;p&gt;This is the Python source code to connect two HTML pages through a web link : &lt;/p&gt;

&lt;br&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgavlRW1tr-MDh_jak0mKEa094curHxbwPuFstnE9tKdU4GRRlcpDWIoKpZLbMHoGfn1rBZy_9o9KfeIrAoySiTKFxk4HrmXQkiv1mU5sta9xOapfz_Sdx0PN-orAUYsfFpLqJnq6sPpJh_/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; from flask import Flask, render_template, request, url_for, redirect  
 from jinja2 import Template, Environment, FileSystemLoader  
 import mariadb  
 import sys  
 aplikasi = Flask(__name__)  
 @aplikasi.route(&#39;/&#39;)  
 def halaman1():  
   return render_template(&quot;halaman1.html&quot;)  
 @aplikasi.route(&#39;/halaman2&#39;)  
 def halaman2():  
   return render_template(&quot;halaman2.html&quot;)  
 if __name__ == &#39;__main__&#39;:  
   aplikasi.run(host=&#39;0.0.0.0&#39;,port=8543,debug=True)  
&lt;/code&gt;&lt;/pre&gt;

&lt;br&gt;


&lt;p&gt;This is the source code for the first HTML page : &lt;/p&gt;


&lt;br&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgavlRW1tr-MDh_jak0mKEa094curHxbwPuFstnE9tKdU4GRRlcpDWIoKpZLbMHoGfn1rBZy_9o9KfeIrAoySiTKFxk4HrmXQkiv1mU5sta9xOapfz_Sdx0PN-orAUYsfFpLqJnq6sPpJh_/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;!DOCTYPE html&amp;gt;  
 &amp;lt;html&amp;gt;  
      &amp;lt;head&amp;gt;  
           &amp;lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&amp;gt;  
           &amp;lt;style&amp;gt;  
           &amp;lt;/style&amp;gt;  
      &amp;lt;/head&amp;gt;  
      &amp;lt;body&amp;gt;  
           &amp;lt;h1&amp;gt;Halaman 1&amp;lt;/h1&amp;gt;  
                &amp;lt;a href=&quot;{{ url_for(&#39;halaman2&#39;)}}&quot;&amp;gt;Halaman 2&amp;lt;/a&amp;gt;  
      &amp;lt;/body&amp;gt;  
 &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;


&lt;p&gt;This is the source code for the second HTML page : &lt;/p&gt;


&lt;br&gt;


&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgavlRW1tr-MDh_jak0mKEa094curHxbwPuFstnE9tKdU4GRRlcpDWIoKpZLbMHoGfn1rBZy_9o9KfeIrAoySiTKFxk4HrmXQkiv1mU5sta9xOapfz_Sdx0PN-orAUYsfFpLqJnq6sPpJh_/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;!DOCTYPE html&amp;gt;  
 &amp;lt;html&amp;gt;  
      &amp;lt;head&amp;gt;  
           &amp;lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&amp;gt;  
      &amp;lt;/head&amp;gt;  
      &amp;lt;body&amp;gt;  
           &amp;lt;h1&amp;gt;Halaman 2&amp;lt;/h1&amp;gt;  
           &amp;lt;a href=&quot;{{ url_for(&#39;halaman1&#39;)}}&quot;&amp;gt;Halaman 1&amp;lt;/a&amp;gt;  
      &amp;lt;/body&amp;gt;  
 &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;










</content><link rel='replies' type='application/atom+xml' href='https://www.stevennathaniel.web.id/feeds/5683970722169017283/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.stevennathaniel.web.id/2024/03/python-basic-source-code-to-create-web.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/5683970722169017283'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/5683970722169017283'/><link rel='alternate' type='text/html' href='https://www.stevennathaniel.web.id/2024/03/python-basic-source-code-to-create-web.html' title='Python : Basic Source Code to Create a Web Page Link to Display a Table'/><author><name>IT Writer</name><uri>http://www.blogger.com/profile/10445657762034183360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYuEOxtCuH6VmQBKT02CLKSsXzdABdhMAfrZB5ReJVOI_IAuaOINU7EH6XZsvUDgVjVFJuCiRhUtatKXUZ-8b-rAMMsnzp5yZnBEth0o2s8tYmlWmi5BjjQa-Wu-PQNf9jkEVTcJwfL7caD52xwXALYdIa2t6Gx0F8sL7IS1XVcro_A8Y/s220/Foto2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-156945889618361525.post-6295190677409034118</id><published>2024-03-20T09:17:00.011+08:00</published><updated>2024-03-20T10:45:38.117+08:00</updated><title type='text'>Python : Python Source Code for Menu Page, Data Entry Form, and Table Page for Data Display</title><content type='html'>&lt;h1&gt;This is the menu page to display the data input menu, the data edit menu, and the menu to display a table containing the data.&lt;/h1&gt;

&lt;br&gt;

&lt;p&gt;This is the source code for the menu page. The menu page is at the forefront and serves as a gateway to access various features in the application.&lt;/p&gt;

&lt;br&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;!DOCTYPE html&amp;gt;  
 &amp;lt;html&amp;gt;  
      &amp;lt;head&amp;gt;  
           &amp;lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&amp;gt;  
           &amp;lt;style&amp;gt;  
                .vertical-menu {  
                     width: 200px;  
                }  
                .vertical-menu a{  
                     background-color: #eee;  
                     color: black;  
                     display: block;  
                     padding: 12px;  
                     text-decoration: none;  
                }  
                .vertical-menu a:hover {  
                     background-color: #ccc;  
                }  
                .vertical-menu a.active{  
                     background-color: #04AA6D;  
                     color: white;  
                }  
           &amp;lt;/style&amp;gt;  
      &amp;lt;/head&amp;gt;  
      &amp;lt;body&amp;gt;  
           &amp;lt;h1&amp;gt;Vertical Menu&amp;lt;/h1&amp;gt;  
           &amp;lt;div class=&quot;vertical-menu&quot;&amp;gt;  
                &amp;lt;a href=&quot;{{ url_for(&#39;halaman1&#39;)}}&quot; class=&quot;active&quot;&amp;gt;Halaman Menu&amp;lt;/a&amp;gt;  
                &amp;lt;a href=&quot;{{ url_for(&#39;halaman2&#39;)}}&quot;&amp;gt;Halaman Simpan Data&amp;lt;/a&amp;gt;  
                &amp;lt;a href=&quot;{{ url_for(&#39;halaman3&#39;)}}&quot;&amp;gt;Halaman Edit Data&amp;lt;/a&amp;gt;  
                &amp;lt;a href=&quot;{{ url_for(&#39;halaman4&#39;)}}&quot;&amp;gt;Halaman Tabel Data&amp;lt;/a&amp;gt;  
           &amp;lt;/div&amp;gt;  
      &amp;lt;/body&amp;gt;  
 &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;



&lt;p&gt;This is the source code for the data input page. There is also a button to display a table containing the data stored in the MariaDB table. There is also a button to return to the Menu page.&lt;/p&gt;


&lt;br&gt;


&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;!DOCTYPE html&amp;gt;  
 &amp;lt;html&amp;gt;  
      &amp;lt;head&amp;gt;  
           &amp;lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&amp;gt;  
           &amp;lt;style&amp;gt;  
                input[type=text], select {  
                     width: 100%;  
                     padding: 12px 20px;  
                     margin: 8px 0p;  
                     display: inline-block;  
                     border: 1px solid #ccc;  
                     border-radius: 4px;  
                     box-sizing: border-box;  
                }  
                input[type=submit] {  
                     width: 100%;  
                     background-color: #4CAF50;  
                     color: white;  
                     padding: 14px 20px;  
                     margin: 8px 0;  
                     border: none;  
                     border-radius: 4px;  
                     cursor: pointer;  
                }  
                input[type=submit]:hover {  
                     background-color: #45a049;  
                }  
                div {  
                     border-radius: 5px;  
                     background-color: #8ecaed;  
                     padding: 20px;  
                }  
           &amp;lt;/style&amp;gt;  
      &amp;lt;/head&amp;gt;  
      &amp;lt;body&amp;gt;  
           &amp;lt;h1&amp;gt;Halaman Input Data&amp;lt;/h1&amp;gt;  
           &amp;lt;div&amp;gt;  
                &amp;lt;form action=&quot;http://1.1.3.9:8543/halaman2&quot; method=&quot;POST&quot; id=&quot;formSimpanDataSurat&quot; name=&quot;formSimpanDataSurat&quot;&amp;gt;  
                     &amp;lt;label for=&quot;kodedatanomersurat1&quot;&amp;gt;Kode Data Nomer Surat&amp;lt;/label&amp;gt;  
                     &amp;lt;input type=&quot;text&quot; id=&quot;kodedatanomersurat1&quot; name=&quot;kodedatanomersurat1&quot; placeholder=&quot;Isikan Kode Data Nomer Surat&quot;&amp;gt;  
                     &amp;lt;label for=&quot;tanggalsurat1&quot;&amp;gt;Tanggal Surat&amp;lt;/label&amp;gt;  
                     &amp;lt;input type=&quot;text&quot; id=&quot;tanggalsurat1&quot; name=&quot;tanggalsurat1&quot; placeholder=&quot;Isikan Tanggal Surat&quot;&amp;gt;  
                     &amp;lt;label for=&quot;nomersurat1&quot;&amp;gt;Nomer Surat&amp;lt;/label&amp;gt;  
                     &amp;lt;input type=&quot;text&quot; id=&quot;nomersurat1&quot; name=&quot;nomersurat1&quot; placeholder=&quot;Isikan Nomer Surat&quot;&amp;gt;  
                     &amp;lt;label for=&quot;perihalsurat1&quot;&amp;gt;Perihal Surat&amp;lt;/label&amp;gt;  
                     &amp;lt;input type=&quot;text&quot; id=&quot;perihalsurat1&quot; name=&quot;perihalsurat1&quot; placeholder=&quot;Isikan Perihal Surat&quot;&amp;gt;  
                     &amp;lt;input type=&quot;submit&quot; name=&quot;tombolPerintah&quot; value=&quot;Simpan Data&quot;&amp;gt;  
                     &amp;lt;input type=&quot;submit&quot; name=&quot;tombolPerintah&quot; value=&quot;Tampilkan Tabel Data&quot;&amp;gt;  
                     &amp;lt;input type=&quot;submit&quot; name=&quot;tombolPerintah&quot; value=&quot;Kembali Ke Halaman Menu&quot;&amp;gt;  
                &amp;lt;/form&amp;gt;  
           &amp;lt;/div&amp;gt;  
      &amp;lt;/body&amp;gt;  
 &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;


&lt;p&gt;This is the HTML source code to display a table containing data from the MariaDB server.&lt;/p&gt;


&lt;br&gt;


&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;!DOCTYPE html&amp;gt;  
 &amp;lt;html&amp;gt;  
      &amp;lt;head&amp;gt;  
           &amp;lt;style&amp;gt;  
                #dataNama {  
                     font-family: Arial, Helvetica, sans-serif;  
                     border-collapse: collapse;  
                     width: 100%;  
                }  
                #dataNama td, #dataNama th {  
                     border: 1px solid #ddd;  
                     padding: 8px;  
                }  
                #dataNama tr:nth-child(even){background-color: #f2f2f2;}  
                #dataNama tr:hover {background-color: #dataNama}  
                #dataNama th{  
                     padding-top: 12px;  
                     padding-bottom: 12px;  
                     text-align: left;  
                     background-color: #04AA6D;  
                     color: white;  
                }  
           &amp;lt;/style&amp;gt;  
      &amp;lt;/head&amp;gt;  
      &amp;lt;body&amp;gt;  
           &amp;lt;table id=&quot;dataNama&quot;&amp;gt;  
                &amp;lt;!--- Ini adalah source code untuk membuat header table ----&amp;gt;  
                {% if hasil1 %}  
                &amp;lt;tr&amp;gt;  
                     {% for key in hasil1[0] %}  
                          &amp;lt;th&amp;gt;{{ key }}&amp;lt;/th&amp;gt;  
                     {% endfor %}  
                &amp;lt;/tr&amp;gt;  
                {% endif %}  
                &amp;lt;!----- ini adalah source code untuk membuat isi tabel  ------&amp;gt;  
                {% for isitabel in hasil1 %}  
                &amp;lt;tr&amp;gt;  
                     {% for value in isitabel.values()%}  
                          &amp;lt;td&amp;gt;{{ value }}&amp;lt;/td&amp;gt;  
                     {% endfor %}  
                &amp;lt;/tr&amp;gt;  
                {% endfor %}  
           &amp;lt;/table&amp;gt;  
      &amp;lt;/body&amp;gt;  
 &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;


&lt;p&gt;This is the source code written in Python. This source code is used to control and run the features on the three web pages above.&lt;/p&gt;



&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; from flask import Flask, render_template, request, url_for, redirect  
 from jinja2 import Template, Environment, FileSystemLoader  
 import mariadb  
 import sys  
 aplikasi = Flask(__name__)  
 @aplikasi.route(&#39;/&#39;)  
 def halaman1():  
   return render_template(&quot;halaman1.html&quot;)  
 @aplikasi.route(&#39;/halaman2&#39;, methods=[&#39;GET&#39;,&#39;POST&#39;])  
 def halaman2():  
   if request.method == &#39;POST&#39;:  
     if request.form[&#39;tombolPerintah&#39;] == &#39;Simpan Data&#39;:  
       kodeDataNomerSurat1 = request.form.get(&#39;kodedatanomersurat1&#39;)  
       tanggalSurat1 = request.form.get(&#39;tanggalsurat1&#39;)  
       nomerSurat1 = request.form.get(&#39;nomersurat1&#39;)  
       perihalSurat1 = request.form.get(&#39;perihalsurat1&#39;)  
       koneksi = mariadb.connect(user=&quot;steven&quot;,password=&quot;kucing&quot;,host=&quot;1.1.3.9&quot;,port=3306,database=&quot;saham&quot;)  
       kursor = koneksi.cursor()  
       kursor.execute(&quot;INSERT INTO nomersurat(kodedatanomersurat,tanggalsurat,nomersurat,perihalsurat) VALUES (%s,%s,%s,%s)&quot;,(kodeDataNomerSurat1,tanggalSurat1,nomerSurat1,perihalSurat1))  
       koneksi.commit()  
       koneksi.close()  
       return redirect(url_for(&#39;halaman1&#39;))  
     # elif request.form[&#39;tombolPerintah&#39;] == &#39;Tampilkan Tabel Data&#39;:  
     elif request.form[&#39;tombolPerintah&#39;] == &#39;Tampilkan Tabel Data&#39;:  
       koneksi = mariadb.connect(user=&quot;steven&quot;,password=&quot;kucing&quot;,host=&quot;1.1.3.9&quot;,port=3306,database=&quot;saham&quot;)  
       kursor = koneksi.cursor(dictionary=True)  
       kursor.execute(&quot;SELECT kodedatanomersurat,tanggalsurat,nomersurat,perihalsurat FROM nomersurat&quot;)  
       hasil = kursor.fetchall()  
       return render_template(&quot;halaman4.html&quot;,hasil1=hasil)  
     # elif request.form[&#39;tombolPerintah&#39;] == &#39;Kembali Ke Halaman Menu&#39;:  
     elif request.form[&#39;tombolPerintah&#39;] == &#39;Kembali Ke Halaman Menu&#39;:  
       return redirect(url_for(&#39;halaman1&#39;))  
   return render_template(&quot;halaman2.html&quot;)  
 @aplikasi.route(&#39;/halaman3&#39;)  
 def halaman3():  
   return render_template(&quot;halaman3.html&quot;)  
 @aplikasi.route(&#39;/halaman4&#39;)  
 def halaman4():  
   return render_template(&quot;halaman4.html&quot;)  
 if __name__ == &#39;__main__&#39;:  
   aplikasi.run(host=&quot;0.0.0.0&quot;,port=8543,debug=True)  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;



</content><link rel='replies' type='application/atom+xml' href='https://www.stevennathaniel.web.id/feeds/6295190677409034118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.stevennathaniel.web.id/2024/03/python-python-source-code-for-menu-page.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/6295190677409034118'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/6295190677409034118'/><link rel='alternate' type='text/html' href='https://www.stevennathaniel.web.id/2024/03/python-python-source-code-for-menu-page.html' title='Python : Python Source Code for Menu Page, Data Entry Form, and Table Page for Data Display'/><author><name>IT Writer</name><uri>http://www.blogger.com/profile/10445657762034183360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYuEOxtCuH6VmQBKT02CLKSsXzdABdhMAfrZB5ReJVOI_IAuaOINU7EH6XZsvUDgVjVFJuCiRhUtatKXUZ-8b-rAMMsnzp5yZnBEth0o2s8tYmlWmi5BjjQa-Wu-PQNf9jkEVTcJwfL7caD52xwXALYdIa2t6Gx0F8sL7IS1XVcro_A8Y/s220/Foto2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-156945889618361525.post-2277217746316330679</id><published>2024-03-15T09:10:00.007+08:00</published><updated>2024-03-15T09:45:39.858+08:00</updated><title type='text'>Python : Source Code of The Menu For Accessing The Data Entry Page</title><content type='html'>&lt;p&gt;This is the HTML source code for a vertical menu. The menu contains a list of actions that can be performed on the data.&lt;/p&gt;

&lt;br&gt;


&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;!DOCTYPE html&amp;gt;  
 &amp;lt;html&amp;gt;  
      &amp;lt;head&amp;gt;  
           &amp;lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&amp;gt;  
           &amp;lt;style&amp;gt;  
                .vertical-menu{  
                     width: 200px;  
                }  
                .vertical-menu a{  
                     background-color: #eee;  
                     color: black;  
                     display: block;  
                     padding: 12px;  
                     text-decoration: none;  
                }  
                .vertical-menu a:hover {  
                     background-color: #ccc;  
                }  
                .vertical-menu a.active {  
                     background-color: #04AA6D;  
                     color: white;  
                }  
           &amp;lt;/style&amp;gt;  
      &amp;lt;/head&amp;gt;  
      &amp;lt;body&amp;gt;  
           &amp;lt;h1&amp;gt;Vertical Menu&amp;lt;/h1&amp;gt;  
           &amp;lt;div class=&quot;vertical-menu&quot;&amp;gt;  
                &amp;lt;a href=&quot;{{ url_for(&#39;halaman1&#39;)}}&quot; class=&quot;active&quot;&amp;gt;Halaman Menu&amp;lt;/a&amp;gt;  
                &amp;lt;a href=&quot;{{ url_for(&#39;halaman2&#39;)}}&quot;&amp;gt;Halaman Simpan Data&amp;lt;/a&amp;gt;  
                &amp;lt;a href=&quot;#&quot;&amp;gt;Halaman 3&amp;lt;/a&amp;gt;  
                &amp;lt;a href=&quot;#&quot;&amp;gt;Halaman 4&amp;lt;/a&amp;gt;  
                &amp;lt;a href=&quot;#&quot;&amp;gt;Halaman 5&amp;lt;/a&amp;gt;  
           &amp;lt;/div&amp;gt;  
      &amp;lt;/body&amp;gt;  
 &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;


&lt;p&gt;This is the HTML source code for creating a form that will be used to fill data into the Mariadb server.&lt;/p&gt;

&lt;br&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;!DOCTYPE html&amp;gt;  
 &amp;lt;html&amp;gt;  
 &amp;lt;head&amp;gt;  
      &amp;lt;style&amp;gt;  
           input[type=text], select{  
                width: 100%;  
                padding: 12px 20px;  
                margin: 8px 0;  
                display: inline-block;  
                border: 1px solid #ccc;  
                border-radius: 4px;  
                box-sizing: border-box;  
           }  
           input[type=submit] {  
                width: 100%;  
                background-color: #4CAF50;  
                color: white;  
                padding: 14px 20px;  
                margin: 8px 0;  
                border: none;  
                border-radius: 4px;  
                cursor: pointer;  
           }  
           input[type=submit]:hover{  
                background-color: #45a049;  
           }  
           div{  
                border-radius: 5px;  
                background-color: #8ecaed;  
                padding: 20px;  
           }  
      &amp;lt;/style&amp;gt;  
 &amp;lt;/head&amp;gt;  
 &amp;lt;body&amp;gt;  
      &amp;lt;h1&amp;gt;Halaman Input Data&amp;lt;/h1&amp;gt;  
      &amp;lt;di&amp;gt;  
           &amp;lt;form action=&quot;http://1.1.3.10:8543/halaman2&quot; method=&quot;POST&quot; id=&quot;formSimpanDataSurat&quot; name=&quot;formSimpanDataSurat&quot;&amp;gt;  
                &amp;lt;label for=&quot;kodedatanomersurat1&quot;&amp;gt;Kode Data Nomer Surat&amp;lt;/label&amp;gt;  
                &amp;lt;input type=&quot;text&quot; id=&quot;kodedatanomersurat1&quot; name=&quot;kodedatanomersurat1&quot; placeholder=&quot;Isikan Kode Data Nomer Surat&quot;&amp;gt;  
                &amp;lt;label for=&quot;tanggalsurat1&quot;&amp;gt;Tanggal Surat&amp;lt;/label&amp;gt;  
                &amp;lt;input type=&quot;text&quot; id=&quot;tanggalsurat1&quot; name=&quot;tanggalsurat1&quot; placeholder=&quot;Isikan Tanggal Surat&quot;&amp;gt;  
                &amp;lt;label for=&quot;nomersurat1&quot;&amp;gt;Nomer Surat&amp;lt;/label&amp;gt;  
                &amp;lt;input type=&quot;text&quot; id=&quot;nomersurat1&quot; name=&quot;nomersurat1&quot; placeholder=&quot;Isikan Nomer Surat&quot;&amp;gt;  
                &amp;lt;label for=&quot;perihalsurat1&quot;&amp;gt;Perihal Surat&amp;lt;/label&amp;gt;  
                &amp;lt;input type=&quot;text&quot; id=&quot;perihalsurat1&quot; name=&quot;perihalsurat1&quot; placeholder=&quot;Isikan Perihal Surat&quot;&amp;gt;  
                &amp;lt;input type=&quot;submit&quot; name=&quot;tombolPerintah&quot; value=&quot;Simpan Data&quot;&amp;gt;  
                &amp;lt;input type=&quot;submit&quot; name=&quot;tombolPerintah&quot; value=&quot;Kembali Ke Halaman Menu&quot;&amp;gt;  
           &amp;lt;/form&amp;gt;  
      &amp;lt;/div&amp;gt;  
 &amp;lt;/body&amp;gt;  
 &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;


&lt;p&gt;This is the Python source code for displaying a menu, data entry page, and executing the data entry command from the form to the Mariadb database.&lt;/p&gt;


&lt;br&gt;



&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; from flask import Flask, render_template, request, url_for, redirect  
 from jinja2 import Template, Environment, FileSystemLoader  
 import mariadb  
 import sys  
 aplikasi = Flask(__name__)  
 @aplikasi.route(&#39;/&#39;)  
 def halaman1():  
   return render_template(&quot;halaman1.html&quot;)  
 @aplikasi.route(&#39;/halaman2&#39;, methods=[&#39;GET&#39;,&#39;POST&#39;])  
 def halaman2():  
   if request.method == &#39;POST&#39;:  
     if request.form[&#39;tombolPerintah&#39;] == &#39;Simpan Data&#39;:  
       kodeDataNomerSurat1 = request.form.get(&#39;kodedatanomersurat1&#39;)  
       tanggalSurat1 = request.form.get(&#39;tanggalsurat1&#39;)  
       nomerSurat1 = request.form.get(&#39;nomersurat1&#39;)  
       perihalSurat1 = request.form.get(&#39;perihalsurat1&#39;)  
       koneksi = mariadb.connect(user=&quot;steven&quot;,password=&quot;kucing&quot;,host=&quot;1.1.3.10&quot;,port=3306,database=&quot;saham&quot;)  
       kursor = koneksi.cursor()  
       kursor.execute(&quot;INSERT INTO nomersurat(kodedatanomersurat,tanggalsurat,nomersurat,perihalsurat) VALUES (%s,%s,%s,%s)&quot;,(kodeDataNomerSurat1,tanggalSurat1,nomerSurat1,perihalSurat1))  
       koneksi.commit()  
       koneksi.close()  
       return redirect(url_for(&#39;halaman1&#39;))  
     elif request.form[&#39;tombolPerintah&#39;] == &#39;Kembali Ke Halaman Menu&#39;:  
       return redirect(url_for(&#39;halaman1&#39;))  
     # return redirect(url_for(&#39;halaman1&#39;))  
   return render_template(&#39;halaman2.html&#39;)  
 if __name__ == &#39;__main__&#39;:  
   aplikasi.run(host=&quot;0.0.0.0&quot;,port=8543,debug=True)  
&lt;/code&gt;&lt;/pre&gt;





</content><link rel='replies' type='application/atom+xml' href='https://www.stevennathaniel.web.id/feeds/2277217746316330679/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.stevennathaniel.web.id/2024/03/python-source-code-of-menu-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/2277217746316330679'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/2277217746316330679'/><link rel='alternate' type='text/html' href='https://www.stevennathaniel.web.id/2024/03/python-source-code-of-menu-for.html' title='Python : Source Code of The Menu For Accessing The Data Entry Page'/><author><name>IT Writer</name><uri>http://www.blogger.com/profile/10445657762034183360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYuEOxtCuH6VmQBKT02CLKSsXzdABdhMAfrZB5ReJVOI_IAuaOINU7EH6XZsvUDgVjVFJuCiRhUtatKXUZ-8b-rAMMsnzp5yZnBEth0o2s8tYmlWmi5BjjQa-Wu-PQNf9jkEVTcJwfL7caD52xwXALYdIa2t6Gx0F8sL7IS1XVcro_A8Y/s220/Foto2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-156945889618361525.post-8283689476575928154</id><published>2024-03-14T10:35:00.007+08:00</published><updated>2024-03-14T10:55:25.212+08:00</updated><title type='text'>Python : This is An Example of Source Code That Inspires How to Create Menus and Links.</title><content type='html'>&lt;h1&gt;This is the source code for displaying a menu that already uses CSS. This source code example is taken from a source on the internet.&lt;/h1&gt;

&lt;br&gt;


&lt;h2&gt;HTML Source Code&lt;/h2&gt;

&lt;br&gt;

&lt;h3&gt;HTML Source Code For Page 1&lt;/h3&gt;

&lt;br&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;!DOCTYPE html&amp;gt;  
 &amp;lt;html&amp;gt;  
      &amp;lt;head&amp;gt;  
      &amp;lt;/head&amp;gt;  
      &amp;lt;body&amp;gt;  
           &amp;lt;p&amp;gt;&amp;lt;a href=&quot;{{ url_for(&#39;halaman2&#39;)}}&quot;&amp;gt;Coba anda lihat form ini&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;  
      &amp;lt;/body&amp;gt;  
 &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;


&lt;h3&gt;HTML Source Code For Page 2&lt;/h3&gt;


&lt;br&gt;


&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;!DOCTYPE html&amp;gt;  
 &amp;lt;html&amp;gt;  
      &amp;lt;head&amp;gt;  
      &amp;lt;/head&amp;gt;  
      &amp;lt;body&amp;gt;  
           &amp;lt;form method=&quot;post&quot;&amp;gt;  
                &amp;lt;button type=&quot;submit&quot;&amp;gt;Uji Coba&amp;lt;/button&amp;gt;  
           &amp;lt;/form&amp;gt;  
      &amp;lt;/body&amp;gt;  
 &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;



&lt;br&gt;


&lt;h3&gt;Python Code : &lt;/h3&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; from flask import Flask, request, url_for, redirect, render_template  
 from jinja2 import Template, Environment, FileSystemLoader  
 import mariadb  
 import sys  
 aplikasi = Flask(__name__)  
 @aplikasi.route(&#39;/&#39;)  
 def halaman1():  
   return render_template(&#39;halaman1.html&#39;)  
 @aplikasi.route(&#39;/halaman2&#39;, methods=[&#39;GET&#39;,&#39;POST&#39;])  
 def halaman2():  
   if request.method == &#39;POST&#39;:  
     # lakukan sesuatu ketika form di kumpulkan  
     # dialihkan untuk mengakhiri penanganan POST  
     # pengalihan bisa ke route yang sama atau ke sesuatu yang lain  
     return redirect(url_for(&#39;halaman1&#39;))  
   # tampilkan form nya, form nya tidak di kumpulkan  
   return render_template(&#39;halaman2.html&#39;)  
 if __name__ == &#39;__main__&#39;:  
   aplikasi.run(host=&#39;0.0.0.0&#39;,port=8543,debug=True)  
&lt;/code&gt;&lt;/pre&gt;












</content><link rel='replies' type='application/atom+xml' href='https://www.stevennathaniel.web.id/feeds/8283689476575928154/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.stevennathaniel.web.id/2024/03/python-this-is-example-of-source-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/8283689476575928154'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/8283689476575928154'/><link rel='alternate' type='text/html' href='https://www.stevennathaniel.web.id/2024/03/python-this-is-example-of-source-code.html' title='Python : This is An Example of Source Code That Inspires How to Create Menus and Links.'/><author><name>IT Writer</name><uri>http://www.blogger.com/profile/10445657762034183360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYuEOxtCuH6VmQBKT02CLKSsXzdABdhMAfrZB5ReJVOI_IAuaOINU7EH6XZsvUDgVjVFJuCiRhUtatKXUZ-8b-rAMMsnzp5yZnBEth0o2s8tYmlWmi5BjjQa-Wu-PQNf9jkEVTcJwfL7caD52xwXALYdIa2t6Gx0F8sL7IS1XVcro_A8Y/s220/Foto2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-156945889618361525.post-5328745439177780060</id><published>2024-03-14T10:06:00.007+08:00</published><updated>2024-03-14T10:15:35.827+08:00</updated><title type='text'>Python : Learning How To Create A Menu And Link It To Routes To Open Different Pages.</title><content type='html'>&lt;h1&gt;This is the source code for an HTML page containing a menu &lt;/h1&gt;


&lt;br&gt;


&lt;h2&gt;HTML Code : &lt;/h2&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;!DOCTYPE html&amp;gt;  
 &amp;lt;html&amp;gt;  
      &amp;lt;head&amp;gt;  
           &amp;lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&amp;gt;  
           &amp;lt;style&amp;gt;  
                .vertical-menu{  
                     width: 200px;  
                }  
                .vertical-menu a{  
                     background-color: #eee;  
                     color: black;  
                     display: block;  
                     padding: 12px;  
                     text-decoration: none;  
                }  
                .vertical-menu a:hover {  
                     background-color: #ccc;  
                }  
                .vertical-menu a.active {  
                     background-color: #04AA6D;  
                     color: white;  
                }  
           &amp;lt;/style&amp;gt;  
      &amp;lt;/head&amp;gt;  
      &amp;lt;body&amp;gt;  
           &amp;lt;h1&amp;gt;Vertical Menu&amp;lt;/h1&amp;gt;  
           &amp;lt;div class=&quot;vertical-menu&quot;&amp;gt;  
                &amp;lt;a href=&quot;#&quot; class=&quot;active&quot;&amp;gt;Halaman Utama&amp;lt;/a&amp;gt;  
                &amp;lt;a href=&quot;#&quot;&amp;gt;Halaman 1&amp;lt;/a&amp;gt;  
                &amp;lt;a href=&quot;#&quot;&amp;gt;Halaman 2&amp;lt;/a&amp;gt;  
                &amp;lt;a href=&quot;#&quot;&amp;gt;Halaman 3&amp;lt;/a&amp;gt;  
                &amp;lt;a href=&quot;#&quot;&amp;gt;Halaman 4&amp;lt;/a&amp;gt;  
           &amp;lt;/div&amp;gt;  
      &amp;lt;/body&amp;gt;  
 &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;


&lt;h2&gt;Python Code : &lt;/h2&gt;

&lt;br&gt;


&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; from flask import Flask, render_template, request  
 from jinja2 import Template, Environment, FileSystemLoader  
 aplikasi = Flask(__name__)  
 @aplikasi.route(&#39;/&#39;)  
 def tampilHalaman():  
   return render_template(&quot;halaman1.html&quot;)  
 if __name__ == &#39;__main__&#39;:  
   aplikasi.run(host=&quot;0.0.0.0&quot;,port=8543,debug=True)  
&lt;/code&gt;&lt;/pre&gt;


</content><link rel='replies' type='application/atom+xml' href='https://www.stevennathaniel.web.id/feeds/5328745439177780060/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.stevennathaniel.web.id/2024/03/python-learning-how-to-create-menu-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/5328745439177780060'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/5328745439177780060'/><link rel='alternate' type='text/html' href='https://www.stevennathaniel.web.id/2024/03/python-learning-how-to-create-menu-and.html' title='Python : Learning How To Create A Menu And Link It To Routes To Open Different Pages.'/><author><name>IT Writer</name><uri>http://www.blogger.com/profile/10445657762034183360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYuEOxtCuH6VmQBKT02CLKSsXzdABdhMAfrZB5ReJVOI_IAuaOINU7EH6XZsvUDgVjVFJuCiRhUtatKXUZ-8b-rAMMsnzp5yZnBEth0o2s8tYmlWmi5BjjQa-Wu-PQNf9jkEVTcJwfL7caD52xwXALYdIa2t6Gx0F8sL7IS1XVcro_A8Y/s220/Foto2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-156945889618361525.post-8518679993197801989</id><published>2024-02-21T10:57:00.036+08:00</published><updated>2024-03-08T09:52:41.801+08:00</updated><title type='text'>Python : Exercises on Using Dictionaries in Python</title><content type='html'>&lt;h1&gt;The following are exercises on using Dictionaries in Python that have been completed today.&lt;/h1&gt;

&lt;br&gt;

&lt;p&gt;&lt;b&gt;file14.py&lt;/b&gt;&lt;/p&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; kamusku = {}  
 kamusku[&#39;nama&#39;] = &quot;Steven Nathaniel&quot;  
 kamusku[&#39;usia&#39;] = 1  
 print (kamusku)  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;


&lt;p&gt;&lt;b&gt;file15.py&lt;/b&gt;&lt;/p&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; kamusku = {}  
 print(kamusku)  
 print(type(kamusku))  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;


&lt;p&gt;&lt;b&gt;file16.py&lt;/b&gt;&lt;/p&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; informasi = {&#39;nama&#39;:&#39;steven&#39;,&#39;usia&#39;:15,&#39;lokasi&#39;:&#39;Athena&#39;}  
 print(informasi)  
 print(type(informasi))  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;


&lt;p&gt;&lt;b&gt;file17.py&lt;/b&gt;&lt;/p&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; informasi = dict({&#39;nama&#39;:&#39;steven&#39;,&#39;usia&#39;:15,&#39;lokasi&#39;:&#39;Athena&#39;})  
 print(informasi)  
 print(type(informasi))  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;


&lt;p&gt;&lt;b&gt;file18.py&lt;/b&gt;&lt;/p&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; namaKota = (&#39;Samarinda&#39;,&#39;Athena&#39;,&#39;Balikpapan&#39;)  
 kamusKu = dict.fromkeys(namaKota)  
 print(kamusKu)  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;


&lt;p&gt;&lt;b&gt;file19.py&lt;/b&gt;&lt;/p&gt;


&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; namaKota = (&#39;Balikpapan&#39;,&#39;Samarinda&#39;,&#39;Jakarta&#39;)  
 negara = &#39;Indonesia&#39;  
 kamus = dict.fromkeys(namaKota,negara)  
 print(kamus)  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;


&lt;p&gt;&lt;b&gt;file20.py&lt;/b&gt;&lt;/p&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; namaKota = (&#39;Balikpapan&#39;,&#39;Samarinda&#39;,&#39;Jakarta&#39;)  
 negara = &#39;indonesia&#39;  
 kamus = dict.fromkeys(namaKota,negara)  
 print(len(kamus))  
&lt;/code&gt;&lt;/pre&gt;



&lt;br&gt;


&lt;p&gt;&lt;b&gt;file21.py&lt;/b&gt;&lt;/p&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; tahunPembuatanMobil = {&#39;Kijang&#39;: 1997, &#39;Lancer&#39;: 1995, &#39;Accord&#39;: 1999}  
 print(tahunPembuatanMobil.values())  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;


&lt;p&gt;&lt;b&gt;file22.py&lt;/b&gt;&lt;/p&gt;


&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; dataRoti = {&#39;merekRoti&#39;: &#39;Sari Roti&#39;, &#39;tanggalProduksi&#39;: 22, &#39;bulanProduksi&#39;: &#39;Februari&#39;}  
 print(dataRoti[&#39;merekRoti&#39;])  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;



&lt;p&gt;&lt;b&gt;file23.py&lt;/b&gt;&lt;/p&gt;


&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; dataRoti = {&#39;merekRoti&#39;: &#39;Sari Roti&#39;, &#39;tanggalProduksi&#39;: 22, &#39;bulanProduksi&#39;: &#39;Februari&#39;}  
 print(&#39;merekNasi&#39; in dataRoti)  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;




&lt;p&gt;&lt;b&gt;file24.py&lt;/b&gt;&lt;/p&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; dataRoti = {&#39;merekRoti&#39;: &#39;Sari Roti&#39;, &#39;tanggalProduksi&#39;: 22, &#39;bulanProduksi&#39;: &#39;Februari&#39;}  
 print(dataRoti.get(&#39;merekRoti&#39;))  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;


&lt;p&gt;&lt;b&gt;file25.py&lt;/b&gt;&lt;/p&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; dataRoti = {}  
 dataRoti[&quot;namaRoti&quot;] = &quot;Roti Bakar Kepiting&quot;  
 print(dataRoti)  
&lt;/code&gt;&lt;/pre&gt;

&lt;br&gt;



&lt;p&gt;&lt;b&gt;file26.py&lt;/b&gt;&lt;/p&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; dataRoti = {}  
 dataRoti[&#39;namaRoti&#39;] = &quot;Roti Bakar Mentega&quot;  
 dataRoti[&#39;jumlahRoti&#39;] = 10  
 print(dataRoti)  
&lt;/code&gt;&lt;/pre&gt;

&lt;br&gt;



&lt;p&gt;&lt;b&gt;file27.py&lt;/b&gt;&lt;/p&gt;


&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; dataRoti = {&#39;namaRoti&#39;:&quot;Roti Bakar Mentega&quot;, &#39;jumlahRoti&#39;:9}  
 print(dataRoti)  
 dataRoti[&#39;jumlahRoti&#39;] = 11  
 print(dataRoti)  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;


&lt;p&gt;&lt;b&gt;file28.py&lt;/b&gt;&lt;/p&gt;


&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; dataRoti = {&#39;namaRoti&#39;:&quot;Roti Goreng Mentega&quot;,&#39;kemasanRoti&#39;:&quot;Plastik&quot;}  
 print(dataRoti)  
 dataRoti[&#39;kemasanRoti&#39;] = &quot;Kayu&quot;  
 print(&#39;kemasanRoti&#39; in dataRoti)  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;


&lt;p&gt;&lt;b&gt;file29.py&lt;/b&gt;&lt;/p&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; dataRoti = {&#39;merekRoti&#39;:&quot;Bondy&quot;, &#39;jumlahLembar&#39;:10}  
 dataRoti.update(merekRoti=&#39;Holland&#39;, jumlahLembar=50, penggunaanKulit=&#39;Kulit&#39;)  
 print(dataRoti)  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;



&lt;p&gt;&lt;b&gt;file30.py&lt;/b&gt;&lt;/p&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; dataRoti = {&#39;merekRoti&#39;:&#39;Bondy&#39;,&#39;bulanPembuatan&#39;:&#39;Februari&#39;,&#39;lokasiToko&#39;:&#39;Gunung Sari&#39;}  
 del dataRoti[&#39;bulanPembuatan&#39;]  
 print(dataRoti)  
&lt;/code&gt;&lt;/pre&gt;

&lt;br&gt;


&lt;p&gt;This is a source code that almost successfully displays data from the database into a table format.&lt;/p&gt;

&lt;br&gt;

&lt;p&gt;This is the source code for the Python section.&lt;/p&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; import mariadb  
 import sys  
 from jinja2 import Template, Environment, FileSystemLoader  
 from flask import Flask, render_template, request  
 aplikasi = Flask(__name__)  
 @aplikasi.route(&#39;/&#39;)  
 def tampilkanData():  
   koneksi = mariadb.connect(user=&quot;steven&quot;,password=&quot;kucing&quot;,host=&quot;1.1.3.7&quot;,port=3306,database=&quot;saham&quot;)  
   kursor = koneksi.cursor(dictionary=True)  
   kursor.execute(&quot;SELECT idnama1,namaawal1,namaakhir1 FROM nama1&quot;)  
   hasil = kursor.fetchall()  
   koneksi.commit()  
   koneksi.close()  
   return render_template(&quot;halaman6.html&quot;,hasil=hasil)  
 if __name__ == &#39;__main__&#39;:  
   aplikasi.run(host=&quot;0.0.0.0&quot;, port=8543, debug=True)  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;


&lt;p&gt;This is the source code for the HTML section.&lt;/p&gt;

&lt;br&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;!DOCTYPE html&amp;gt;  
 &amp;lt;html&amp;gt;  
      &amp;lt;head&amp;gt;  
      &amp;lt;/head&amp;gt;  
      &amp;lt;body&amp;gt;  
           &amp;lt;h1&amp;gt;Tampilkan Tabel&amp;lt;/h1&amp;gt;  
           &amp;lt;table&amp;gt;  
                {% for hasil_item in hasil %}  
                     {% for key, value in hasil_item.items() %}  
                          &amp;lt;tr&amp;gt;  
                               &amp;lt;th&amp;gt;{{ key }}&amp;lt;/th&amp;gt;  
                          &amp;lt;/tr&amp;gt;  
                          &amp;lt;tr&amp;gt;  
                               &amp;lt;td&amp;gt;{{ value }}&amp;lt;/td&amp;gt;  
                          &amp;lt;/tr&amp;gt;  
                     {% endfor %}  
                {% endfor %}  
           &amp;lt;/table&amp;gt;  
      &amp;lt;/body&amp;gt;  
 &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;




&lt;br&gt;


&lt;p&gt;This is the working source code to display the contents of a dictionary from the results of a database query. The data is displayed on an HTML page. This is an example of source code that uses HTML and Python.&lt;/p&gt;

&lt;br&gt;

&lt;p&gt;&lt;b&gt;HTML : &lt;/b&gt;&lt;/p&gt;

&lt;br&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;!DOCTYPE html&amp;gt;  
 &amp;lt;html&amp;gt;  
      &amp;lt;head&amp;gt;  
      &amp;lt;/head&amp;gt;  
      &amp;lt;body&amp;gt;  
           {{ hasil1[0] }}  
      &amp;lt;/body&amp;gt;  
 &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;


&lt;p&gt;This is an example of an HTML source code that displays the entire contents of a dictionary.&lt;/p&gt;

&lt;br&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;!DOCTYPE html&amp;gt;  
 &amp;lt;html&amp;gt;  
      &amp;lt;head&amp;gt;  
      &amp;lt;/head&amp;gt;  
      &amp;lt;body&amp;gt;  
           {{ hasil1 }}  
      &amp;lt;/body&amp;gt;  
 &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;


&lt;p&gt;The following are variations of HTML source code that will display different data results.&lt;/p&gt;

&lt;br&gt;


&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;!DOCTYPE html&amp;gt;  
 &amp;lt;html&amp;gt;  
      &amp;lt;head&amp;gt;  
      &amp;lt;/head&amp;gt;  
      &amp;lt;body&amp;gt;  
           {% for hasil2 in hasil1 %}  
                {% for key, value in hasil2.items() %}  
                     {{ value }}  
                {% endfor %}  
           {% endfor %}  
      &amp;lt;/body&amp;gt;  
 &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;


&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;!DOCTYPE html&amp;gt;  
 &amp;lt;html&amp;gt;  
      &amp;lt;head&amp;gt;  
      &amp;lt;/head&amp;gt;  
      &amp;lt;body&amp;gt;  
           {% for hasil2 in hasil1 %}  
                {{ hasil2.keys() }}  
           {% endfor %}  
      &amp;lt;/body&amp;gt;  
 &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;


&lt;p&gt;This is the source code that successfully displays data in an HTML table correctly.&lt;/p&gt;


&lt;br&gt;


&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;!DOCTYPE HTML&amp;gt;  
 &amp;lt;HTML&amp;gt;  
      &amp;lt;HEAD&amp;gt;  
      &amp;lt;/HEAD&amp;gt;  
      &amp;lt;BODY&amp;gt;  
           &amp;lt;table&amp;gt;  
                &amp;lt;!----- Ini adalah source code untuk membuat header table -----&amp;gt;  
                     {% if hasil1 %}  
                     &amp;lt;tr&amp;gt;  
                          {% for key in hasil1[0] %}  
                               &amp;lt;th&amp;gt; {{ key }} &amp;lt;/th&amp;gt;  
                          {% endfor %}  
                     &amp;lt;/tr&amp;gt;  
                     {% endif %}  
                &amp;lt;!--- Ini adalah source code untuk membuat isi tabel --&amp;gt;  
                {% for isitabel in hasil1 %}  
                &amp;lt;tr&amp;gt;  
                     {% for value in isitabel.values() %}  
                          &amp;lt;td&amp;gt;{{ value }}&amp;lt;/td&amp;gt;  
                     {% endfor %}  
                &amp;lt;/tr&amp;gt;  
                {% endfor %}  
           &amp;lt;/table&amp;gt;  
      &amp;lt;/BODY&amp;gt;  
 &amp;lt;/HTML&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;


&lt;p&gt;This is a combination of querying the correct database and displaying the correct table (using CSS).&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Python Code : &lt;/b&gt;&lt;/p&gt;

&lt;br&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; from flask import Flask, render_template, request  
 from jinja2 import Template, Environment, FileSystemLoader  
 import mariadb  
 import sys  
 aplikasi = Flask(__name__)  
 @aplikasi.route(&#39;/&#39;)  
 def tabelData():  
   koneksi = mariadb.connect(user=&quot;steven&quot;,password=&quot;kucing&quot;,host=&quot;1.1.3.7&quot;,port=3306,database=&quot;saham&quot;)  
   kursor = koneksi.cursor(dictionary=True)  
   kursor.execute(&quot;SELECT idnama1,namaawal1,namaakhir1 FROM nama1&quot;)  
   hasil = kursor.fetchall()  
   return render_template(&quot;halaman11.html&quot;,hasil1=hasil)  
 if __name__ == &#39;__main__&#39;:  
   aplikasi.run(host=&quot;0.0.0.0&quot;, port=8543, debug=True)  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;


&lt;p&gt;&lt;b&gt;HTML Code : &lt;/b&gt;&lt;/p&gt;

&lt;br&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;!DOCTYPE html&amp;gt;  
 &amp;lt;html&amp;gt;  
 &amp;lt;head&amp;gt;  
      &amp;lt;style&amp;gt;  
           #dataNama {  
                font-family: Arial, Helvetica, sans-serif;  
                border-collapse: collapse;  
                width: 100%;  
           }  
           #dataNama td, #dataNama th {  
                border: 1px solid #ddd;  
                padding: 8px;  
           }  
           #dataNama tr:nth-child(even){background-color: #f2f2f2;}  
           #dataNama tr:hover {background-color: #dataNama}  
           #dataNama th{  
                padding-top: 12px;  
                padding-bottom: 12px;  
                text-align: left;  
                background-color: #04AA6D;  
                color: white;  
           }  
      &amp;lt;/style&amp;gt;  
 &amp;lt;/head&amp;gt;  
 &amp;lt;body&amp;gt;  
      &amp;lt;table id=&quot;dataNama&quot;&amp;gt;  
           &amp;lt;!------- Ini adalah source code untuk membuat header table --------&amp;gt;  
                {% if hasil1 %}  
                &amp;lt;tr&amp;gt;  
                     {% for key in hasil1[0] %}  
                          &amp;lt;th&amp;gt; {{ key }} &amp;lt;/th&amp;gt;  
                     {% endfor %}  
                &amp;lt;/tr&amp;gt;  
                {% endif %}  
                &amp;lt;!--- ini adalah source code untuk membuat isi tabel --&amp;gt;  
                {% for isitabel in hasil1 %}  
                &amp;lt;tr&amp;gt;  
                     {% for value in isitabel.values() %}  
                          &amp;lt;td&amp;gt;{{ value }}&amp;lt;/td&amp;gt;  
                     {% endfor %}  
                &amp;lt;/tr&amp;gt;  
                {% endfor %}  
      &amp;lt;/table&amp;gt;  
 &amp;lt;/body&amp;gt;  
 &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;













</content><link rel='replies' type='application/atom+xml' href='https://www.stevennathaniel.web.id/feeds/8518679993197801989/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.stevennathaniel.web.id/2024/02/python-exercises-on-using-dictionaries.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/8518679993197801989'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/8518679993197801989'/><link rel='alternate' type='text/html' href='https://www.stevennathaniel.web.id/2024/02/python-exercises-on-using-dictionaries.html' title='Python : Exercises on Using Dictionaries in Python'/><author><name>IT Writer</name><uri>http://www.blogger.com/profile/10445657762034183360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYuEOxtCuH6VmQBKT02CLKSsXzdABdhMAfrZB5ReJVOI_IAuaOINU7EH6XZsvUDgVjVFJuCiRhUtatKXUZ-8b-rAMMsnzp5yZnBEth0o2s8tYmlWmi5BjjQa-Wu-PQNf9jkEVTcJwfL7caD52xwXALYdIa2t6Gx0F8sL7IS1XVcro_A8Y/s220/Foto2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-156945889618361525.post-6959682182724842930</id><published>2024-02-19T10:22:00.012+08:00</published><updated>2024-02-20T15:52:04.025+08:00</updated><title type='text'>Python: Source Code That Successfully Displays Data in a Table</title><content type='html'>&lt;h1&gt;This is the basic source code that can display data from a MariaDB table.&lt;/h1&gt;

&lt;p&gt;This is the source code that has successfully displayed data into an HTML table.&lt;/p&gt;

&lt;p&gt;This is source for python : &lt;/p&gt;


&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; from flask import Flask, render_template, request  
 from jinja2 import Template, Environment, FileSystemLoader  
 import mariadb  
 import sys  
 aplikasi = Flask(__name__)  
 @aplikasi.route(&#39;/&#39;)  
 def tabelData1():  
   return render_template(&quot;halaman2.html&quot;,)  
 @aplikasi.route(&#39;/tampilData&#39;,methods=[&#39;POST&#39;])  
 def tampilkanData():  
   if request.method==&#39;POST&#39;:  
     if request.form[&#39;tombolPerintah&#39;] == &#39;Tampilkan Data&#39;:  
       koneksi = mariadb.connect(user=&quot;steven&quot;,password=&quot;kucing&quot;,host=&quot;1.1.3.13&quot;,port=3306,database=&quot;saham&quot;)  
       kursor = koneksi.cursor(dictionary=True)  
       kursor.execute(&quot;SELECT idnama1,namaawal1,namaakhir1 FROM nama1&quot;)  
       hasil = kursor.fetchall()  
       # print(hasil)  
       # Tampilkan isi Baris pertama dari tabel  
       idnama1 = hasil[0][&quot;idnama1&quot;]  
       namaawal1 = hasil[0][&quot;namaawal1&quot;]  
       namaakhir1 = hasil[0][&quot;namaakhir1&quot;]  
       # Tampilkan isi Baris kedua dari tabel  
       idnama2 = hasil[1][&quot;idnama1&quot;]  
       namaawal2 = hasil[1][&quot;namaawal1&quot;]  
       namaakhir2 = hasil[1][&quot;namaakhir1&quot;]  
       return render_template(&quot;halaman2.html&quot;, IdNama1 = idnama1, NamaAwal1 = namaawal1, NamaAkhir1 = namaakhir1, IdNama2 = idnama2, NamaAwal2 = namaawal2, NamaAkhir2 = namaakhir2)  
       koneksi.commit()  
       koneksi.close()  
 if __name__ == &#39;__main__&#39;:  
   aplikasi.run(host=&#39;0.0.0.0&#39;,port=8543,debug=True)  
&lt;/code&gt;&lt;/pre&gt;

&lt;br&gt;


&lt;p&gt;This is source code for HTML page : &lt;/p&gt;


&lt;br&gt;


&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;!DOCTYPE html&amp;gt;  
 &amp;lt;html&amp;gt;  
      &amp;lt;head&amp;gt;  
      &amp;lt;/head&amp;gt;  
      &amp;lt;body&amp;gt;  
           &amp;lt;h3&amp;gt;Tabel Menampilkan Data&amp;lt;/h3&amp;gt;  
                &amp;lt;form action=&quot;http://1.1.3.13:8543/tampilData&quot; method=&quot;POST&quot; id=&quot;formMenampilkanData&quot; name=&quot;formMenampilkanData&quot;&amp;gt;  
                          &amp;lt;table&amp;gt;  
                               &amp;lt;thead&amp;gt;  
                                    &amp;lt;tr&amp;gt;  
                                         &amp;lt;th&amp;gt;ID Nama&amp;lt;/th&amp;gt;  
                                         &amp;lt;th&amp;gt;Nama Awal&amp;lt;/th&amp;gt;  
                                         &amp;lt;th&amp;gt;Nama Akhir&amp;lt;/th&amp;gt;  
                                    &amp;lt;/tr&amp;gt;  
                               &amp;lt;/thead&amp;gt;  
                               &amp;lt;tbody&amp;gt;  
                                         &amp;lt;tr&amp;gt;  
                                              &amp;lt;td&amp;gt;{{ IdNama1}}&amp;lt;/td&amp;gt;  
                                              &amp;lt;td&amp;gt;{{ NamaAwal1 }}&amp;lt;/td&amp;gt;  
                                              &amp;lt;td&amp;gt;{{ NamaAkhir1 }}&amp;lt;/td&amp;gt;  
                                         &amp;lt;/tr&amp;gt;  
                                         &amp;lt;tr&amp;gt;  
                                              &amp;lt;td&amp;gt;{{ IdNama2 }}&amp;lt;/td&amp;gt;  
                                              &amp;lt;td&amp;gt;{{ NamaAwal2 }}&amp;lt;/td&amp;gt;  
                                              &amp;lt;td&amp;gt;{{ NamaAkhir2 }}&amp;lt;/td&amp;gt;  
                                         &amp;lt;/tr&amp;gt;  
                               &amp;lt;/tbody&amp;gt;  
                          &amp;lt;/table&amp;gt;  
                          &amp;lt;input type=&quot;submit&quot; name=&quot;tombolPerintah&quot; value=&quot;Tampilkan Data&quot;&amp;gt;  
                &amp;lt;/form&amp;gt;  
      &amp;lt;/body&amp;gt;  
 &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;

&lt;a href=&quot;https://pythonexamples.org/python-flask-for-loop-in-html-template/&quot;&gt;This is a link that contains an example of how to create a loop, in an effort to display data in a table. &lt;/a&gt;


&lt;p&gt;Next, we will try to be able to create a table using this looping function.&lt;/p&gt;

&lt;p&gt;This source code successfully displays data based on the looping results, but the data is still in the form of a list, not data that can be separated by rows and columns.&lt;/p&gt;

&lt;p&gt;We will use the Dictionary concept to collect data from Mariadb. The data is the result of a query process from Mariadb. The Dictionary will be tried to be used to build a table on an HTML page.&lt;/p&gt;

&lt;a href=&quot;https://blog.miguelgrinberg.com/post/beautiful-interactive-tables-for-your-flask-templates&quot;&gt;This is an example of a link that can help you display data in an HTML table.&lt;/a&gt;

&lt;br&gt;


&lt;a href=&quot;https://www.freecodecamp.org/news/create-a-dictionary-in-python-python-dict-methods/&quot;&gt;This link is suitable for learning in depth about dictionaries.&lt;/a&gt;

</content><link rel='replies' type='application/atom+xml' href='https://www.stevennathaniel.web.id/feeds/6959682182724842930/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.stevennathaniel.web.id/2024/02/python-source-code-that-successfully.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/6959682182724842930'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/6959682182724842930'/><link rel='alternate' type='text/html' href='https://www.stevennathaniel.web.id/2024/02/python-source-code-that-successfully.html' title='Python: Source Code That Successfully Displays Data in a Table'/><author><name>IT Writer</name><uri>http://www.blogger.com/profile/10445657762034183360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYuEOxtCuH6VmQBKT02CLKSsXzdABdhMAfrZB5ReJVOI_IAuaOINU7EH6XZsvUDgVjVFJuCiRhUtatKXUZ-8b-rAMMsnzp5yZnBEth0o2s8tYmlWmi5BjjQa-Wu-PQNf9jkEVTcJwfL7caD52xwXALYdIa2t6Gx0F8sL7IS1XVcro_A8Y/s220/Foto2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-156945889618361525.post-2361298751961951701</id><published>2024-02-13T16:32:00.004+08:00</published><updated>2024-02-13T16:34:37.928+08:00</updated><title type='text'>Wifi Sharing : How to Share a WiFi Connection Using a Cheap USB Dongle Like Tenda and Totolink</title><content type='html'>&lt;p&gt;Here are the steps on how to share internet from a laptop or PC using a USB WiFi Dongle. This will allow other devices to connect to the internet as well.&lt;/p&gt;

&lt;br&gt;

netsh wlan set hostednetwork mode=allow ssid=nasipecel key=makan1234 keyusage=temporary

&lt;br&gt;

netsh wlan start hostednetwork


&lt;br&gt;


netsh wlan show hostednetwork


&lt;br&gt;


netsh wlan set hostednetwork mode=disallow


&lt;br&gt;

netsh wlan stop hostednetwork


&lt;br&gt;


netsh wlan show settings


&lt;br&gt;


netsh wlan show profiles



&lt;br&gt;


netsh wlan delete profile name=&quot;swisscom&quot;


&lt;br&gt;



netsh wlan delete profile name=* i=*


&lt;br&gt;


netsh wlan show drivers


&lt;br&gt;

https://stackoverflow.com/questions/18182084/cant-start-hostednetwork

&lt;br&gt;

https://support.airserver.com/support/solutions/articles/43000532725-how-can-i-enable-the-wireless-autoconfig-service-the-wireless-autoconfig-service-wlansvc-is-not-


&lt;br&gt;

https://youtu.be/2pvK-6321ig?si=tKonB-Tn-LIvcTTX</content><link rel='replies' type='application/atom+xml' href='https://www.stevennathaniel.web.id/feeds/2361298751961951701/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.stevennathaniel.web.id/2024/02/wifi-sharing-how-to-share-wifi.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/2361298751961951701'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/2361298751961951701'/><link rel='alternate' type='text/html' href='https://www.stevennathaniel.web.id/2024/02/wifi-sharing-how-to-share-wifi.html' title='Wifi Sharing : How to Share a WiFi Connection Using a Cheap USB Dongle Like Tenda and Totolink'/><author><name>IT Writer</name><uri>http://www.blogger.com/profile/10445657762034183360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYuEOxtCuH6VmQBKT02CLKSsXzdABdhMAfrZB5ReJVOI_IAuaOINU7EH6XZsvUDgVjVFJuCiRhUtatKXUZ-8b-rAMMsnzp5yZnBEth0o2s8tYmlWmi5BjjQa-Wu-PQNf9jkEVTcJwfL7caD52xwXALYdIa2t6Gx0F8sL7IS1XVcro_A8Y/s220/Foto2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-156945889618361525.post-7425983293124300948</id><published>2024-02-13T12:01:00.003+08:00</published><updated>2024-02-13T12:09:06.020+08:00</updated><title type='text'>Python Flask : Getting Ready to Make a Table</title><content type='html'>&lt;p&gt;The source code below is to start finding ways to create a table on a web page. The data for the table is taken from a MariaDB database query.&lt;/p&gt;

&lt;br&gt;


&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; from jinja2 import Template, Environment, FileSystemLoader  
 from flask import Flask, render_template, request, json, jsonify  
 import mariadb  
 import sys  
 aplikasi = Flask(__name__)  
 @aplikasi.route(&#39;/&#39;)  
 def formUtama():  
   return render_template(&quot;halaman1.html&quot;)  
 @aplikasi.route(&#39;/tampilData&#39;,methods=[&#39;POST&#39;])  
 def tampilkanData():  
   if request.method==&#39;POST&#39;:  
     koneksi = mariadb.connect(user=&quot;steven&quot;,password=&quot;kucing&quot;,host=&quot;1.1.3.9&quot;,port=3306,database=&quot;saham&quot;)  
     kursor= koneksi.cursor(dictionary=True)  
     kursor.execute(&quot;SELECT kodedata,tanggalpendataan,kodebarang,NIP,namabarang,kodebagian,namadivisi,merekprinter,serialprinter,macaddress,jenistinta,namapengguna FROM daftartintaprinter2&quot;)  
     hasil = kursor.fetchall()  
     # di bawah ini untuk menampilkan baris data yang urutan 1  
     kodedata1 = hasil[0][&quot;kodedata&quot;]  
     tanggalpendataan1 = hasil[0][&quot;tanggalpendataan&quot;]  
     kodebarang1 = hasil[0][&quot;kodebarang&quot;]  
     nip1 = hasil[0][&quot;NIP&quot;]  
     namabarang1 = hasil[0][&quot;namabarang&quot;]  
     kodebagian1 = hasil[0][&quot;kodebagian&quot;]  
     namadivisi1 = hasil[0][&quot;namadivisi&quot;]  
     merekprinter1 = hasil[0][&quot;merekprinter&quot;]  
     serialprinter1 = hasil[0][&quot;serialprinter&quot;]  
     macaddress1 = hasil[0][&quot;macaddress&quot;]  
     jenistinta1 = hasil[0][&quot;jenistinta&quot;]  
     namapengguna1 = hasil[0][&quot;namapengguna&quot;]  
     # di bawah ini untuk menampilkan baris data yang urutan 2  
     kodedata2 = hasil[1][&quot;kodedata&quot;]  
     tanggalpendataan2 = hasil[1][&quot;tanggalpendataan&quot;]  
     kodebarang2 = hasil[1][&quot;kodebarang&quot;]  
     nip2 = hasil[1][&quot;NIP&quot;]  
     namabarang2 = hasil[1][&quot;namabarang&quot;]  
     kodebagian2 = hasil[1][&quot;kodebagian&quot;]  
     namadivisi2 = hasil[1][&quot;namadivisi&quot;]  
     merekprinter2 = hasil[1][&quot;merekprinter&quot;]  
     serialprinter2 = hasil[1][&quot;serialprinter&quot;]  
     macaddress2 = hasil[1][&quot;macaddress&quot;]  
     jenistinta2 = hasil[1][&quot;jenistinta&quot;]  
     namapengguna2 = hasil[1][&quot;namapengguna&quot;]  
     koneksi.commit()  
     koneksi.close()  
     return render_template(&quot;halaman3.html&quot;, kodeData1 = kodedata1, tanggalPendataan1 = tanggalpendataan1, kodeBarang1 = kodebarang1, NIP1 = nip1, namaBarang1 = namabarang1, kodeBagian1 = kodebagian1, namaDivisi1 = namadivisi1, merekPrinter1 = merekprinter1, serialPrinter1 = serialprinter1, macAddress1 = macaddress1, jenisTinta1 = jenistinta1, namaPengguna1 = namapengguna1, kodeData2 = kodedata2, tanggalPendataan2 = tanggalpendataan2, kodeBarang2 = kodebarang2, NIP2 = nip2, namaBarang2 = namabarang2, kodeBagian2 = kodebagian2, namaDivisi2 = namadivisi2, merekPrinter2 = merekprinter2, serialPrinter2 = serialprinter2, macAddress2 = macaddress2, jenisTinta2 = jenistinta2, namaPengguna2 = namapengguna2 )  
 if __name__ == &#39;__main__&#39;:  
   aplikasi.run(host=&#39;0.0.0.0&#39;,port=8543,debug=True)  
&lt;/code&gt;&lt;/pre&gt;



&lt;br&gt;


&lt;p&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.stevennathaniel.web.id/feeds/7425983293124300948/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.stevennathaniel.web.id/2024/02/python-flask-getting-ready-to-make-table.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/7425983293124300948'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/7425983293124300948'/><link rel='alternate' type='text/html' href='https://www.stevennathaniel.web.id/2024/02/python-flask-getting-ready-to-make-table.html' title='Python Flask : Getting Ready to Make a Table'/><author><name>IT Writer</name><uri>http://www.blogger.com/profile/10445657762034183360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYuEOxtCuH6VmQBKT02CLKSsXzdABdhMAfrZB5ReJVOI_IAuaOINU7EH6XZsvUDgVjVFJuCiRhUtatKXUZ-8b-rAMMsnzp5yZnBEth0o2s8tYmlWmi5BjjQa-Wu-PQNf9jkEVTcJwfL7caD52xwXALYdIa2t6Gx0F8sL7IS1XVcro_A8Y/s220/Foto2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-156945889618361525.post-3235075004758311789</id><published>2024-02-07T09:56:00.007+08:00</published><updated>2024-02-07T10:01:31.475+08:00</updated><title type='text'>Getting Started with PHP Programming</title><content type='html'>&lt;h1&gt;Getting Started with PHP Programming&lt;/h1&gt;

&lt;p&gt;Resuming Our PHP Learning Journey in Laravel. Below is a simple source code example to get you started with learning PHP programming again.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.stevennathaniel.web.id/feeds/3235075004758311789/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.stevennathaniel.web.id/2024/02/getting-started-with-php-programming.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/3235075004758311789'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/3235075004758311789'/><link rel='alternate' type='text/html' href='https://www.stevennathaniel.web.id/2024/02/getting-started-with-php-programming.html' title='Getting Started with PHP Programming'/><author><name>IT Writer</name><uri>http://www.blogger.com/profile/10445657762034183360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYuEOxtCuH6VmQBKT02CLKSsXzdABdhMAfrZB5ReJVOI_IAuaOINU7EH6XZsvUDgVjVFJuCiRhUtatKXUZ-8b-rAMMsnzp5yZnBEth0o2s8tYmlWmi5BjjQa-Wu-PQNf9jkEVTcJwfL7caD52xwXALYdIa2t6Gx0F8sL7IS1XVcro_A8Y/s220/Foto2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-156945889618361525.post-1635610036157390537</id><published>2024-01-30T11:51:00.010+08:00</published><updated>2024-01-31T16:23:56.292+08:00</updated><title type='text'>Flask: Printing Database Query Results to an HTML Table</title><content type='html'>&lt;p&gt;In this example, I am trying to query a &lt;b&gt;MariaDB&lt;/b&gt; database. Then I am trying to display the results on a web page. However, for the first step, I will try to display the query results to the terminal. The following is the source code for printing database query results to the terminal: &lt;/p&gt;

&lt;br&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; import mariadb  
 import sys  
 koneksi = mariadb.connect(user=&quot;steven&quot;,password=&quot;kucing&quot;,host=&quot;1.1.3.6&quot;,port=3306,database=&quot;saham&quot;)  
 kursor = koneksi.cursor(dictionary=True)  
 kursor.execute(&quot;SELECT idnama1,namaawal1,namaakhir1 FROM nama1&quot;)  
 hasil = kursor.fetchall()  
 print(hasil[0])  
&lt;/code&gt;&lt;/pre&gt;

&lt;br&gt;


&lt;p&gt;The following source code successfully prints the query results from the MariaDB database to the terminal.&lt;/p&gt;



&lt;br&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; import mariadb  
 import sys  
 koneksi = mariadb.connect(user=&quot;steven&quot;,password=&quot;kucing&quot;,host=&quot;1.1.3.7&quot;,port=3306,database=&quot;saham&quot;)  
 kursor = koneksi.cursor(dictionary=True)  
 kursor.execute(&quot;SELECT idnama1,namaawal1,namaakhir1 FROM nama1&quot;)  
 hasil = kursor.fetchall()  
 print(hasil[1])  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;



&lt;br&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; import mariadb  
 import sys  
 koneksi = mariadb.connect(user=&quot;steven&quot;,password=&quot;kucing&quot;,host=&quot;1.1.3.7&quot;,port=3306,database=&quot;saham&quot;)  
 kursor = koneksi.cursor(dictionary=True)  
 kursor.execute(&quot;SELECT idnama1,namaawal1,namaakhir1 FROM nama1&quot;)  
 hasil = kursor.fetchall()  
 idnama1A = hasil[0][&quot;idnama1&quot;]  
 print(idnama1A)  
&lt;/code&gt;&lt;/pre&gt;

&lt;br&gt;


&lt;p&gt;The following is the source code for rendering an HTML page using Flask.&lt;/p&gt;


&lt;br&gt;









&lt;br&gt;




</content><link rel='replies' type='application/atom+xml' href='https://www.stevennathaniel.web.id/feeds/1635610036157390537/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.stevennathaniel.web.id/2024/01/flask-printing-database-query-results.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/1635610036157390537'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/1635610036157390537'/><link rel='alternate' type='text/html' href='https://www.stevennathaniel.web.id/2024/01/flask-printing-database-query-results.html' title='Flask: Printing Database Query Results to an HTML Table'/><author><name>IT Writer</name><uri>http://www.blogger.com/profile/10445657762034183360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYuEOxtCuH6VmQBKT02CLKSsXzdABdhMAfrZB5ReJVOI_IAuaOINU7EH6XZsvUDgVjVFJuCiRhUtatKXUZ-8b-rAMMsnzp5yZnBEth0o2s8tYmlWmi5BjjQa-Wu-PQNf9jkEVTcJwfL7caD52xwXALYdIa2t6Gx0F8sL7IS1XVcro_A8Y/s220/Foto2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-156945889618361525.post-8038361892214953467</id><published>2024-01-11T10:53:00.004+08:00</published><updated>2024-01-11T14:30:39.920+08:00</updated><title type='text'>Python 3 : The Class</title><content type='html'>&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; class kelas1:  
   def __init__(self, nama, usia):  
     self.nama = nama  
     self.usia = usia  
   def __str__(self):  
     return &quot;Tampilkan nama : %s , usia : %s&quot; % (self.nama, self.usia)  
 isian = kelas1(&quot;Steven&quot;, 17)  
 print(isian)  
&lt;/code&gt;&lt;/pre&gt;


&lt;h1&gt;This is the Initial Source Code for Learning About Classes in Python Programming.&lt;/h1&gt;


&lt;p&gt;Understanding classes in Python programming will be useful for understanding how to create tables using &lt;b&gt;Flask Table&lt;/b&gt;.&lt;/p&gt;
&lt;p&gt;A class is a group of functions.&lt;/p&gt;
&lt;p&gt;We want to learn how to inherit in classes in Python programming. We can only inherit within the same class, which is inheritance between functions.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='https://www.stevennathaniel.web.id/feeds/8038361892214953467/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.stevennathaniel.web.id/2024/01/python-3-class.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/8038361892214953467'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/8038361892214953467'/><link rel='alternate' type='text/html' href='https://www.stevennathaniel.web.id/2024/01/python-3-class.html' title='Python 3 : The Class'/><author><name>IT Writer</name><uri>http://www.blogger.com/profile/10445657762034183360</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='27' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYuEOxtCuH6VmQBKT02CLKSsXzdABdhMAfrZB5ReJVOI_IAuaOINU7EH6XZsvUDgVjVFJuCiRhUtatKXUZ-8b-rAMMsnzp5yZnBEth0o2s8tYmlWmi5BjjQa-Wu-PQNf9jkEVTcJwfL7caD52xwXALYdIa2t6Gx0F8sL7IS1XVcro_A8Y/s220/Foto2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-156945889618361525.post-8017186554337112906</id><published>2023-11-12T10:52:00.085+08:00</published><updated>2023-11-27T09:22:36.919+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Bigo"/><category scheme="http://www.blogger.com/atom/ns#" term="Docker"/><category scheme="http://www.blogger.com/atom/ns#" term="English"/><category scheme="http://www.blogger.com/atom/ns#" term="SnackVideo"/><title type='text'>This Blog will be Written in a Language Other Than Indonesian</title><content type='html'>&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;iframe allowfullscreen=&quot;&quot; class=&quot;BLOG_video_class&quot; height=&quot;266&quot; src=&quot;https://www.youtube.com/embed/H_Fnd4aInHI&quot; width=&quot;320&quot; youtube-src-id=&quot;H_Fnd4aInHI&quot;&gt;&lt;/iframe&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;There will be a change in the language used on this blog, from Indonesian to a language other than Indonesian.&amp;nbsp;&lt;span style=&quot;background-color: white; color: #1f1f1f; white-space-collapse: preserve;&quot;&gt;In this blog, I will write about various things. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: white; color: #1f1f1f; white-space-collapse: preserve;&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;I have successfully compressed the size of a .jpeg photo file using the following software:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: white; white-space-collapse: preserve;&quot;&gt;&lt;span style=&quot;color: #1f1f1f; font-family: arial;&quot;&gt;&lt;a href=&quot;https://saerasoft.com/caesium/&quot;&gt;https://saerasoft.com/caesium/&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;span style=&quot;background-color: white; color: #1f1f1f; white-space-collapse: preserve;&quot;&gt;And in one article, I will try to achieve a target of 800 words or more. &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #1f1f1f; white-space-collapse: preserve;&quot;&gt;What I have learned in the past two days is about the applications &lt;b&gt;Snackvideo&lt;/b&gt; and &lt;b&gt;Bigo Live&lt;/b&gt;. &lt;/span&gt;&lt;span style=&quot;color: #1f1f1f;&quot;&gt;&lt;span style=&quot;white-space-collapse: preserve;&quot;&gt;The applications SnackVideo and Bigo seem to be more lenient than TikTok in terms of regulations. As a result, there are not many violations in both of these applications. &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #1f1f1f;&quot;&gt;&lt;span style=&quot;white-space-collapse: preserve;&quot;&gt;Some users who perform live streaming on Bigo have moved their live streaming activities to the &lt;b&gt;Line&lt;/b&gt; application. Perhaps this is because the rules on the Line application are more lenient than on Bigo. This is a rule related to the issue of nudity. &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #1f1f1f; white-space-collapse: preserve;&quot;&gt;In the Bigo app, in some live rooms, there are live room administrators who will remove viewers who only watch without giving any gifts to the host of the live room.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;span&gt;&lt;span style=&quot;background-color: white; color: #1f1f1f; white-space-collapse: preserve;&quot;&gt;Today I have successfully changed the address of my blog to .&lt;span class=&quot;animating&quot;&gt;web.&lt;/span&gt;&lt;span class=&quot;animating&quot;&gt;id.&lt;/span&gt;&lt;span class=&quot;animating&quot;&gt; I have also successfully connected it to &lt;b&gt;AdSense&lt;/b&gt;. I am always learning how to make the links from my blog to be on various websites. In the afternoon, I studied about writing programming code using the Python programming language. The &lt;b&gt;Python&lt;/b&gt; programming code was run in the &lt;b&gt;Docker &lt;/b&gt;application. I have also successfully set up &lt;b&gt;Google Analytics&lt;/b&gt; on this blog. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #1f1f1f; white-space-collapse: preserve;&quot;&gt;I have already submitted this blog to &lt;b&gt;Bing Webmaster&lt;/b&gt; and &lt;b&gt;Yandex Webmaster&lt;/b&gt;, so this blog is also indexed in both of those search engines.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;iframe allowfullscreen=&quot;&quot; class=&quot;BLOG_video_class&quot; height=&quot;266&quot; src=&quot;https://www.youtube.com/embed/5AaxcwVGKjY&quot; width=&quot;320&quot; youtube-src-id=&quot;5AaxcwVGKjY&quot;&gt;&lt;/iframe&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;

&lt;h3&gt;&lt;span style=&quot;font-family: arial; font-size: small;&quot;&gt;Building Docker Image&lt;/span&gt;&lt;/h3&gt;

&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Here is the command to build a Docker image. Type the following command in the terminal of the host computer that has Docker : &lt;/span&gt;&lt;/p&gt;


&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;!--HTML generated using hilite.me--&gt;&lt;/span&gt;&lt;div style=&quot;background: rgb(255, 255, 255); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;&lt;pre style=&quot;line-height: 125%; margin: 0px;&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;sudo docker image build &lt;span style=&quot;color: #333333;&quot;&gt;-&lt;/span&gt;t python&lt;span style=&quot;color: #333333;&quot;&gt;-&lt;/span&gt;flask2 &lt;span style=&quot;color: #333333;&quot;&gt;/&lt;/span&gt;home&lt;span style=&quot;color: #333333;&quot;&gt;/&lt;/span&gt;steven&lt;span style=&quot;color: #333333;&quot;&gt;/&lt;/span&gt;proyekPython&lt;span style=&quot;color: #333333;&quot;&gt;/&lt;/span&gt;latihan1
&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Here is the command to find out who the user is in the specified Docker image: &lt;/span&gt;&lt;/p&gt;

&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;!--HTML generated using hilite.me--&gt;&lt;/span&gt;&lt;div style=&quot;background: rgb(255, 255, 255); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;&lt;pre style=&quot;line-height: 125%; margin: 0px;&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;sudo docker run &lt;span style=&quot;color: #333333;&quot;&gt;--&lt;/span&gt;entrypoint &lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&quot;&lt;/span&gt; python&lt;span style=&quot;color: #333333;&quot;&gt;-&lt;/span&gt;mariadb1  whoami
&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The following command will remove a Docker image that has already been built : &lt;/span&gt;&lt;/p&gt;

&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;!--HTML generated using hilite.me--&gt;&lt;/span&gt;&lt;div style=&quot;background: rgb(255, 255, 255); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;&lt;pre style=&quot;line-height: 125%; margin: 0px;&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;sudo docker image rm &lt;span style=&quot;color: #333333;&quot;&gt;&amp;lt;&lt;/span&gt;nama&lt;span style=&quot;color: #333333;&quot;&gt;-&lt;/span&gt;repository&lt;span style=&quot;color: #333333;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The following command will list all containers that have been created : &lt;/span&gt;&lt;/p&gt;

&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;!--HTML generated using hilite.me--&gt;&lt;/span&gt;&lt;div style=&quot;background: rgb(255, 255, 255); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;&lt;pre style=&quot;line-height: 125%; margin: 0px;&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;sudo docker ps &lt;span style=&quot;color: #333333;&quot;&gt;-&lt;/span&gt;a
&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Instructions for deleting a container : &lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt; sudo docker container rm (ID Container)&lt;/span&gt;&lt;/p&gt;


&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Example : &lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt; sudo docker container rm 9c9b1210e0c0&lt;/span&gt;&lt;/p&gt;


&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;


&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Instructions for running a Docker image on a &lt;b&gt;Lokinet&lt;/b&gt; network : &lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;sudo docker run -p 0.0.0.0:8543:8543 python-flask1&lt;/span&gt;&lt;/p&gt;

&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;

&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;command to stop a running container : &lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;sudo docker container stop (ID Container) &lt;/span&gt;&lt;/p&gt;
  
&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Example :&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;


&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;sudo docker container stop b4d3e8d5fe4a&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: white; color: #1f1f1f; white-space-collapse: preserve;&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Instructions to run a docker image on multiple ports simultaneously:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;sudo docker run -p 0.0.0.0:3306:3306 -p 0.0.0.0:8543:8543 -t python-mariadb1&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Here is the source code for a web project using the Python programming language in Docker, which also includes the help of the Jinja2 library, Blueprint :&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;span style=&quot;background-color: white; color: #1f1f1f; white-space-collapse: preserve;&quot;&gt;At the beginning, I will write the programming code for the Docker file, this programming code can also give commands to Docker to create a templates folder.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;span style=&quot;background-color: white; color: #1f1f1f; white-space-collapse: preserve;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;br&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; FROM python  
 USER 0  
 WORKDIR /home  
 # RUN cd /home  
 RUN mkdir ./templates  
 EXPOSE 3306 8543  
 RUN pip install flask  
 RUN pip install Jinja2  
 RUN pip install mariadb  
 COPY file4.py ./  
 COPY file1.html ./templates  
 CMD [&quot;python3&quot;, &quot;./file4.py&quot;]  
&lt;/code&gt;&lt;/pre&gt;

&lt;br&gt;

&lt;p&gt;Here is the source code for the HTML template that becomes the user interface of our program : &lt;/p&gt;
&lt;br&gt;
&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;!DOCTYPE html&amp;gt;  
 &amp;lt;html lang=&quot;en&quot;&amp;gt;   
   &amp;lt;head&amp;gt;  
     &amp;lt;meta charset=&quot;utf-8&quot;&amp;gt;  
     &amp;lt;title&amp;gt;{{title}}&amp;lt;/title&amp;gt;  
   &amp;lt;/head&amp;gt;  
   &amp;lt;body&amp;gt;  
     &amp;lt;h1&amp;gt;Selamat Datang Di {{kota}}&amp;lt;/h1&amp;gt;  
   &amp;lt;/body&amp;gt;  
 &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;br&gt;

&lt;p&gt;Here is the Python source code for running a program that can display text on a web page. With the help of Jinja templates and routing from blueprints.&lt;/p&gt;

&lt;br&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; from jinja2 import Environment, FileSystemLoader  
 from flask import Flask, render_template  
 aplikasi = Flask(__name__)  
 @aplikasi.route(&#39;/&#39;)  
 def halamanPertama():  
   return render_template(&quot;file1.html&quot;,title=&quot;New Found Land&quot;,kota=&quot;Land&quot;)  
 if __name__ == &#39;__main__&#39;:  
   aplikasi.run(host=&#39;0.0.0.0&#39;,port=&#39;8543&#39;,debug=&#39;True&#39;)  
&lt;/code&gt;&lt;/pre&gt;

&lt;br&gt;

&lt;h2&gt;Latihan 2&lt;/h2&gt;

&lt;p&gt;The following source code is the Docker file for Exercise 2 : &lt;/p&gt;

&lt;br&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; FROM python  
 USER 0  
 WORKDIR /home  
 RUN mkdir ./latihan2  
 RUN mkdir ./latihan2/templates  
 EXPOSE 3306 8543  
 RUN pip install flask  
 RUN pip install Jinja2  
 RUN pip install mariadb  
 COPY file1.py ./latihan2  
 COPY file1.html ./latihan2/templates  
 CMD [&quot;python3&quot;, &quot;./latihan2/file1.py&quot;]  
&lt;/code&gt;&lt;/pre&gt;

&lt;br&gt;


&lt;p&gt;The HTML file for the following application interface:&lt;/p&gt;

&lt;br&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;!DOCTYPE html&amp;gt;  
 &amp;lt;html&amp;gt;  
   &amp;lt;head&amp;gt;  
   &amp;lt;/head&amp;gt;  
   &amp;lt;body&amp;gt;  
     &amp;lt;p&amp;gt;Kode Data : {{kodedata}}&amp;lt;/p&amp;gt;  
     &amp;lt;p&amp;gt;Tanggal Pendataan : {{tanggalpendataan}}&amp;lt;/p&amp;gt;  
     &amp;lt;p&amp;gt;Bagian/Sub Bagian : {{bagiansubbagian}}&amp;lt;/p&amp;gt;  
     &amp;lt;p&amp;gt;Kode Barang : {{kodebarang}}&amp;lt;/p&amp;gt;  
     &amp;lt;p&amp;gt;Merek Printer : {{merekprinter}}&amp;lt;/p&amp;gt;  
   &amp;lt;/body&amp;gt;  
 &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;

&lt;p&gt;Here is the Python source code for creating the core application of the program we made&lt;/p&gt;

&lt;br&gt;


&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; import mariadb  
 import sys  
 import json  
 from jinja2 import Environment, FileSystemLoader  
 from flask import Flask, render_template  
 aplikasi = Flask(__name__)  
 try:  
   koneksi = mariadb.connect(user=&quot;steven&quot;,password=&quot;kucing&quot;,host=&quot;1.1.3.9&quot;,port=3306,database=&quot;saham&quot;)  
 except mariadb.Error as e:  
   print(f&quot;Gagal Terkoneksi Ke : {e}&quot;)  
   sys.exit(1)  
 kursor = koneksi.cursor()  
 kursor.execute(&quot;SELECT kodedata,tanggalpendataan,bagiansubbagian,kodebarang,merekprinter FROM daftartintaprinter&quot;)  
 hasil = kursor.fetchall()  
 for data in hasil:  
   kodedata = data[0]  
   tanggalpendataan = data[1].strftime(&quot;%Y-%m-%d&quot;)  
   bagiansubbagian = data[2]  
   kodebarang = data[3]  
   merekprinter = data[4]  
 f = lambda s: f&quot;dict({&#39;,&#39;.join(f&#39;{k}={k}&#39; for k in s.split(&#39;,&#39;))})&quot;  
 kamusHasil = eval(f(&#39;kodedata,tanggalpendataan,bagiansubbagian,kodebarang,merekprinter&#39;))  
 @aplikasi.route(&#39;/&#39;)  
 def halamanUtama():  
   return render_template(&quot;file1.html&quot;, **kamusHasil)  
 if __name__ == &#39;__main__&#39;:  
   aplikasi.run(host=&#39;0.0.0.0&#39;, port=8543, debug=True)  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;

&lt;br&gt;

&lt;p&gt; The following is a link to a lesson on how data transfer can happen in &lt;b&gt;Flask&lt;/b&gt; and &lt;b&gt;Jinja&lt;/b&gt; : &lt;/p&gt;

&lt;a href=&quot;https://pythonbasics.org/flask-template-data/&quot; target=&quot;_blank&quot;&gt;https://pythonbasics.org/flask-template-data/&lt;/a&gt;


&lt;br&gt;

&lt;br&gt;


&lt;h1&gt;Latihan 5&lt;/h1&gt;

&lt;p&gt;The following source code is the Docker file for Exercise 5 :&lt;/p&gt;


&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; FROM python  
 USER 0  
 WORKDIR /home  
 RUN mkdir ./latihan5  
 RUN mkdir ./latihan5/templates  
 EXPOSE 3306 8543  
 RUN pip install flask  
 RUN pip install Jinja2  
 RUN pip install mariadb  
 COPY file1.py ./latihan5  
 COPY murid1.html ./latihan5/templates  
 COPY hasil1.html ./latihan5/templates  
 CMD [&quot;python3&quot;, &quot;./latihan5/file1.py&quot;]  
&lt;/code&gt;&lt;/pre&gt;

&lt;br&gt;

&lt;p&gt;Here, we write the code to create a simple form, which later can be used for data transfer experiments using Flask and Jinja.&lt;/p&gt;

&lt;br&gt;

&lt;h2&gt;murid1.html&lt;/h2&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;!DOCTYPE html&amp;gt;  
 &amp;lt;html&amp;gt;  
   &amp;lt;head&amp;gt;  
   &amp;lt;/head&amp;gt;  
   &amp;lt;body&amp;gt;  
     &amp;lt;form action = &quot;http://1.1.3.2:8543/hasil&quot; method = &quot;POST&quot;&amp;gt;  
       &amp;lt;p&amp;gt;Nama : &amp;lt;input type=&quot;text&quot; name=&quot;Nama&quot;/&amp;gt;&amp;lt;/p&amp;gt;  
       &amp;lt;p&amp;gt;&amp;lt;input type = &quot;submit&quot; value = &quot;submit&quot;&amp;gt;&amp;lt;/p&amp;gt;  
     &amp;lt;/form&amp;gt;  
   &amp;lt;/body&amp;gt;  
 &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;br&gt;


&lt;p&gt;The following is the source code to receive data input from the &lt;b&gt;murid1.html&lt;/b&gt; page and then display the input results to the &lt;b&gt;hasil1.html&lt;/b&gt; page.&lt;/p&gt;

&lt;br&gt;

&lt;h2&gt;file1.py&lt;/h2&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; from flask import Flask, render_template, request  
 aplikasi = Flask(__name__)  
 @aplikasi.route(&#39;/&#39;)  
 def murid():  
   return render_template(&#39;murid1.html&#39;)  
 @aplikasi.route(&#39;/hasil&#39;,methods = [&#39;POST&#39;,&#39;GET&#39;])  
 def hasil():  
   if request.method == &#39;POST&#39;:  
     hasil = request.form  
     return render_template(&quot;hasil1.html&quot;,hasil = hasil)  
 if __name__ == &#39;__main__&#39;:  
   aplikasi.run(host=&#39;0.0.0.0&#39;, port=8543, debug=True)  
&lt;/code&gt;&lt;/pre&gt;

&lt;br&gt;

&lt;p&gt;The following is the source code to display the results of the data entry activity performed in the form on the murid1.html page.&lt;/p&gt;


&lt;br&gt;

&lt;h2&gt;hasil1.html&lt;/h2&gt;


&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;!DOCTYPE html&amp;gt;  
 &amp;lt;html&amp;gt;  
   &amp;lt;head&amp;gt;  
   &amp;lt;/head&amp;gt;  
   &amp;lt;body&amp;gt;  
     &amp;lt;table border=1&amp;gt;  
       {% for key, value in hasil.items() %}  
       &amp;lt;tr&amp;gt;  
         &amp;lt;th&amp;gt;{{ key }}&amp;lt;/th&amp;gt;  
         &amp;lt;td&amp;gt;{{ value }}&amp;lt;/td&amp;gt;  
       &amp;lt;/tr&amp;gt;  
       {% endfor %}  
     &amp;lt;/table&amp;gt;  
   &amp;lt;/body&amp;gt;  
 &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;br&gt;


&lt;p&gt;In the following source code, we have successfully displayed the results of the input data that was performed in the HTML form in JSON format. We will use the JSON data transfer format because we will be using a RESTful API.&lt;/p&gt;


&lt;h2&gt;Latihan 6&lt;/h2&gt;

&lt;h3&gt;Dockerfile&lt;/h3&gt;


&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; FROM python  
 USER 0  
 WORKDIR /home  
 RUN mkdir ./latihan6  
 RUN mkdir ./latihan6/templates  
 EXPOSE 3306 8543  
 RUN pip install flask  
 RUN pip install Jinja2  
 RUN pip install mariadb  
 COPY file1.py ./latihan6  
 COPY form1.html ./latihan6/templates  
 CMD [&quot;python3&quot;, &quot;./latihan6/file1.py&quot;]  
&lt;/code&gt;&lt;/pre&gt;

&lt;br&gt;

&lt;h3&gt;file1.py&lt;/h3&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; from flask import Flask, render_template, request, jsonify, json  
 aplikasi = Flask(__name__)  
 @aplikasi.route(&#39;/&#39;)  
 def formulirIsiData():  
   return render_template(&#39;form1.html&#39;)  
 @aplikasi.route(&#39;/tampilData&#39;,methods = [&#39;POST&#39;])  
 def tampilkanData():  
   if request.method == &#39;POST&#39;:  
     # tampilkanData = request.form  
     # nama = request.form[&#39;nama&#39;]  
     # return print (tampilkanData)  
     # di bawah ini adalah kode yang berhasil dijalankan  
     # mencetak langsung ke json yang bisa di baca oleh browser  
     # return jsonify(tampilkanData.to_dict())  
     return jsonify(nama=request.form[&#39;nama&#39;])  
 if __name__ == &#39;__main__&#39;:  
   aplikasi.run(host=&#39;0.0.0.0&#39;,port=8543, debug=True)  
&lt;/code&gt;&lt;/pre&gt;

&lt;br&gt;

&lt;h3&gt;file1.html&lt;/h3&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;!DOCTYPE html&amp;gt;  
 &amp;lt;html&amp;gt;  
   &amp;lt;head&amp;gt;  
   &amp;lt;/head&amp;gt;  
   &amp;lt;body&amp;gt;  
     &amp;lt;form action=&quot;http://1.1.3.3:8543/tampilData&quot; method=&quot;POST&quot;&amp;gt;  
       &amp;lt;p&amp;gt;Nama  : &amp;lt;input type=&quot;text&quot; name=&quot;nama&quot;/&amp;gt;&amp;lt;/p&amp;gt;  
       &amp;lt;p&amp;gt;Alamat : &amp;lt;input type=&quot;text&quot; name=&quot;alamat&quot;/&amp;gt;&amp;lt;/p&amp;gt;  
       &amp;lt;p&amp;gt;&amp;lt;input type=&quot;submit&quot; value=&quot;submit&quot;&amp;gt;&amp;lt;/p&amp;gt;  
     &amp;lt;/form&amp;gt;  
   &amp;lt;/body&amp;gt;  
 &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;


&lt;br&gt;

&lt;br&gt;


&lt;h2&gt;Latihan 9&lt;/h2&gt;

&lt;p&gt;In this exercise, we successfully input data using Flask. Then, we take each data that was filled in the textbox and display it to the jinja2 template. All processes are done by clicking a button.&lt;/p&gt;

&lt;br&gt;

&lt;h3&gt;file1.py&lt;/h3&gt;


&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; from jinja2 import Template  
 from flask import Flask,render_template,request,json,jsonify  
 aplikasi = Flask(__name__)  
 @aplikasi.route(&#39;/&#39;)  
 def formUtama():  
   return render_template(&quot;halaman1.html&quot;)  
 @aplikasi.route(&#39;/tampilData&#39;, methods = [&#39;POST&#39;])  
 def tampilkanData():  
     if request.method == &#39;POST&#39;:  
       text1 = request.form.get(&#39;text1&#39;)  
       text2 = request.form.get(&#39;text2&#39;)  
       return render_template(&quot;halaman2.html&quot;, tampilText1=text1, tampilText2=text2)  
 # source code nya ini sudah bagus untuk menerima inputan dari form  
 if __name__ == &#39;__main__&#39;:  
   aplikasi.run(host=&#39;0.0.0.0&#39;,port=8543,debug=True)  
&lt;/code&gt;&lt;/pre&gt;

&lt;br&gt;


&lt;h3&gt;halaman1.html&lt;/h3&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;!DOCTYPE html&amp;gt;  
 &amp;lt;html&amp;gt;  
   &amp;lt;head&amp;gt;  
     &amp;lt;style&amp;gt;  
       input[type=text], select{  
         width: 100%;  
         padding: 12px 20px;  
         margin: 8px 0;  
         display: inline-block;  
         border: 1 px solid #ccc;  
         border-radius: 4px;  
         box-sizing: border-box;  
       }  
       input[type=submit]{  
         width: 100%;  
         background-color: #4CAF50;  
         color: white;  
         padding: 14px 20px;  
         margin: 8px 0;  
         border: none;  
         border-radius: 4px;  
         cursor: pointer;  
       }  
       input[type=submit]:hover {  
         background-color: #45a049  
       }  
       div {  
         border-radius: 5px;  
         background-color: #f2f2f2;  
         padding: 20px;  
       }  
     &amp;lt;/style&amp;gt;  
   &amp;lt;/head&amp;gt;  
   &amp;lt;body&amp;gt;  
     &amp;lt;h3&amp;gt;Formulir Data Printer&amp;lt;/h3&amp;gt;  
     &amp;lt;div&amp;gt;  
       &amp;lt;form action=&quot;http://1.1.3.6:8543/tampilData&quot; method=&quot;POST&quot; id=&quot;formPrinter&quot; name=&quot;formPrinter&quot;&amp;gt;  
         &amp;lt;label for=&quot;text1&quot;&amp;gt;Text 1&amp;lt;/label&amp;gt;  
         &amp;lt;input type=&quot;text&quot; id=&quot;text1&quot; name=&quot;text1&quot; placeholder=&quot;Isikan kata 1&quot;&amp;gt;  
         &amp;lt;input type=&quot;text&quot; id=&quot;text2&quot; name=&quot;text2&quot; placeholder=&quot;Isikan kata 2&quot;&amp;gt;  
         &amp;lt;input type=&quot;submit&quot; Value=&quot;submit&quot;&amp;gt;  
       &amp;lt;/form&amp;gt;  
     &amp;lt;/div&amp;gt;  
   &amp;lt;/body&amp;gt;  
 &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;





&lt;br&gt;


&lt;h3&gt;halaman2.html&lt;/h3&gt;

&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSEzZUdbNWF3ncljp5Fp1BM6tahEN-3K3ELvPenGB-enLLUYNsshy76rwz7shLuPfcE3Amte7bMNTQ6nAplblaeKIldI1HUifamT-QWrSezz-9M_o10hpopOdaadzK9OZcO1SbCZdvQpp1/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &amp;lt;!DOCTYPE html&amp;gt;  
 &amp;lt;html&amp;gt;  
   &amp;lt;head&amp;gt;  
   &amp;lt;/head&amp;gt;  
   &amp;lt;body&amp;gt;  
     &amp;lt;p&amp;gt;{{ tampilText1 }}&amp;lt;/p&amp;gt;  
     &amp;lt;p&amp;gt;{{ tampilText2 }}&amp;lt;/p&amp;gt;  
     &amp;lt;!--- source code nya ini sudah bagus untuk menampilkan hasil inputan dari form  --&amp;gt;  
   &amp;lt;/body&amp;gt;  
 &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;
















</content><link rel='replies' type='application/atom+xml' href='https://www.stevennathaniel.web.id/feeds/8017186554337112906/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.stevennathaniel.web.id/2023/11/this-blog-will-be-written-in-language.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/8017186554337112906'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/156945889618361525/posts/default/8017186554337112906'/><link rel='alternate' type='text/html' href='https://www.stevennathaniel.web.id/2023/11/this-blog-will-be-written-in-language.html' title='This Blog will be Written in a Language Other Than Indonesian'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/H_Fnd4aInHI/default.jpg" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Balikpapan, Kota Balikpapan, Kalimantan Timur, Indonesia</georss:featurename><georss:point>-1.2379274 116.8528526</georss:point><georss:box>-29.548161236178846 81.6966026 27.072306436178845 152.0091026</georss:box></entry></feed>