<?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-932984404072302429</id><updated>2026-03-21T23:10:56.618-07:00</updated><category term="flash"/><category term="programming"/><category term="examples"/><category term="actionscript"/><category term="code"/><category term="tutorials"/><category term="AS3.0"/><category term="web development"/><category term="downloads"/><category term="news"/><category term="adobe"/><category term="open source"/><category term="blog"/><category term="community"/><category term="flex"/><category term="links"/><category term="animations"/><category term="air"/><category term="fun"/><category term="game development"/><category term="games"/><category term="AS2.0"/><category term="widgets"/><category term="RIA"/><category term="blogger"/><category term="components"/><category term="books"/><category term="javascript"/><category term="business"/><category term="video"/><category term="web services"/><category term="HTML5"/><category term="flash tools"/><category term="flex examples"/><category term="cs4"/><category term="python"/><category term="research"/><category term="HTML"/><category term="freelance"/><category term="3D flash"/><category term="cs5"/><category term="math"/><category term="polls"/><category term="twitter"/><category term="google"/><category term="CSS"/><category term="exercise"/><category term="flash jobs"/><category term="free ebooks"/><category term="mxml"/><category term="web2.0"/><category term="flash clocks"/><category term="flex builder"/><category term="gumbo"/><category term="Facebook"/><category term="apollo"/><category term="canvas"/><category term="competitions"/><category term="flash menu"/><category term="gamedev"/><category term="learning"/><category term="templates"/><category term="FXG"/><category term="CSS3"/><category term="Flint"/><category term="Phaser"/><category term="conferences"/><category term="educational games"/><category term="iPhone"/><category term="themes"/><category term="tkinter"/><category term="workinprogress"/><category term="Android"/><category term="application"/><category term="certification"/><category term="data structures"/><category term="digital art"/><category term="flash builder"/><category term="flash player"/><category term="flex hero"/><category term="photo gallery"/><category term="software"/><category term="spark"/><category term="web events"/><category term="3D"/><category term="Fuse"/><category term="SVG"/><category term="Unity"/><category term="catalyst"/><category term="cs3"/><category term="flash templates"/><category term="flashdevelop"/><category term="gdevelop5"/><category term="hacks"/><category term="indie"/><category term="mobile"/><category term="photoshop"/><category term="sql"/><category term="three.js"/><category term="tweener"/><category term="visualization"/><category term="Adobe Bridge"/><category term="Apple"/><category term="ColdFusion"/><category term="LiveCycle"/><category term="UML"/><category term="YouTube"/><category term="citrus engine"/><category term="coffeescript"/><category term="diesel"/><category term="flash security"/><category term="flex exam"/><category term="flv format"/><category term="github"/><category term="godot engine"/><category term="guest posting"/><category term="gui"/><category term="mashups"/><category term="papervision3d"/><category term="photoshop express"/><category term="quiz"/><category term="screenshotsaturday"/><category term="vector"/><category term="web design"/><title type='text'>Flash Adventures Blog</title><subtitle type='html'>small educational projects and tutorials in Python / &#xa;HTML / CSS / JavaScript / ActionScript </subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://flanture.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://flanture.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><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><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>335</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-932984404072302429.post-7080482410421803518</id><published>2020-09-08T12:18:00.000-07:00</published><updated>2020-09-08T12:18:11.199-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="code"/><category scheme="http://www.blogger.com/atom/ns#" term="free ebooks"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="sql"/><category scheme="http://www.blogger.com/atom/ns#" term="tkinter"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorials"/><title type='text'>Adding Themed Style to Python application</title><content type='html'>&lt;p&gt;This post is addition to my FREE e-book: &lt;a href=&quot;https://gum.co/hBLUhd&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Build simple Library Manager with Python and Tkinter&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;There are many things you can do to improve your python Tkinter application, either by adding new useful features or by making look and feel more user friendly.&lt;/p&gt;&lt;p&gt;When it comes to Tkinter GUI library, there is widespread opinion that it looks outdated and ugly when compared to other platforms like Kivy or PyQT. However, not many people have used themed styles for Tkinter and those styles give python application really modern look. You can check all available themes on Github: https://github.com/TkinterEP/ttkthemes&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;To install themes open your command prompt and execute:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;pip install ttkthemes&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;You will have to add few lines and change few lines in your application.&lt;/p&gt;&lt;p&gt;First, you need to import newly installed library like this:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;from ttkthemes import ThemedStyle&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Next, in both add_book_dialog and edit_book_dialog functions, just after creating Tk window with self.tl=Tk() add style like this:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;#Setting theme&lt;/p&gt;&lt;p&gt;style = ThemedStyle(self.tl)&lt;/p&gt;&lt;p&gt;style.set_theme(“plastik”)&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;You can experiment here with other styles like: Aquativo, Arc, Black, Blue, Breeze, Clearlooks, Elegance, Keramik, Yaru and others, see docs for full info.&lt;/p&gt;&lt;p&gt;Also you will have to remove styling parameters for buttons. In add_book_dialog function, instead of line upbtn = Button(...) add new line:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;upbtn = ttk.Button (self.tl, text=’Add new book’, command = lambda:self.add_book(ne1, ne2, ne3, ne4))&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Please also in edit_book_dialog do the same for Enter details and Delete book buttons: instead of Button add ttk.Button and delete bg and fg parameters.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Finally at the bottom of the code there is line to create root window: root = Tk(). Just below this line add code to apply plastik style to root window also:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;#Setting style&lt;/p&gt;&lt;p&gt;style = ThemedStyle(root)&lt;/p&gt;&lt;p&gt;style.set_theme(“plastik”)&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Style is applied and your application should look as image below.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfToSfD01Ebf9Tb_UrQcLlfdc2ylOA1Z8CYd2kacwrAX-8bo-DYbfQGIwmDPZqPKfZiHvhywhlvPf-QVirER2ThZSDkE_ZaLXK5xrRZo3d29K00-JHMSkXrdn5u4czDIrwKtqb14IJZbg0/s759/style.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;505&quot; data-original-width=&quot;759&quot; height=&quot;333&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfToSfD01Ebf9Tb_UrQcLlfdc2ylOA1Z8CYd2kacwrAX-8bo-DYbfQGIwmDPZqPKfZiHvhywhlvPf-QVirER2ThZSDkE_ZaLXK5xrRZo3d29K00-JHMSkXrdn5u4czDIrwKtqb14IJZbg0/w500-h333/style.jpg&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://flanture.blogspot.com/feeds/7080482410421803518/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://flanture.blogspot.com/2020/09/adding-themed-style-to-python.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/7080482410421803518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/7080482410421803518'/><link rel='alternate' type='text/html' href='http://flanture.blogspot.com/2020/09/adding-themed-style-to-python.html' title='Adding Themed Style to Python application'/><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://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfToSfD01Ebf9Tb_UrQcLlfdc2ylOA1Z8CYd2kacwrAX-8bo-DYbfQGIwmDPZqPKfZiHvhywhlvPf-QVirER2ThZSDkE_ZaLXK5xrRZo3d29K00-JHMSkXrdn5u4czDIrwKtqb14IJZbg0/s72-w500-h333-c/style.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932984404072302429.post-3612424848417922791</id><published>2020-09-06T13:52:00.000-07:00</published><updated>2020-09-06T13:52:02.597-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="code"/><category scheme="http://www.blogger.com/atom/ns#" term="community"/><category scheme="http://www.blogger.com/atom/ns#" term="exercise"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorials"/><title type='text'>Python exercise: Sum values from text file and print the result</title><content type='html'>&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF9sHg6dTy4JEvnctTJYxqWabX81BvsvByj1MHPuserVhQL3O9171noM2Cn4T5tW7mjo-wqeHELM4ClxfKbeoPtxStg__8LoVORLpNk9C0ize8XBLqp-SXAT8QjZwufuwyX1Z-bYR4v9SX/s600/python.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;338&quot; data-original-width=&quot;600&quot; height=&quot;281&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF9sHg6dTy4JEvnctTJYxqWabX81BvsvByj1MHPuserVhQL3O9171noM2Cn4T5tW7mjo-wqeHELM4ClxfKbeoPtxStg__8LoVORLpNk9C0ize8XBLqp-SXAT8QjZwufuwyX1Z-bYR4v9SX/w500-h281/python.jpg&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;background: 0px 0px white; border: 0px; color: #888888; font-family: &amp;quot;open sans&amp;quot;, serif; font-size: 14px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;background: 0px 0px white; border: 0px; color: #888888; font-family: &amp;quot;open sans&amp;quot;, serif; font-size: 14px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;div&gt;&lt;span style=&quot;background: 0px 0px white; border: 0px; color: #888888; font-family: &amp;quot;open sans&amp;quot;, serif; font-size: 14px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;Python exercise&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &amp;quot;open sans&amp;quot;, serif; font-size: 14px;&quot; /&gt;&lt;span style=&quot;background: 0px 0px white; border: 0px; color: #888888; font-family: &amp;quot;open sans&amp;quot;, serif; font-size: 14px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;*************&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &amp;quot;open sans&amp;quot;, serif; font-size: 14px;&quot; /&gt;&lt;span style=&quot;background: 0px 0px rgb(207, 226, 243); border: 0px; color: #888888; font-family: &amp;quot;open sans&amp;quot;, serif; font-size: 14px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;background: 0px 0px white; border: 0px; color: #888888; font-family: &amp;quot;open sans&amp;quot;, serif; font-size: 14px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;background: 0px 0px rgb(207, 226, 243); border: 0px; color: #888888; font-family: &amp;quot;open sans&amp;quot;, serif; font-size: 14px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Episode: 7&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &amp;quot;open sans&amp;quot;, serif; font-size: 14px;&quot; /&gt;&lt;span style=&quot;background: 0px 0px rgb(244, 204, 204); border: 0px; color: #888888; font-family: &amp;quot;open sans&amp;quot;, serif; font-size: 14px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Level: Beginner&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &amp;quot;open sans&amp;quot;, serif; font-size: 14px;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: &amp;quot;open sans&amp;quot;, serif; font-size: 14px;&quot; /&gt;&lt;span style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; color: #888888; font-family: &amp;quot;open sans&amp;quot;, serif; font-size: 14px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Let&#39;s say you have some text file and this file have different number on every line.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; color: #888888; font-family: &amp;quot;open sans&amp;quot;, serif; font-size: 14px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; color: #888888; font-family: &amp;quot;open sans&amp;quot;, serif; font-size: 14px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;input.txt&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background: 0px 0px rgb(255, 255, 255); border: 0px; color: #888888; font-family: &amp;quot;open sans&amp;quot;, serif; font-size: 14px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;pre style=&quot;background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; overflow-wrap: normal;&quot;&gt;1:  223.5  
2:  -12.1  
3:  4308  
4:  -449.8  
5:  18.9  
6:  1  
7:  2209  
8:  -1890  
9:  14.45  &lt;/code&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style=&quot;background-color: white; color: #888888; font-family: &amp;quot;open sans&amp;quot;, serif; font-size: 14px;&quot;&gt;Your task is to sum all values from that file and print the result.&lt;/span&gt;&lt;div&gt;&lt;span style=&quot;background-color: white; color: #888888; font-family: &amp;quot;open sans&amp;quot;, serif; font-size: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: white; color: #888888; font-family: &amp;quot;open sans&amp;quot;, serif; font-size: 14px;&quot;&gt;One solution is to use list comprehensions to make a list of values and then sum the list.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: white; color: #888888; font-family: &amp;quot;open sans&amp;quot;, serif; font-size: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: white; color: #888888; font-family: &amp;quot;open sans&amp;quot;, serif; font-size: 14px;&quot;&gt;Solution:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: white; color: #888888; font-family: &amp;quot;open sans&amp;quot;, serif; font-size: 14px;&quot;&gt;&lt;pre style=&quot;background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; overflow-wrap: normal;&quot;&gt;1:  with open(&quot;input.txt&quot;, &quot;r&quot;) as tf:  
2:    numbers = [float(line) for line in tf]  
3:    total = sum(numbers)  
4:    print(total)  
&lt;/code&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: white; color: #888888; font-family: &amp;quot;open sans&amp;quot;, serif; font-size: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: white; color: #888888; font-family: &amp;quot;open sans&amp;quot;, serif; font-size: 14px;&quot;&gt;With numbers above what is your result?&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: white; color: #888888; font-family: &amp;quot;open sans&amp;quot;, serif; font-size: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: white; color: #888888; font-family: &amp;quot;open sans&amp;quot;, serif; font-size: 14px;&quot;&gt;o_o&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flanture.blogspot.com/feeds/3612424848417922791/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://flanture.blogspot.com/2020/09/python-exercise-sum-values-from-text.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/3612424848417922791'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/3612424848417922791'/><link rel='alternate' type='text/html' href='http://flanture.blogspot.com/2020/09/python-exercise-sum-values-from-text.html' title='Python exercise: Sum values from text file and print the result'/><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://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF9sHg6dTy4JEvnctTJYxqWabX81BvsvByj1MHPuserVhQL3O9171noM2Cn4T5tW7mjo-wqeHELM4ClxfKbeoPtxStg__8LoVORLpNk9C0ize8XBLqp-SXAT8QjZwufuwyX1Z-bYR4v9SX/s72-w500-h281-c/python.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932984404072302429.post-3863085029377651305</id><published>2020-09-04T14:46:00.003-07:00</published><updated>2020-09-04T14:46:35.208-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="code"/><category scheme="http://www.blogger.com/atom/ns#" term="gui"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="sql"/><category scheme="http://www.blogger.com/atom/ns#" term="tkinter"/><title type='text'>Windows management system for python GUI explained </title><content type='html'>&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;This explanation is about previously published tutorial &lt;a href=&quot;https://flanture.blogspot.com/2020/06/simple-books-manager-app-using-python-and-tkinter.html&quot; target=&quot;_blank&quot;&gt;Build simple Books Manager application with Python and Tkinter from scratch&lt;/a&gt;.&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Application has one main window and two context windows. Those context windows are opening whenever user clicks on &#39;New book&#39; and &#39;Edit book&#39; button on the left side of the main app window.&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;The goal here is to prevent user to click those buttons again or to select another item from book list when any of the context windows are open.&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;This is done using two things. First is context_open property from main Library class. At the end of the __init__ function we declare this property to be false with:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;i&gt;self.context_open = False&lt;/i&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;We do this because when main window is created for the first time no context window is open.&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Second thing is self.config() function.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpiPlgrZ2EhpDdSeXNWPInk11bDbbyDiqDj9lVnVZRn6cEc7vHWjMsE5PXz0ynoBF80wJLY5e12haecsjAimKeAJNnHa19yfce8kT6K7vJyZoUYuRNgWJmgE_eWbFCDDml2NJd0bzGjUkK/s797/config.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;534&quot; data-original-width=&quot;797&quot; height=&quot;335&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpiPlgrZ2EhpDdSeXNWPInk11bDbbyDiqDj9lVnVZRn6cEc7vHWjMsE5PXz0ynoBF80wJLY5e12haecsjAimKeAJNnHa19yfce8kT6K7vJyZoUYuRNgWJmgE_eWbFCDDml2NJd0bzGjUkK/w500-h335/config.jpg&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Function config is called when any of the context window opens. So what happens inside config function?&lt;/p&gt;&lt;p&gt;If context_open is false, we first set:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;i&gt;root.protocol(&#39;WM_DELETE_WINDOW&#39;, lambda:0)&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;to disable root windows close button. If we don&#39;t do this, when user closes root window, context window will stay open hanging from closed application, which is a major bug. You can comment out this line to see this bug in action.&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;We also set buttons state to disabled and with&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/p&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;i&gt;tree.config(selectmode=&quot;none&quot;)&lt;/i&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;we don&#39;t allow user to change list selection.&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;If, on the other hand, context_open is true, that means we closed context window and we need to restore state parameters for buttons, than restore option for user to be able to select item from the list and with:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;i&gt;root.protocol(&#39;WM_DELETE_WINDOW&#39;, root.destroy)&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;we restore root window close button functionality.&lt;/p&gt;&lt;p&gt;Last line of config function acts like a switch.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;i&gt;self.context_open = not self.context_open&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;It changes value of context_open variable from False to True and vice versa.&lt;/p&gt;&lt;p&gt;I hope this makes clear how windows management system works.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Thanks for reading.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://flanture.blogspot.com/feeds/3863085029377651305/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://flanture.blogspot.com/2020/09/windows-management-system-for-python.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/3863085029377651305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/3863085029377651305'/><link rel='alternate' type='text/html' href='http://flanture.blogspot.com/2020/09/windows-management-system-for-python.html' title='Windows management system for python GUI explained '/><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://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpiPlgrZ2EhpDdSeXNWPInk11bDbbyDiqDj9lVnVZRn6cEc7vHWjMsE5PXz0ynoBF80wJLY5e12haecsjAimKeAJNnHa19yfce8kT6K7vJyZoUYuRNgWJmgE_eWbFCDDml2NJd0bzGjUkK/s72-w500-h335-c/config.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932984404072302429.post-8843431701307720718</id><published>2020-06-07T05:18:00.006-07:00</published><updated>2020-09-04T01:27:35.575-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="application"/><category scheme="http://www.blogger.com/atom/ns#" term="code"/><category scheme="http://www.blogger.com/atom/ns#" term="community"/><category scheme="http://www.blogger.com/atom/ns#" term="exercise"/><category scheme="http://www.blogger.com/atom/ns#" term="Facebook"/><category scheme="http://www.blogger.com/atom/ns#" term="learning"/><category scheme="http://www.blogger.com/atom/ns#" term="open source"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="software"/><category scheme="http://www.blogger.com/atom/ns#" term="tkinter"/><category scheme="http://www.blogger.com/atom/ns#" term="twitter"/><title type='text'>Build simple Books Manager application with Python and Tkinter from scratch</title><content type='html'>&lt;br /&gt;&lt;center&gt;&lt;script src=&quot;https://gumroad.com/js/gumroad.js&quot;&gt;&lt;/script&gt;
&lt;a class=&quot;gumroad-button&quot; href=&quot;https://gum.co/hBLUhd&quot; target=&quot;_blank&quot;&gt;Get free PDF now!&lt;/a&gt;&lt;/center&gt;&lt;br /&gt;
&lt;div&gt;&lt;font size=&quot;4&quot;&gt;&lt;br /&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font size=&quot;4&quot;&gt;&lt;br /&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font size=&quot;4&quot;&gt;INTRODUCTION&amp;nbsp;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Hello. This tutorial will show you in details how to build Books Manager program using python programming language.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Why this tutorial? You can easily find online basic programming tutorials. Stuff like what are variables and loops, basic language commands, how to write &quot;hello world&quot; program or how to build simple calculator.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However, when you finish those beginners lessons you often find yourself repeating same tutorials all over again in a not so productive cycle.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This tutorial will help you break that cycle and build something useful, a project to move ahead to more intermediate programming.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You will learn how to setup python on your computer (you can skip this part if you already have python installed), how to build user interface using tkinter, builtin python library and finally how to use sqlite database to save and retrieve data in your program.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;span style=&quot;text-align: left;&quot;&gt;At the end I will give you some ideas how you can expand software you have built.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0OZNalNLICSNZIEdnFgWUrPJjbgaAkpy-fDxiEoSFIsfJ4pgxyhB7iTYGP1uBGRMYpSCPfWab24WFS7bYc7knYV1QJHpStKlBvgnx0jHjd7MlhrINOu-X7WN7JpMNw36R3HRqQ6R2aL1Y/s700/LibraryApp.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;471&quot; data-original-width=&quot;700&quot; height=&quot;269&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0OZNalNLICSNZIEdnFgWUrPJjbgaAkpy-fDxiEoSFIsfJ4pgxyhB7iTYGP1uBGRMYpSCPfWab24WFS7bYc7knYV1QJHpStKlBvgnx0jHjd7MlhrINOu-X7WN7JpMNw36R3HRqQ6R2aL1Y/w400-h269/LibraryApp.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;CONTENTS&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Setup&lt;/div&gt;&lt;div&gt;Application structure&lt;/div&gt;&lt;div&gt;GUI Layout&lt;/div&gt;&lt;div&gt;Adding books dialog&lt;/div&gt;&lt;div&gt;Edit book dialog&lt;/div&gt;&lt;div&gt;Working with databases&lt;/div&gt;&lt;div&gt;Misc functions&lt;/div&gt;&lt;div&gt;Final words&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;SETUP&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For this tutorial you will need python installed on your computer. Installation is easy and quick, it takes only few minutes to complete.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I&#39;ll show you how to install python on Windows but installation is also straightforward on other systems.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In your browser open &lt;a href=&quot;https://www.python.org/downloads/&quot; target=&quot;_blank&quot;&gt;python download page&lt;/a&gt; and click to download latest python version. I&#39;m using in this tutorial python version 3.7.4 but any newer version should work fine.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxun-_avJwFJBmXG72J4Th2pWmPQGjLl-4XLW6jYN8kjLx7DnUE55Uhi9tX5wt93vTOfpaYj4OmbFJ0lqIv49JYAfWjFdqkdzBHALAkfsKUiinmSdnl8I-BrHj6DjG4zNvttSQQh8bzGMs/s700/PythonDownloadPage.jpg&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;360&quot; data-original-width=&quot;700&quot; height=&quot;206&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxun-_avJwFJBmXG72J4Th2pWmPQGjLl-4XLW6jYN8kjLx7DnUE55Uhi9tX5wt93vTOfpaYj4OmbFJ0lqIv49JYAfWjFdqkdzBHALAkfsKUiinmSdnl8I-BrHj6DjG4zNvttSQQh8bzGMs/w400-h206/PythonDownloadPage.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Run the file you just downloaded. Python install wizard will open, which is really easy to use. You only have to accept the default settings, wait until the install is finished, and you are done with setup.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you have any problems during install, leave comment and I&#39;ll try to help you.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can use python builtin IDLE editor or any other IDE for python you want. You can actually use any text editor, create new text file, rename it to app.py and start typing.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now let&#39;s write some software.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;font size=&quot;4&quot;&gt;APPLICATION STRUCTURE&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Application consists of imports, main class Library and few lines to start the app. Here is application code structure:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre style=&quot;text-align: left;&quot;&gt;from tkinter import *&lt;br /&gt;from tkinter import ttk&lt;br /&gt;import sqlite3&lt;br /&gt;import os.path&lt;br /&gt;import csv&lt;br /&gt;class Library:&lt;br /&gt;&amp;nbsp; &amp;nbsp; def __init__(self, master):&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp; # UI setup&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;br /&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; def add_book_dialog(self):&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;&#39;&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Add new book window&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;&#39;&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; def edit_book_dialog(self):&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;&#39;&#39;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;Edit book window &lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;&#39;&#39;&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; def add_book(self):&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;&#39;&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Function adds book to database&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;&#39;&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; def enter_changes(self):&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;&#39;&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Enter changes to database function (when editing book)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;&#39;&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; def delete_book(self, name):&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;&#39;&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Deletes chosen book from database and list&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;&#39;&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; def update_list(self):&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;&#39;&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Updates book list from database into treeview&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;&#39;&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; def config(self):&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;&#39;&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Windows management function&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;&#39;&#39;&lt;br /&gt;root = Tk()&lt;br /&gt;root.title(&quot;Library&quot;)&lt;br /&gt;application = Library(root)&lt;br /&gt;root.mainloop()&lt;/pre&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Since this is very simple application, frontend and backend functions are all in the same file. It is a good practice to separate it however.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Last 4 lines of code are defining root variable as TK, giving it a title and starting the app.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Lat&#39;s populate our functions and explain it one by one.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;font size=&quot;4&quot;&gt;GUI LAYOUT&lt;/font&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Just below UI setup comment add code for UI. Make sure your indentation is correct.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre style=&quot;text-align: left;&quot;&gt;leftFrame = Frame(width=150, height=600)&lt;br /&gt;leftFrame.grid(row=0, column=0, padx=10, pady=5, sticky=N)&lt;/pre&gt;&lt;pre style=&quot;text-align: left;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;self.addbtn = ttk.Button(leftFrame, text=&quot;New book&quot;, width=15, command=self.add_book_dialog)&lt;br /&gt;self.addbtn.grid(row=0, column=0, sticky=W+N)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style=&quot;text-align: left;&quot;&gt;self.modbtn = ttk.Button(leftFrame, text=&quot;Edit book&quot;, width=15, command=self.edit_book_dialog)&lt;br /&gt;self.modbtn.grid(row=1, column=0, sticky=W+N)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style=&quot;text-align: left;&quot;&gt;rightFrame = Frame(width=150, height=600)&lt;br /&gt;rightFrame.grid(row=0, column=1, padx=0, pady=5)&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style=&quot;text-align: left;&quot;&gt;self.tree = ttk.Treeview(rightFrame, show=&quot;headings&quot;, height=20, column=4, selectmode=&quot;browse&quot;)&lt;br /&gt;self.tree.grid(row=0, column=1, rowspan=20, sticky=N)&lt;br /&gt;self.vsb = ttk.Scrollbar(rightFrame, orient=&quot;vertical&quot;, command=self.tree.yview)&lt;br /&gt;self.vsb.grid(row=0, column=2, sticky=N+S+E+W, rowspan=20)&lt;br /&gt;self.tree.configure(yscrollcommand=self.vsb.set)&lt;br /&gt;self.tree[&quot;columns&quot;]=(&quot;one&quot;,&quot;two&quot;,&quot;tree&quot;,&quot;four&quot;)&lt;br /&gt;self.tree.column(&quot;one&quot;, width=140)&lt;br /&gt;self.tree.column(&quot;two&quot;, width=240)&lt;br /&gt;self.tree.column(&quot;tree&quot;, width=100)&lt;br /&gt;self.tree.column(&quot;four&quot;, width=100)&lt;br /&gt;self.tree.heading(&quot;one&quot;, text=&#39;Author&#39;, anchor=N)&lt;br /&gt;self.tree.heading(&quot;two&quot;, text=&#39;Title&#39;, anchor=N)&lt;br /&gt;self.tree.heading(&quot;tree&quot;, text=&#39;Pages&#39;, anchor=N)&lt;br /&gt;self.tree.heading(&quot;four&quot;, text=&#39;Date&#39;, anchor=N)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style=&quot;text-align: left;&quot;&gt;self.msg=Label(text=&#39;*&#39;, fg=&#39;red&#39;)&lt;br /&gt;self.msg.grid(row=21, column=1)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style=&quot;text-align: left;&quot;&gt;self.context_open = False&lt;br /&gt;self.update_list()&lt;/pre&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;OK. We have two frame inside root, leftFrame and rightFrame. Left will hold buttons and right one will hold Treeview widget for books data.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Both leftFrame and rightFrame have some basic parameters like width, height, padding and layout position. Here we use grid layout. You can read more about layouts in Tkinter docs. Besides grid there is also pack and place layouts.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Left frame contains two buttons, one for adding new book addbtn and one for editing existing book data modbtn. You place them inside leftFrame with adding leftFrame as first parameter, you add button text, width and command, which is actually name of our function below (see application structure).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Sticky parameter inside grid layout positions buttons as we want them. Value is W-west and N-north. There are also E-east and S-south sides as you probably assumed.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Right frame has also a scrollbarr which you need to attach to treeview widget with tree.configure.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;After you add treeview columns with desired text, you also have Label widget at the bottom of the window to display info. Notice how that message (msg) widget grid position row is 21, because we earlier set rowspan=20 for our treeview.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;That&#39;s it for the interface, at the bottom we call update_list function to populate our tree with existing data from database and we also set context_open to False which we use to enable and disable editing of root elements when other windows are open.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;font size=&quot;4&quot;&gt;ADDING BOOKS DIALOG&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4_RTF9soiXwGM0nmrZzBwjXyOoRCYCsJ1LD3Fg-0ciweGGO8SA8YSbRrBLShg_5HnF0rP0ouJfu0gvtoyzvM-5zXyHJKsN214YVC48CI_fdObNW8NLRZUDeKDtEPdLKorVD-8ZRqG_ahr/s322/AddBookDialog.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;215&quot; data-original-width=&quot;322&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4_RTF9soiXwGM0nmrZzBwjXyOoRCYCsJ1LD3Fg-0ciweGGO8SA8YSbRrBLShg_5HnF0rP0ouJfu0gvtoyzvM-5zXyHJKsN214YVC48CI_fdObNW8NLRZUDeKDtEPdLKorVD-8ZRqG_ahr/s320/AddBookDialog.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Let&#39;s look at the code for Add book window. We have 4 parts at the top and every one of them has label: Author, Title, Pages and Date and Entry widget. At the bottom is Button widget with attached command to execute sql query. More on that later.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;pre&gt;def add_book_dialog(self):&lt;br /&gt;&amp;nbsp; &amp;nbsp; &#39;&#39;&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; Add new book dialog&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &#39;&#39;&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; try:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.msg[&quot;text&quot;] = &quot;&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.tl = Tk()&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.tl.title(&quot;Add book&quot;)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.tl.resizable(False, False)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # window position&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x=root.winfo_rootx()+150&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; y=root.winfo_rooty()+50&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.tl.geometry(&#39;+%d+%d&#39; % (x,y))&lt;/pre&gt;&lt;pre&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Label(self.tl,text=&#39;Author:&#39;).grid(row=0, column=0, sticky=W)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ne1var = StringVar()&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ne1 = Entry(self.tl, textvariable=ne1var)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ne1.grid(row=0, column=1, sticky=W)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ne1.insert(0,&quot;&quot;)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Label(self.tl,text=&#39;Title:&#39;).grid(row=1, column=0, sticky=W)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ne2var = StringVar()&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ne2 = Entry(self.tl, textvariable=ne2var)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ne2.grid(row=1, column=1, sticky=W)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ne2.insert(0,&quot;&quot;)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Label(self.tl,text=&#39;Pages:&#39;).grid(row=2, column=0, sticky=W)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ne3var = StringVar()&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ne3 = Entry(self.tl, textvariable=ne3var)&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ne3.grid(row=2, column=1, sticky=W)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ne3.insert(0,&quot;&quot;)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Label(self.tl,text=&#39;Date:&#39;).grid(row=3, column=0, sticky=W)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ne4var = StringVar()&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ne4 = Entry(self.tl, textvariable=ne4var)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ne4.grid(row=3, column=1, sticky=W)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ne4.insert(0,&quot;&quot;)&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Button calls function for executing sql command&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; upbtn = Button(self.tl, bg=&quot;grey&quot;, fg=&quot;white&quot;, text= &#39;Add new book&#39;, command=lambda:self.add_book(ne1,ne2,ne3,ne4))&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; upbtn.grid(row=5, column=0, sticky=W, pady=10, padx=10)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.config()&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.tl.protocol(&quot;WM_DELETE_WINDOW&quot;, self.config)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.tl.mainloop()&lt;br /&gt;&amp;nbsp; &amp;nbsp; except IndexError as e:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.msg[&quot;text&quot;] = &quot;Error while adding a book&quot;&lt;/pre&gt;&lt;div&gt;As you see from the code above, entire function is inside try except so we make sure everything is ok.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We set window to be resizable. With root.winfo_rootx and y we set position of our new window in relation to root window.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;All 4 Label Entry widget pairs are the same except for the names of the variables. As you can see we have to use here tkinter&#39;s StringVar type and not regular python type. See docs for more info.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Button has a little style, we set background and foreground colors with bg and fg attributes.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When user clicks on the button add_book function is executed with 4 parameters, values from our previously entered widgets. Here, we don&#39;t have code to check validation, which is something to think about for some next version.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When we call config function at the bottom, this disables other buttons and only add book window is operational.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;font size=&quot;4&quot;&gt;EDIT BOOK DIALOG&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiY_DvLxb5rsReF8O7uoObG7ddRbstBDoudljKq3debj1qF3ESoJPpc-zgnmwuGt49Ocr_bBLhQmxKQZehwp96N6vh_ngfqtfs9VuyFfGo0e1Q3jVaGj9L0orbQPr4UNubxODUnTSM7EmXi/s458/EditBookDialog.jpg&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;247&quot; data-original-width=&quot;458&quot; height=&quot;216&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiY_DvLxb5rsReF8O7uoObG7ddRbstBDoudljKq3debj1qF3ESoJPpc-zgnmwuGt49Ocr_bBLhQmxKQZehwp96N6vh_ngfqtfs9VuyFfGo0e1Q3jVaGj9L0orbQPr4UNubxODUnTSM7EmXi/w400-h216/EditBookDialog.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Edit book window is very similar to add book window. Labels and Entry widgets are also there.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;This window has two buttons. Enter details button actually enters data into database and Delete book button is doing two things. First is to delete the book from the database and second one is to update data in Treeview widget.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Here is the code:&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;pre&gt;def edit_book_dialog(self):
    try:
        self.msg[&quot;text&quot;] = &quot; &quot;
        conn = sqlite3.connect(&#39;data.db&#39;)
        c = conn.cursor()
        name = self.tree.item(self.tree.selection()[0])[&#39;values&#39;][1]
        
        query = &quot;SELECT * FROM t WHERE Title = &#39;%s&#39;;&quot; %name
        db_data = c.execute(query)

        for item in db_data:
            _author = item[0]
            _title = item[1]
            _pages = item[2]
            _date = item[3]
            
        self.tl = Tk()
        self.tl.title(&quot;Edit details&quot;)
        x = root.winfo_rootx()+120
        y = root.winfo_rooty()+50
        self.tl.geometry(&#39;%dx%d+%d+%d&#39; % (380, 155, x, y))
        self.tl.resizable(False, False)

        Label(self.tl,text=&#39;Author: &#39;).grid(row=0, column=0, sticky=E+W)
        new_author = Entry(self.tl, width=30)
        new_author.grid(row=0, column=1, sticky=W, padx=10)
        new_author.insert(0,_author)

        Label(self.tl, text=&#39;Title: &#39;).grid(row=1, column=0,sticky=E+W)
        new_title = Entry(self.tl, width=30)
        new_title.grid(row=1, column=1, sticky=W, padx=10)
        new_title.insert(0,_title)

        Label(self.tl, text=&#39;Pages:&#39;).grid(row=2, column=0,sticky=E+W)
        new_pages = Entry(self.tl, width=30)
        new_pages.grid(row=2, column=1, sticky=W, padx=10)
        new_pages.insert(0,_pages)

        Label(self.tl, text=&#39;Date:&#39;).grid(row=3, column=0,sticky=E+W)
        new_date = Entry(self.tl, width=30)
        new_date.grid(row=3, column=1, sticky=W, padx=10)
        new_date.insert(0,_date)
                                    
        upbtn = Button(self.tl, bg=&quot;grey&quot;, fg=&quot;white&quot;, text=&#39;Enter details&#39;,
                       command=lambda:self.enter_changes(new_author,new_title,new_pages,new_date,name))
        upbtn.grid(row=4, column=0, sticky=W, padx=10, pady=10)

        dbtn = Button(self.tl, bg=&quot;grey&quot;, fg=&quot;white&quot;, text=&quot;Delete book&quot;, command=lambda:self.delete_book(name))
        dbtn.grid(row=4, column=1, sticky=W, padx=10, pady=10)

        conn.commit()
        c.close()
        
        self.config()
        self.tl.protocol(&quot;WM_DELETE_WINDOW&quot;, self.config)

        self.tl.mainloop()
        
    except IndexError as e:
        self.msg[&quot;text&quot;] = &quot;Select book to edit&quot;

&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First part of the function is database stuff. We will discuss databases later. Adding Labels, Entry widgets and Buttons is exactly the same as in previous function. Only difference are functions which are called when buttons are clicked, enter_changes and delete_book functions.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;One more thing. When user clicks edit button one item from Treeview must be selected, otherwise message is displayed: &quot;select book to edit&quot; and window is not opened. That&#39;s why function body is inside try except block.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;WORKING WITH DATABASE&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When you start the application for the first time there is no database create, so we have to add code to create if it does not exist. We do this at the beginning of Library class, just below init method and above our UI setup code. Place this code there and watch for correct indentation:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;pre style=&quot;text-align: left;&quot;&gt;if not os.path.exists(&#39;data.db&#39;):&lt;br /&gt;&amp;nbsp; &amp;nbsp; print(&#39;create database ...&#39;)&lt;br /&gt;&amp;nbsp; &amp;nbsp; con = sqlite3.connect(&quot;data.db&quot;)&lt;br /&gt;&amp;nbsp; &amp;nbsp; cur = con.cursor()&lt;br /&gt;&amp;nbsp; &amp;nbsp; cur.execute(&quot;CREATE TABLE t (Author,Title,Pages,Date);&quot;)&lt;br /&gt;&amp;nbsp; &amp;nbsp; con.commit()&lt;br /&gt;&amp;nbsp; &amp;nbsp; con.close()&lt;br /&gt;&amp;nbsp; &amp;nbsp; if os.path.exists(&#39;data.db&#39;):&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(&#39;done.&#39;)&lt;br /&gt;&amp;nbsp; &amp;nbsp; else:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(&#39;error creating database.&#39;)&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;First we check if data.db already exists. If not we create one. We use sqlite3 connect function, we must then set the cursor to execute sql query.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Our table t has 4 fields: Author, Title, Pages and Date. In the end, commit changes and close the connection. This is how you create new database to store values. Simple.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Remember edit_book_dialog function? We connect to our database there also, but first we take selected treeview item, actually its title value and compare it with appropriate row in database to return entire row. We use this line:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre style=&quot;text-align: left;&quot;&gt;name = self.tree.item(self.tree.selection()[0])[&#39;values&#39;][1]&lt;/pre&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Value [1] is second value in list (Title), since zero is first (Author). We have set in our code for user to be able to select only one item per selection, so selection value will always be [0] in selection()[0] part.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;We have 3 more function to work with our database:&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;pre&gt;def add_book(self,a,b,c,d):&lt;br /&gt;&amp;nbsp; &amp;nbsp; &#39;&#39;&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; Function adds book to database&lt;br /&gt;&amp;nbsp; &amp;nbsp; &#39;&#39;&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; a1 = a.get()&lt;br /&gt;&amp;nbsp; &amp;nbsp; b1 = b.get()&lt;br /&gt;&amp;nbsp; &amp;nbsp; c1 = c.get()&lt;br /&gt;&amp;nbsp; &amp;nbsp; d1 = d.get()&lt;br /&gt;&amp;nbsp; &amp;nbsp; conn = sqlite3.connect(&#39;data.db&#39;)&lt;br /&gt;&amp;nbsp; &amp;nbsp; c = conn.cursor()&lt;br /&gt;&amp;nbsp; &amp;nbsp; c.execute(&quot;INSERT INTO t(Author,Title,Pages,Date) VALUES (?,?,?,?)&quot;, (a1,b1,c1,d1))&lt;br /&gt;&amp;nbsp; &amp;nbsp; conn.commit()&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; c.close()&lt;br /&gt;&amp;nbsp; &amp;nbsp; self.msg[&quot;text&quot;] = &quot;Book added.&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; self.config()&lt;br /&gt;&amp;nbsp; &amp;nbsp; self.update_list()&lt;br /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;br /&gt;def enter_changes(self,new_author,new_title,new_pages,new_date,name):&lt;br /&gt;&amp;nbsp; &amp;nbsp; &#39;&#39;&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; Enter changes to database function&lt;br /&gt;&amp;nbsp; &amp;nbsp; &#39;&#39;&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; inAuthor = new_author.get()&lt;br /&gt;&amp;nbsp; &amp;nbsp; inTitle = new_title.get()&lt;br /&gt;&amp;nbsp; &amp;nbsp; inPages = new_pages.get()&lt;br /&gt;&amp;nbsp; &amp;nbsp; inDate = new_date.get()&lt;br /&gt;&amp;nbsp; &amp;nbsp; inName = name&lt;br /&gt;&amp;nbsp; &amp;nbsp; conn = sqlite3.connect(&#39;data.db&#39;)&lt;br /&gt;&amp;nbsp; &amp;nbsp; c = conn.cursor()&lt;br /&gt;&amp;nbsp; &amp;nbsp; c.execute(&#39;UPDATE t SET Author=(?), Title=(?), Pages=(?), Date=(?) WHERE Title=(?) AND Author=(?)&#39;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (inAuthor,inTitle,inPages,inDate,inName,inAuthor))&lt;br /&gt;&amp;nbsp; &amp;nbsp; conn.commit()&lt;br /&gt;&amp;nbsp; &amp;nbsp; c.close()&lt;br /&gt;&amp;nbsp; &amp;nbsp; self.msg[&#39;text&#39;] = &quot;Data for &#39;%s&#39; is changed&quot; %name&lt;br /&gt;&amp;nbsp; &amp;nbsp; self.config()&lt;br /&gt;&amp;nbsp; &amp;nbsp; self.update_list()&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre&gt;def delete_book(self, name):&lt;br /&gt;&amp;nbsp; &amp;nbsp; &#39;&#39;&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; Deletes chosen book from database and list&lt;br /&gt;&amp;nbsp; &amp;nbsp; &#39;&#39;&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; dName = name&lt;br /&gt;&amp;nbsp; &amp;nbsp; conn = sqlite3.connect(&#39;data.db&#39;)&lt;br /&gt;&amp;nbsp; &amp;nbsp; c = conn.cursor()&lt;br /&gt;&amp;nbsp; &amp;nbsp; sql_query = &quot;&quot;&quot;DELETE from t WHERE Title=(?)&quot;&quot;&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; c.execute(sql_query, (dName,))&lt;br /&gt;&amp;nbsp; &amp;nbsp; conn.commit()&lt;br /&gt;&amp;nbsp; &amp;nbsp; c.close()&lt;br /&gt;&amp;nbsp; &amp;nbsp; self.msg[&quot;text&quot;] = &quot;Book is deleted&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; self.config()&lt;br /&gt;&amp;nbsp; &amp;nbsp; self.update_list()&lt;/pre&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Add book function adds new book entry to database and enter changes data come from edit book dialog, so enter changes function will change data for already existing book.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Delete book, off course deletes the book. Note that this function takes only Title as value to find database item, so if there are 2 or more books in the database with the same Title (possible situation) all will be deleted. Solution will be to check to values, for example Title and Author&#39;s name. You can do this as exercise.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;MISC FUNCTIONS&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;We have only left with two last helper functions and application is finished. Let&#39;s see them.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;pre&gt;def update_list(self):&lt;br /&gt;&amp;nbsp; &amp;nbsp; &#39;&#39;&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; Updates book list from database into treeview&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &#39;&#39;&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; # delete current items&lt;br /&gt;&amp;nbsp; &amp;nbsp; x = self.tree.get_children()&lt;br /&gt;&amp;nbsp; &amp;nbsp; for item in x:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.tree.delete(item)&lt;br /&gt;&amp;nbsp; &amp;nbsp; # read new data&lt;br /&gt;&amp;nbsp; &amp;nbsp; conn = sqlite3.connect(&#39;data.db&#39;)&lt;br /&gt;&amp;nbsp; &amp;nbsp; c = conn.cursor()&lt;br /&gt;&amp;nbsp; &amp;nbsp; lst = c.execute(&quot;SELECT * FROM t ORDER BY Date(Date) desc&quot;)&lt;br /&gt;&amp;nbsp; &amp;nbsp; for row in lst:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.tree.insert(&quot;&quot;, END, text=&quot;&quot;, values=(row[0], row[1], row[2], row[3]))&lt;br /&gt;&amp;nbsp; &amp;nbsp; conn.commit()&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; c.close()&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre&gt;def config(self):&lt;br /&gt;&amp;nbsp; &amp;nbsp; &#39;&#39;&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; Windows management function&lt;br /&gt;&amp;nbsp; &amp;nbsp; &#39;&#39;&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; if self.context_open:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.addbtn.config(state=NORMAL)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.modbtn.config(state=NORMAL)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.tree.config(selectmode=&quot;browse&quot;)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.tl.destroy()&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # restore root close button function&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; root.protocol(&#39;WM_DELETE_WINDOW&#39;, root.destroy)&lt;br /&gt;&amp;nbsp; &amp;nbsp; else:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # ignore root close button&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; root.protocol(&#39;WM_DELETE_WINDOW&#39;, lambda:0)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.addbtn.config(state=DISABLED)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.modbtn.config(state=DISABLED)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.tree.config(selectmode=&quot;none&quot;)&lt;br /&gt;&amp;nbsp; &amp;nbsp; self.context_open = not self.context_open&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/pre&gt;&lt;div&gt;Update list function first deletes entire Treeview and then connects with database, reads the data and populates Treeview again. This is to make sure that when we change or delete a book, list is updated.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Finally config function, as I said before, disables buttons and treeview selection when other dialogs are open.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;FINAL WORDS&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Please notice this is one way of doing things, but it is not the only way. You task is to find your own style and way of thinking how to solve problems with programming. Programming is much more about thinking and less about typing.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here are some things you can do to add more features to this app.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Make statistics button and display top authors by number of books.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Make statistics button and display number of pages you read per year.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Use Mathplot lib to display those data as graphs.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Make function to export data as text file or to email it to someone.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;etc.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can star and fork entire code on &lt;a href=&quot;https://github.com/pdjan/Library-Application&quot; target=&quot;_blank&quot;&gt;Github&lt;/a&gt;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you have any question about the code post comment or contact via &lt;a href=&quot;https://facebook.com/flantureblog&quot; target=&quot;_blank&quot;&gt;Facebook&lt;/a&gt; or &lt;a href=&quot;https://twitter.com/flanture&quot; target=&quot;_blank&quot;&gt;Twitter&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Thank you for reading.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;o_o&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flanture.blogspot.com/feeds/8843431701307720718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://flanture.blogspot.com/2020/06/simple-books-manager-app-using-python-and-tkinter.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/8843431701307720718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/8843431701307720718'/><link rel='alternate' type='text/html' href='http://flanture.blogspot.com/2020/06/simple-books-manager-app-using-python-and-tkinter.html' title='Build simple Books Manager application with Python and Tkinter from scratch'/><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://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0OZNalNLICSNZIEdnFgWUrPJjbgaAkpy-fDxiEoSFIsfJ4pgxyhB7iTYGP1uBGRMYpSCPfWab24WFS7bYc7knYV1QJHpStKlBvgnx0jHjd7MlhrINOu-X7WN7JpMNw36R3HRqQ6R2aL1Y/s72-w400-h269-c/LibraryApp.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932984404072302429.post-8700197633467713353</id><published>2020-06-06T14:01:00.002-07:00</published><updated>2020-09-06T13:54:24.878-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="blog"/><category scheme="http://www.blogger.com/atom/ns#" term="blogger"/><category scheme="http://www.blogger.com/atom/ns#" term="code"/><category scheme="http://www.blogger.com/atom/ns#" term="examples"/><category scheme="http://www.blogger.com/atom/ns#" term="exercise"/><category scheme="http://www.blogger.com/atom/ns#" term="learning"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="workinprogress"/><title type='text'>List of all Python exercises for beginners</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHLzvkNyq3zXolYqGe-yRz-c8SgPaTZj6F7JFZcCdPVa8XC_RVRb9FlvD0Mf-8Bv5QXpfgBAYctq_XRo1x80iZl_u45cIuGin85LUVb-mu-RlftEvptrd_eXB3ySlat_T2yaShYoTGDI6O/s700/PythonExercises.jpg&quot;&gt;&lt;img alt=&quot;Image of laptop computer and notebook&quot; border=&quot;0&quot; data-original-height=&quot;434&quot; data-original-width=&quot;700&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHLzvkNyq3zXolYqGe-yRz-c8SgPaTZj6F7JFZcCdPVa8XC_RVRb9FlvD0Mf-8Bv5QXpfgBAYctq_XRo1x80iZl_u45cIuGin85LUVb-mu-RlftEvptrd_eXB3ySlat_T2yaShYoTGDI6O/d/PythonExercises.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;[to be continued]&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Episode 7 (beginner) : &lt;a href=&quot;https://flanture.blogspot.com/2020/09/python-exercise-sum-values-from-text.html&quot; target=&quot;_blank&quot;&gt;Sum values from text file and print the result&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;font size=&quot;4&quot;&gt;Episode 6 (beginner) : &lt;a href=&quot;http://flanture.blogspot.com/2020/05/python-exercise-print-every-other-line.html&quot; target=&quot;_blank&quot;&gt;Print every other line from text file&lt;/a&gt;&amp;nbsp;&lt;/font&gt;&lt;div&gt;&lt;font size=&quot;4&quot;&gt;&lt;br /&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font size=&quot;4&quot;&gt;Episode 5 (beginner) : &lt;a href=&quot;http://flanture.blogspot.com/2020/05/python-exercise-write-miles-to-km.html&quot; target=&quot;_blank&quot;&gt;Write Miles to Kilometres converter&lt;/a&gt;&amp;nbsp;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font size=&quot;4&quot;&gt;&lt;br /&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font size=&quot;4&quot;&gt;Episode 4 (beginner) : &lt;a href=&quot;http://flanture.blogspot.com/2020/05/python-exercise-find-common-elements.html&quot; target=&quot;_blank&quot;&gt;Find common elements between two lists&lt;/a&gt;&amp;nbsp;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font size=&quot;4&quot;&gt;&lt;br /&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font size=&quot;4&quot;&gt;Episode 3 (intermediate) : &lt;a href=&quot;http://flanture.blogspot.com/2020/04/python-exercise-rolling-dice.html&quot; target=&quot;_blank&quot;&gt;Rolling the dice&lt;/a&gt;&amp;nbsp;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font size=&quot;4&quot;&gt;&lt;br /&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font size=&quot;4&quot;&gt;Episode 2 (beginner) : &lt;a href=&quot;http://flanture.blogspot.com/2020/04/python-exercise-find-number-of-vowels.html&quot; target=&quot;_blank&quot;&gt;Find number of vowels in given string&lt;/a&gt;&amp;nbsp;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font size=&quot;4&quot;&gt;&lt;br /&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font size=&quot;4&quot;&gt;Episode 1 (beginner) : &lt;a href=&quot;http://flanture.blogspot.com/2020/04/python-exercise-find-and-print-max-and.html&quot; target=&quot;_blank&quot;&gt;Find and print max and min elements from list&lt;/a&gt;&amp;nbsp;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;o_o&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://flanture.blogspot.com/feeds/8700197633467713353/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://flanture.blogspot.com/2020/06/list-of-all-python-exercises-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/8700197633467713353'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/8700197633467713353'/><link rel='alternate' type='text/html' href='http://flanture.blogspot.com/2020/06/list-of-all-python-exercises-for.html' title='List of all Python exercises for beginners'/><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://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHLzvkNyq3zXolYqGe-yRz-c8SgPaTZj6F7JFZcCdPVa8XC_RVRb9FlvD0Mf-8Bv5QXpfgBAYctq_XRo1x80iZl_u45cIuGin85LUVb-mu-RlftEvptrd_eXB3ySlat_T2yaShYoTGDI6O/s72-c-d/PythonExercises.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932984404072302429.post-6106029876789174014</id><published>2020-05-18T13:10:00.002-07:00</published><updated>2020-05-18T13:10:51.890-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="code"/><category scheme="http://www.blogger.com/atom/ns#" term="community"/><category scheme="http://www.blogger.com/atom/ns#" term="exercise"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorials"/><title type='text'>Python exercise: Print every other line from a file</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrOgDzHSe6lcpwZaE8Jdg3KmPvP88kutpqQ6i1Z8c7jGOxUNb9MsgKwh1qMuimBZjsc6m1aKwfhZB91uts5mqSwBMEsUqyhQaZJsgHLK3Gw_Fg5fR0bjG5fWhKE56ziu_Cjto3cRng8b0o/s1600/text.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;200&quot; data-original-width=&quot;500&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrOgDzHSe6lcpwZaE8Jdg3KmPvP88kutpqQ6i1Z8c7jGOxUNb9MsgKwh1qMuimBZjsc6m1aKwfhZB91uts5mqSwBMEsUqyhQaZJsgHLK3Gw_Fg5fR0bjG5fWhKE56ziu_Cjto3cRng8b0o/s1600/text.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; color: #888888; font-family: &amp;quot;open sans&amp;quot; , serif; font-size: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #888888; font-family: &amp;quot;open sans&amp;quot; , serif; font-size: 14px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;fb-like&quot; data-action=&quot;like&quot; data-href=&quot;https://www.facebook.com/flantureblog/&quot; data-layout=&quot;button_count&quot; data-share=&quot;false&quot; data-size=&quot;large&quot; data-width=&quot;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #888888; font-family: &amp;quot;open sans&amp;quot; , serif; font-size: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #888888; font-family: &amp;quot;open sans&amp;quot; , serif; font-size: 14px;&quot;&gt;Python exercise&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #888888; font-family: &amp;quot;open sans&amp;quot; , serif; font-size: 14px;&quot;&gt;*************&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background: 0px 0px rgb(207 , 226 , 243); border: 0px; color: #888888; font-family: &amp;quot;open sans&amp;quot; , serif; font-size: 14px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #888888; font-family: &amp;quot;open sans&amp;quot; , serif; font-size: 14px;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;background: 0px 0px rgb(207 , 226 , 243); border: 0px; color: #888888; font-family: &amp;quot;open sans&amp;quot; , serif; font-size: 14px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Episode: 6&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background: 0px 0px rgb(244 , 204 , 204); border: 0px; color: #888888; font-family: &amp;quot;open sans&amp;quot; , serif; font-size: 14px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Level: Beginner&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #888888; font-family: &amp;quot;open sans&amp;quot; , serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px;&quot;&gt;Working with text files in Python is very easy and it does not require any additional library. To open a file for reading you just need to do:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #888888; font-family: &amp;quot;open sans&amp;quot; , serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #888888; font-family: &amp;quot;open sans&amp;quot; , serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px;&quot;&gt;f = open(&quot;somefile.txt&quot;, &quot;w&quot;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #888888; font-family: &amp;quot;open sans&amp;quot; , serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #888888; font-family: &amp;quot;open sans&amp;quot; , serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px;&quot;&gt;and for writing to a file do next:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #888888; font-family: &amp;quot;open sans&amp;quot; , serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #888888; font-family: &amp;quot;open sans&amp;quot; , serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px;&quot;&gt;f.write(&quot;some line&quot;)&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #888888; font-family: &amp;quot;open sans&amp;quot; , serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #888888; font-family: &amp;quot;open sans&amp;quot; , serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px;&quot;&gt;When you are done just close the file with:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #888888; font-family: &amp;quot;open sans&amp;quot; , serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #888888; font-family: &amp;quot;open sans&amp;quot; , serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px;&quot;&gt;f.close()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #888888; font-family: &amp;quot;open sans&amp;quot; , serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;open sans&amp;quot; , serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px;&quot;&gt;Write Python script which prints every other line from a file.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #888888; font-family: &amp;quot;open sans&amp;quot; , serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #888888; font-family: &amp;quot;open sans&amp;quot; , serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px;&quot;&gt;You will need a counter and you will need to check that counter is even or odd number. Here is one of the possible solutions.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #888888; font-family: &amp;quot;open sans&amp;quot; , serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;
with open(&#39;somefile.txt&#39;, &#39;r&#39;) as f:
    counter = 0
    for line in f:
        counter += 1
        if counter % 2 == 0: 
            print(line)
f.close()
&lt;/code&gt;  
&lt;/pre&gt;
&lt;br /&gt;
You can also write separate function to check if counter is odd or even number.
&lt;br /&gt;
&lt;br /&gt;
o_o&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://flanture.blogspot.com/feeds/6106029876789174014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://flanture.blogspot.com/2020/05/python-exercise-print-every-other-line.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/6106029876789174014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/6106029876789174014'/><link rel='alternate' type='text/html' href='http://flanture.blogspot.com/2020/05/python-exercise-print-every-other-line.html' title='Python exercise: Print every other line from a file'/><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://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrOgDzHSe6lcpwZaE8Jdg3KmPvP88kutpqQ6i1Z8c7jGOxUNb9MsgKwh1qMuimBZjsc6m1aKwfhZB91uts5mqSwBMEsUqyhQaZJsgHLK3Gw_Fg5fR0bjG5fWhKE56ziu_Cjto3cRng8b0o/s72-c/text.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932984404072302429.post-7306248135220670253</id><published>2020-05-16T15:16:00.001-07:00</published><updated>2020-05-18T08:14:52.846-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="downloads"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="software"/><category scheme="http://www.blogger.com/atom/ns#" term="tkinter"/><title type='text'>Free Password Manager - Help page</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghX03brCe1Q-m_BYdpi_18sXNy9JMWcdfdrYn71peETGAlFa5hEv7R29qU7DcBCtRRA2zmcYri3wZ0LuX5GgyFwNuSdm4xCCzD48Cc-kNEgSgwTSNC7ytAtKhoXbjGOI7Wj0rshui5h0KI/s1600/Manager.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;350&quot; data-original-width=&quot;800&quot; height=&quot;175&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghX03brCe1Q-m_BYdpi_18sXNy9JMWcdfdrYn71peETGAlFa5hEv7R29qU7DcBCtRRA2zmcYri3wZ0LuX5GgyFwNuSdm4xCCzD48Cc-kNEgSgwTSNC7ytAtKhoXbjGOI7Wj0rshui5h0KI/s400/Manager.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
Free Password Manager&lt;/h4&gt;
&lt;div&gt;
This tiny application is created during Python + Tkinter practice in May 2020 while Covid-19 still ruled the world.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Application is free for personal use only. DO NOT sell it or claim it is yours.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;background-color: #fcfcfc; color: #444444; font-family: &amp;quot;open sans&amp;quot; , sans-serif;&quot;&gt;THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Application does not use any encryption. I&#39;m not responsible for any loss of data or damages.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;h3 style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: #9fc5e8;&quot;&gt;&lt;a href=&quot;https://www.dropbox.com/s/pzpa3ysh77zu52a/manager.zip?dl=0&quot; target=&quot;_blank&quot;&gt;DOWNLOAD&lt;/a&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
Password Manager usage&lt;/h4&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #3d85c6; color: white;&quot;&gt;Generate&lt;/span&gt; button - it creates new random password displayed in entry widget below.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #3d85c6; color: white;&quot;&gt;Use&lt;/span&gt; button - Copies generated password into first available slot of manager in first column. You can use second column to save information about where and how you use this password.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #3d85c6;&quot;&gt;&lt;span style=&quot;color: white;&quot;&gt;Save&lt;/span&gt;&lt;/span&gt; button - saves current password list permanently (using python shelve library).&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #3d85c6;&quot;&gt;&lt;span style=&quot;color: white;&quot;&gt;Refresh&lt;/span&gt;&lt;/span&gt; button - updates password list and removes empty rows if there are any.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #3d85c6;&quot;&gt;&lt;span style=&quot;color: white;&quot;&gt;Export&lt;/span&gt;&lt;/span&gt; button - exports all passwords and info to data.csv file in same directory as program exe file.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #3d85c6;&quot;&gt;&lt;span style=&quot;color: white;&quot;&gt;Del&lt;/span&gt;&lt;/span&gt; button -&amp;nbsp; deletes same row (you should Refresh list after that)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #3d85c6;&quot;&gt;&lt;span style=&quot;color: white;&quot;&gt;Copy&lt;/span&gt;&lt;/span&gt; button - copies only password from the same row, not the info text.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Author button opens default browser to this blog home page.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Help button opens default browser to this page.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
TODO: Master password, proper encryption, unlimited number of slots.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
If you have any suggestions on how to improve this application let me know in the comments.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Thank you.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;https://feedburner.google.com/fb/a/mailverify?uri=flanture2&amp;amp;loc=en_US&quot;&gt;Subscribe&lt;/a&gt; to receive updates via email, leave comment below and I&#39;ll send you download link.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://flanture.blogspot.com/feeds/7306248135220670253/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://flanture.blogspot.com/2020/05/free-password-manager-help-page.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/7306248135220670253'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/7306248135220670253'/><link rel='alternate' type='text/html' href='http://flanture.blogspot.com/2020/05/free-password-manager-help-page.html' title='Free Password Manager - Help page'/><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://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghX03brCe1Q-m_BYdpi_18sXNy9JMWcdfdrYn71peETGAlFa5hEv7R29qU7DcBCtRRA2zmcYri3wZ0LuX5GgyFwNuSdm4xCCzD48Cc-kNEgSgwTSNC7ytAtKhoXbjGOI7Wj0rshui5h0KI/s72-c/Manager.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932984404072302429.post-6678439556899391671</id><published>2020-05-12T04:41:00.000-07:00</published><updated>2020-05-15T01:40:45.781-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="code"/><category scheme="http://www.blogger.com/atom/ns#" term="exercise"/><category scheme="http://www.blogger.com/atom/ns#" term="open source"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorials"/><title type='text'>Python exercise: Write Miles to Km Converter </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;fb-like&quot; data-href=&quot;https://www.facebook.com/flantureblog/&quot; data-width=&quot;&quot; data-layout=&quot;button_count&quot; data-action=&quot;like&quot; data-size=&quot;large&quot; data-share=&quot;false&quot;&gt;&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
Python exercise&lt;br /&gt;
*************&lt;br /&gt;
&lt;span style=&quot;background-color: #cfe2f3;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #cfe2f3;&quot;&gt;Episode: 5&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f4cccc;&quot;&gt;Level: Beginner&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Single Mile is approximately 1.609 Kilometres. Write Python function which gets input from user and converters given Miles to Km. You should also check if number is greater than zero. If not, ask user for another input. If number is positive display it in Km.&lt;br /&gt;
&lt;br /&gt;
If string is entered function is called again to display input once more.&lt;br /&gt;
&lt;br /&gt;
If negative value is entered function is called again.&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; def converter():  
   &#39;&#39;&#39; Write function which converts Miles to Km &#39;&#39;&#39;  
   print(&quot;Enter number in Miles: &quot;)  
   a = input()  
   try:  
     a = float(a)  
     if a &amp;gt; 0:  
       print(str(a * 1.609) + &quot; Km.&quot;)  
     else:  
       converter()  
   except:  
     converter()&lt;/code&gt;  &lt;/pre&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; converter()  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
How would create tkinter UI for converter? This will be next post subject.&lt;br /&gt;
&lt;br /&gt;
o_o&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://flanture.blogspot.com/feeds/6678439556899391671/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://flanture.blogspot.com/2020/05/python-exercise-write-miles-to-km.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/6678439556899391671'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/6678439556899391671'/><link rel='alternate' type='text/html' href='http://flanture.blogspot.com/2020/05/python-exercise-write-miles-to-km.html' title='Python exercise: Write Miles to Km Converter '/><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><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932984404072302429.post-6792653593022023140</id><published>2020-05-02T13:58:00.000-07:00</published><updated>2020-05-15T01:41:50.361-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="examples"/><category scheme="http://www.blogger.com/atom/ns#" term="exercise"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorials"/><title type='text'>Python exercise : Find common elements between two lists</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;fb-like&quot; data-href=&quot;https://www.facebook.com/flantureblog/&quot; data-width=&quot;&quot; data-layout=&quot;button_count&quot; data-action=&quot;like&quot; data-size=&quot;large&quot; data-share=&quot;false&quot;&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5JmzLOdcnBPOM_C_sd0a_0TB4xZSpr6cUtyQ_oIve1Gr7KkyyIKnevxfwQ-R4Ld8biQ8KwatzaYdrbOePLKpGGryKCs4y6ODbTrsfaP5yxGPbC3QWMNYUaW6MZ1J5ytX7A5gUxB6otdwh/s1600/pythonexercise4.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;250&quot; data-original-width=&quot;541&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5JmzLOdcnBPOM_C_sd0a_0TB4xZSpr6cUtyQ_oIve1Gr7KkyyIKnevxfwQ-R4Ld8biQ8KwatzaYdrbOePLKpGGryKCs4y6ODbTrsfaP5yxGPbC3QWMNYUaW6MZ1J5ytX7A5gUxB6otdwh/s1600/pythonexercise4.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
Python exercise&lt;/h4&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #cfe2f3;&quot;&gt;Episode: 4&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cfe2f3;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #f4cccc;&quot;&gt;Level: Beginner&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
In this episode we will write function in Python 3 which finds and prints common elements between two lists.&lt;br /&gt;
&lt;br /&gt;
Let&#39;s say we have two lists:&lt;br /&gt;
&lt;br /&gt;
A = [2, 73, &quot;Flanture&quot;, 5, &quot;blog&quot;]&lt;br /&gt;
&lt;br /&gt;
B = [&quot;Blog&quot;, 2, 44, &quot;Flanture&quot;, 72]&lt;br /&gt;
&lt;br /&gt;
Write function intersection with two arguments and return list with common elements as a result.&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; 
def intersection(a, b):  
   common = []  

   for el in a:  
     if el in b:  
       common.append(el)  
   return common  


A = [2, 73, &quot;Flanture&quot;, 5, &quot;blog&quot;]  
B = [&quot;Blog&quot;, 2, 44, &quot;Flanture&quot;, 72]  

result = intersection(A, B)  

print(result)  

# output : [2, &#39;Flanture&#39;]  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
Shorter version uses list comprehensions:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; 
def intersection(a, b):  
   return [el for el in a if el in b]  

A = [2, 73, &quot;Flanture&quot;, 5, &quot;blog&quot;]  
B = [&quot;Blog&quot;, 2, 44, &quot;Flanture&quot;, 72]  

print(intersection(A, B))  

# output : [2, &#39;Flanture&#39;]  

&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Which version do you prefer?&lt;br /&gt;
&lt;br /&gt;
P.S. Why string &quot;blog&quot; is not common element of lists A and B?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://flanture.blogspot.com/feeds/6792653593022023140/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://flanture.blogspot.com/2020/05/python-exercise-find-common-elements.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/6792653593022023140'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/6792653593022023140'/><link rel='alternate' type='text/html' href='http://flanture.blogspot.com/2020/05/python-exercise-find-common-elements.html' title='Python exercise : Find common elements between two lists'/><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://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5JmzLOdcnBPOM_C_sd0a_0TB4xZSpr6cUtyQ_oIve1Gr7KkyyIKnevxfwQ-R4Ld8biQ8KwatzaYdrbOePLKpGGryKCs4y6ODbTrsfaP5yxGPbC3QWMNYUaW6MZ1J5ytX7A5gUxB6otdwh/s72-c/pythonexercise4.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932984404072302429.post-8168731868178253089</id><published>2020-04-28T13:47:00.000-07:00</published><updated>2020-05-15T01:42:12.149-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="examples"/><category scheme="http://www.blogger.com/atom/ns#" term="exercise"/><category scheme="http://www.blogger.com/atom/ns#" term="math"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorials"/><title type='text'>Python Exercise : Rolling The Dice</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;fb-like&quot; data-href=&quot;https://www.facebook.com/flantureblog/&quot; data-width=&quot;&quot; data-layout=&quot;button_count&quot; data-action=&quot;like&quot; data-size=&quot;large&quot; data-share=&quot;false&quot;&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFF60ohs3swiN1BBKN-zh5QxvaZ0wb69Wb5rpm3_yae__9wfvrXukHWDpUr2Z29IDhXcBJQXHtFaURtvgyB_X-bQWXmIP8z8seCOm24rvAlyNFvJ7aqMe8aA9b1gAUhEJC60TOupzulvRG/s1600/pythonexercise.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;250&quot; data-original-width=&quot;600&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFF60ohs3swiN1BBKN-zh5QxvaZ0wb69Wb5rpm3_yae__9wfvrXukHWDpUr2Z29IDhXcBJQXHtFaURtvgyB_X-bQWXmIP8z8seCOm24rvAlyNFvJ7aqMe8aA9b1gAUhEJC60TOupzulvRG/s1600/pythonexercise.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
Python exercise&lt;/h4&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #cfe2f3;&quot;&gt;Episode: 3&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f4cccc;&quot;&gt;Level: Intermediate&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What do you think how many times you have to roll the dice to get each number (1 - 6) at least two times? How about 3 times or more? Write a Python program to find out.&lt;br /&gt;
&lt;br /&gt;
First we have to import random library. We are interested in randint(a, b) method since our dice can produce numbers from 1 to 6.&lt;br /&gt;
&lt;br /&gt;
We need two functions, game function and tests function. Finally we need to call tests function to get the results.&lt;br /&gt;
&lt;br /&gt;
Inside game function we need 2 variables, one list of same six numbers and counter. The idea is to have list like this L = [2, 2, 2, 2, 2, 2]. When we roll the dice and let&#39;s say get number 5, we will subtract 1 from fifth element in the list, so our list will look like this L = [2, 2, 2, 2, 1, 2]. We add 1 to counter.&lt;br /&gt;
&lt;br /&gt;
When sum of list elements is zero, this means we got all numbers at least twice. Print counter and you are done.&lt;br /&gt;
&lt;br /&gt;
Tests function will have two parameters. One to choose how many times we want every number to appear and second parameter is number of cycles. More cycles means better average number and precise result. &lt;b&gt;&lt;u&gt;Please be aware&lt;/u&gt;&lt;/b&gt; if your computer can handle large numbers. Start small and than increase.&lt;br /&gt;
&lt;br /&gt;
OK, now let&#39;s see the code.&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; import random  
 def game(rep):  
   l = [rep for i in range(6)]  
   counter = 0   
   def roll():  
     return random.randint(1, 6)  
   def check_list(lst):  
     return sum(lst) == 0  
   while(not check_list(l) ):  
     n = roll()  
     if l[n - 1] &amp;gt; 0:  
       l[n - 1] -= 1  
     counter += 1  
   return counter  
 def tests(g, times):  
   result = [game(g) for j in range(times)]  
   average = str(sum(result) / times)  
   print(&quot;Average number of rolls is: &quot; + average)  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
Here are my results:&lt;br /&gt;
&lt;br /&gt;
tests(1, 100000) &amp;gt; 14,7&lt;br /&gt;
&lt;br /&gt;
This means if you want to get all numbers from 1 to 6, you have to roll the dice on average 14,7 times! This is very precise number since I&#39;ve done 100.000 tests here.&lt;br /&gt;
&lt;br /&gt;
If you want to get all numbers at least twice you need to roll the dice on average 24,1 times.&lt;br /&gt;
&lt;br /&gt;
tests(2, 100000) &amp;gt; 24,1&lt;br /&gt;
&lt;br /&gt;
tests(3, 100000) &amp;gt; 32,6&lt;br /&gt;
tests(4, 100000) &amp;gt; 40,7&lt;br /&gt;
tests(5, 100000) &amp;gt; 48,6&lt;br /&gt;
tests(6, 100000) &amp;gt; 56,2&lt;br /&gt;
&lt;br /&gt;
As you can see there are 8 more rolls for every next level after 2.&lt;br /&gt;
&lt;br /&gt;
Now you know it.&lt;br /&gt;
&lt;br /&gt;
Thanks for your time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://flanture.blogspot.com/feeds/8168731868178253089/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://flanture.blogspot.com/2020/04/python-exercise-rolling-dice.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/8168731868178253089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/8168731868178253089'/><link rel='alternate' type='text/html' href='http://flanture.blogspot.com/2020/04/python-exercise-rolling-dice.html' title='Python Exercise : Rolling The Dice'/><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://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFF60ohs3swiN1BBKN-zh5QxvaZ0wb69Wb5rpm3_yae__9wfvrXukHWDpUr2Z29IDhXcBJQXHtFaURtvgyB_X-bQWXmIP8z8seCOm24rvAlyNFvJ7aqMe8aA9b1gAUhEJC60TOupzulvRG/s72-c/pythonexercise.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932984404072302429.post-330688316543765458</id><published>2020-04-26T03:56:00.000-07:00</published><updated>2020-05-15T01:42:25.901-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="code"/><category scheme="http://www.blogger.com/atom/ns#" term="exercise"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorials"/><title type='text'>Python exercise : Find number of vowels in given string</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;fb-like&quot; data-href=&quot;https://www.facebook.com/flantureblog/&quot; data-width=&quot;&quot; data-layout=&quot;button_count&quot; data-action=&quot;like&quot; data-size=&quot;large&quot; data-share=&quot;false&quot;&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHAcmGSpAuyQQraX5eQt-97b4FBJ7IAegThJbSsz16pMQp5nS4A-xu94C0L1V1CLQHLHoUjkYpKP226_Yu_bbGt-avCBMvUSKkmaM2GOkTp5RkGBHC9-4cpAUThhKmN4b3iq2r_x6XjUAC/s1600/vowels.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;296&quot; data-original-width=&quot;594&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHAcmGSpAuyQQraX5eQt-97b4FBJ7IAegThJbSsz16pMQp5nS4A-xu94C0L1V1CLQHLHoUjkYpKP226_Yu_bbGt-avCBMvUSKkmaM2GOkTp5RkGBHC9-4cpAUThhKmN4b3iq2r_x6XjUAC/s1600/vowels.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;Python exercise&lt;/b&gt;&lt;/h4&gt;
**************&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #cfe2f3;&quot;&gt;Episode: 2&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f4cccc;&quot;&gt;Level: Beginner&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
If you have any given string like S=&quot;Hello World&quot; write Python 3 function which returns number of vowels in that string.&lt;br /&gt;
&lt;br /&gt;
S=&quot;Hello World&quot;&lt;br /&gt;
Vowels are a, e, i, u, o&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #1c1e21; font-family: &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 14px;&quot;&gt;function totalVowels(str):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #1c1e21; font-family: &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp; # your code here&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #1c1e21; font-family: &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #1c1e21; font-family: &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 14px;&quot;&gt;Please comment your answer.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #1c1e21; font-family: &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #1c1e21; font-family: &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
You can also, instead of using predefined string, let user type any string. How would you do that?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;details&gt;
    &lt;summary&gt;Expand solution&lt;/summary&gt;
&lt;br /&gt;&lt;br /&gt;First solution is to use for loop.&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;padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; L = [&quot;a&quot;,&quot;e&quot;,&quot;i&quot;,&quot;o&quot;,&quot;u&quot;]  
 s = &quot;Hello World&quot;  
 s = s.lower()  
 counter = 0  
 for i in range(len(s)):  
   if s[i] in L:  
     counter += 1  
 print(&quot;Your string has &quot;+ str(counter)+&quot; vowels.&quot;)  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;&lt;br /&gt;
A bit more elegant solution which executes faster is to use list comprehensions.&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;padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; def totalVowels(str):  
   vowels=[&#39;a&#39;,&#39;e&#39;,&#39;i&#39;,&#39;o&#39;,&#39;u&#39;]  
   counter=[l for l in str.lower() if l in vowels]  
   return len(counter)  
 print(&quot;Your string has &quot; + str(totalVowels(&quot;Hello World&quot;)) + &quot; vowels.&quot;)  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;/details&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thank you.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://flanture.blogspot.com/feeds/330688316543765458/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://flanture.blogspot.com/2020/04/python-exercise-find-number-of-vowels.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/330688316543765458'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/330688316543765458'/><link rel='alternate' type='text/html' href='http://flanture.blogspot.com/2020/04/python-exercise-find-number-of-vowels.html' title='Python exercise : Find number of vowels in given string'/><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://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHAcmGSpAuyQQraX5eQt-97b4FBJ7IAegThJbSsz16pMQp5nS4A-xu94C0L1V1CLQHLHoUjkYpKP226_Yu_bbGt-avCBMvUSKkmaM2GOkTp5RkGBHC9-4cpAUThhKmN4b3iq2r_x6XjUAC/s72-c/vowels.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932984404072302429.post-7769968425314543512</id><published>2020-04-25T03:38:00.000-07:00</published><updated>2020-05-15T01:42:37.328-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="code"/><category scheme="http://www.blogger.com/atom/ns#" term="examples"/><category scheme="http://www.blogger.com/atom/ns#" term="exercise"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorials"/><title type='text'>Python exercise : Find and print max and min elements from given list </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;fb-like&quot; data-href=&quot;https://www.facebook.com/flantureblog/&quot; data-width=&quot;&quot; data-layout=&quot;button_count&quot; data-action=&quot;like&quot; data-size=&quot;large&quot; data-share=&quot;false&quot;&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Python exercise&amp;nbsp;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #cfe2f3; font-family: inherit;&quot;&gt;Episode: 1&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f4cccc; font-family: inherit;&quot;&gt;Level: Beginner&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: white; color: #1c1e21; margin-bottom: 6px;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Find and print max and min elements from list L=[56, 12, 78, 14, 44, 85, 9] without using max() and min() functions. Use python 3 print command.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #1c1e21; margin-bottom: 6px;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #1c1e21; margin-bottom: 6px; margin-top: 6px;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;One obvious way to find min and max elements from any given list of integers is to use built in Python functions max() and min().&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #1c1e21; font-family: Helvetica, Arial, sans-serif; font-size: 14px; margin-bottom: 6px; margin-top: 6px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; L=[56, 12, 78, 14, 44, 85, 9]  
 print(max(L))  
 print(min(L))  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
This gives 85 and 9.&lt;br /&gt;
&lt;br /&gt;
But how can you solve this problem without using those functions?&lt;br /&gt;
&lt;br /&gt;
Comment your solution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;details&gt;
&lt;summary&gt;Expand solution&lt;/summary&gt;
&lt;br /&gt;&lt;br /&gt;
You can simply sort the list and print first element to get min. To get max you reverse the list and again print the first element.
&lt;br /&gt;&lt;br /&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; # print min value  
 L.sort()  
 print(L[0])  
 # print max value  
 L.reverse()  
 print(L[0])  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;

&lt;/details&gt;
&lt;br /&gt;
&lt;br /&gt;
I hope this exercise is useful for you if you are just starting with learning Python. Please share this post and come back again for many more exercises. If you have any questions feel free to ask.&lt;br /&gt;
&lt;br /&gt;
Thank you.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://flanture.blogspot.com/feeds/7769968425314543512/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://flanture.blogspot.com/2020/04/python-exercise-find-and-print-max-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/7769968425314543512'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/7769968425314543512'/><link rel='alternate' type='text/html' href='http://flanture.blogspot.com/2020/04/python-exercise-find-and-print-max-and.html' title='Python exercise : Find and print max and min elements from given list '/><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><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932984404072302429.post-7477178823183107690</id><published>2020-03-22T04:32:00.000-07:00</published><updated>2020-05-15T01:42:48.597-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="code"/><category scheme="http://www.blogger.com/atom/ns#" term="examples"/><category scheme="http://www.blogger.com/atom/ns#" term="open source"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorials"/><category scheme="http://www.blogger.com/atom/ns#" term="web development"/><title type='text'>Using Python Lists - Tutorial with Examples</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;fb-like&quot; data-href=&quot;https://www.facebook.com/flantureblog/&quot; data-width=&quot;&quot; data-layout=&quot;button_count&quot; data-action=&quot;like&quot; data-size=&quot;large&quot; data-share=&quot;false&quot;&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhl-rjzC-VilmIgcn3ZLJC1W9AHjNm3sjxVk_USdk6XMSv3_p3SojMZjz6grJh9Zv5-el4Hrwd6VnY8mUKkAXqxARgvskMBAzPy_WACKlYsNZBDPgUpYEF-B01orz-Md-584HkOVTW5Dis_/s1600/UsingPythonLists.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;345&quot; data-original-width=&quot;500&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhl-rjzC-VilmIgcn3ZLJC1W9AHjNm3sjxVk_USdk6XMSv3_p3SojMZjz6grJh9Zv5-el4Hrwd6VnY8mUKkAXqxARgvskMBAzPy_WACKlYsNZBDPgUpYEF-B01orz-Md-584HkOVTW5Dis_/s1600/UsingPythonLists.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;/h4&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
Python lists basics&lt;/h4&gt;
List in Python is a sequence of elements.&lt;br /&gt;
&lt;br /&gt;
List elements, or items, are written between square brackets. They are separated by comma.&lt;br /&gt;
&lt;br /&gt;
Python List elements does not have to be of the same type.&lt;br /&gt;
&lt;br /&gt;
It is perfectly OK to have lists like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; L = [7.9, &quot;Hi&quot;, True, 2]  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
Let&#39;s quick check what type are list L elements using type() function like this:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; for i in L:  
   print(type(i))  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Result is:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; &amp;lt;class &#39;float&#39;&amp;gt;  
 &amp;lt;class &#39;int&#39;&amp;gt;  
 &amp;lt;class &#39;bool&#39;&amp;gt;  
 &amp;lt;class &#39;str&#39;&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
As you can see you can have float, integer, boolean and string, all in one list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python list elements have position or index which is a number greater or equal to zero.&lt;br /&gt;
&lt;br /&gt;
List L element 7.9 has index 0 (zero). Element &quot;Hi&quot; has index 1. Element True has index 2. Element 2 has index 3.&lt;br /&gt;
&lt;br /&gt;
If you want to print elements of the list along with their type add next line inside for loop:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; print(i)  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
The result is:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; &amp;lt;class &#39;float&#39;&amp;gt;  
 7.9  
 &amp;lt;class &#39;str&#39;&amp;gt;  
 Hi  
 &amp;lt;class &#39;bool&#39;&amp;gt;  
 True  
 &amp;lt;class &#39;int&#39;&amp;gt;  
 2  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
Function len()&lt;/h4&gt;
&lt;br /&gt;
Function len() is used when you want to find out how many elements list holds.&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; print(&quot;List L has &quot;+str(len(t))+&quot; elements&quot;)  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Run this script and you will get message:&amp;nbsp;List L has 4 elements.&lt;br /&gt;
&lt;br /&gt;
We are using string concatenation within print command and str() function converts integer into string.&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
Python Lists Slicing&lt;/h4&gt;
&lt;br /&gt;
Slicing [start:end] means everything between start and end, including start but not end.&lt;br /&gt;
When start is omitted it means from beginning of list. When end is omitted it means until end of list.&lt;br /&gt;
&lt;br /&gt;
lst = [2, 14, 89, 33, 7, 43]&lt;br /&gt;
&lt;br /&gt;
print(&quot;lst = [2, 14, 89, 33, 7, 43]&quot;)&lt;br /&gt;
&lt;br /&gt;
print(lst[:]) -&amp;gt; [2, 14, 89, 33, 7, 43]&lt;br /&gt;
print(lst[3:]) -&amp;gt; [33, 7, 43]&lt;br /&gt;
print(lst[:4]) -&amp;gt; [2, 14, 89, 33]&lt;br /&gt;
print(lst[3:5]) -&amp;gt; [33, 7]&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
Python min and max functions&lt;/h4&gt;
&lt;br /&gt;
Find maximum and minimum numbers from list 66, 72, 12, 90, 43.&lt;br /&gt;
&lt;br /&gt;
While this is very easy task for humans, you can tell the result right away, there are situations where you need to write a program to find the solution. Let&#39;s say numbers are not predefined but entered by user or returned from some function or calculation or you have very large collection of numbers, you will not spend 2 hours to look for min and max, right?&lt;br /&gt;
&lt;br /&gt;
If you have your numbers in a list, finding min and max is straightforward:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; L = [66, 72, 12, 90, 43]  
 print(max(L))  
 print(min(L))  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
If you know that sort() function sorts any list in ascending order and reverse() function reverses the list in place, how would you find largest and smallest element of the list without using max and min functions?
&lt;br /&gt;
&lt;br /&gt;
Very easy:&lt;br /&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; L = [66, 72, 12, 90, 43]  
 L.sort()  
 print(L[0])  
 L.reverse()  
 print(L[0])  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
- TO BE CONTINUED -&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://flanture.blogspot.com/feeds/7477178823183107690/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://flanture.blogspot.com/2020/03/using-python-lists-tutorial-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/7477178823183107690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/7477178823183107690'/><link rel='alternate' type='text/html' href='http://flanture.blogspot.com/2020/03/using-python-lists-tutorial-with.html' title='Using Python Lists - Tutorial with Examples'/><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://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhl-rjzC-VilmIgcn3ZLJC1W9AHjNm3sjxVk_USdk6XMSv3_p3SojMZjz6grJh9Zv5-el4Hrwd6VnY8mUKkAXqxARgvskMBAzPy_WACKlYsNZBDPgUpYEF-B01orz-Md-584HkOVTW5Dis_/s72-c/UsingPythonLists.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932984404072302429.post-4064677855219530723</id><published>2020-03-09T14:46:00.000-07:00</published><updated>2020-03-09T14:46:05.960-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="actionscript"/><category scheme="http://www.blogger.com/atom/ns#" term="animations"/><category scheme="http://www.blogger.com/atom/ns#" term="AS3.0"/><category scheme="http://www.blogger.com/atom/ns#" term="books"/><category scheme="http://www.blogger.com/atom/ns#" term="code"/><category scheme="http://www.blogger.com/atom/ns#" term="CSS3"/><category scheme="http://www.blogger.com/atom/ns#" term="data structures"/><category scheme="http://www.blogger.com/atom/ns#" term="downloads"/><category scheme="http://www.blogger.com/atom/ns#" term="examples"/><category scheme="http://www.blogger.com/atom/ns#" term="flash"/><category scheme="http://www.blogger.com/atom/ns#" term="flex"/><category scheme="http://www.blogger.com/atom/ns#" term="flex examples"/><category scheme="http://www.blogger.com/atom/ns#" term="free ebooks"/><category scheme="http://www.blogger.com/atom/ns#" term="gamedev"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML5"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="learning"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><title type='text'>Free ebook - Programming and Animation Tutorials</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Back in 2010 I published an ebook.&lt;br /&gt;
&lt;br /&gt;
It was 102 pages collection of 40+ tutorials from this blog. Mostly stuff like ActionScript coding and Flash animations. I didn&#39;t edit any of the tutorials, I just copied and paste the tutorials in Microsoft Word and converted to PDF.&lt;br /&gt;
&lt;br /&gt;
I&#39;ve made simple cover and decided to do some self-publishing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUukubr3H7xV3WSWly5sEYM8U-7POsnr0bjeXcv7yWVObeOHQau4S8Z1ZW99Bu9cbkTW7-6AoRflHZ0-pOPeaIgJp89hufwCdQbW4rckwSAthkQoSIH0KAAK9-ISCqBPnjujPM2BINx3ow/s1600/coversm.jpg&quot; imageanchor=&quot;1&quot;&gt;&lt;img alt=&quot;free tutorials book cover&quot; border=&quot;0&quot; data-original-height=&quot;655&quot; data-original-width=&quot;501&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUukubr3H7xV3WSWly5sEYM8U-7POsnr0bjeXcv7yWVObeOHQau4S8Z1ZW99Bu9cbkTW7-6AoRflHZ0-pOPeaIgJp89hufwCdQbW4rckwSAthkQoSIH0KAAK9-ISCqBPnjujPM2BINx3ow/s320/coversm.jpg&quot; width=&quot;244&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
I managed to sell around 150 copies of it. Not much, but effort was paid.&lt;br /&gt;
&lt;br /&gt;
Posting it here for free just for &lt;i&gt;historical&lt;/i&gt; reasons.&lt;br /&gt;
&lt;br /&gt;
Even though Flash is long time dead some code can be easily converted to JavaScript, which I already did with some of the tutorials. You can find them in &lt;a href=&quot;https://flanture.blogspot.com/search/label/javascript?&amp;amp;max-results=9&quot; target=&quot;_blank&quot;&gt;JavaScript section&lt;/a&gt; of the blog.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3 style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;List of all tutorials&lt;/b&gt;&lt;/h3&gt;
&lt;br /&gt;
1. AS3 Random Star Field Animation&lt;br /&gt;
&lt;br /&gt;
2. How to split ActionScript Array in two or more&lt;br /&gt;
&lt;br /&gt;
3. Flash Tutorial : How to create vertigo animation&lt;br /&gt;
&lt;br /&gt;
4. Simple AS3 Data Structure - part II&lt;br /&gt;
&lt;br /&gt;
5. Simple AS3 Data Structure&lt;br /&gt;
&lt;br /&gt;
6. Using BitmapSplit function with Tweener&lt;br /&gt;
&lt;br /&gt;
7. How to start with PaperVision3D&lt;br /&gt;
&lt;br /&gt;
8. AS3: Dynamic Bitmap Split Function&lt;br /&gt;
&lt;br /&gt;
9. Running Flex 4 SDK and FlashDevelop&lt;br /&gt;
&lt;br /&gt;
10. Energy Bar Flash Game AS3 Tutorial&lt;br /&gt;
&lt;br /&gt;
11. Using Deco Tool in Flash CS4 (Vine Fill)&lt;br /&gt;
&lt;br /&gt;
12. Improved Spiderweb AS3.0 Class&lt;br /&gt;
&lt;br /&gt;
13. Coding spiderwebs in ActionScript3.0&lt;br /&gt;
&lt;br /&gt;
14. Pyramids using AS3 drawing API&lt;br /&gt;
&lt;br /&gt;
15. ActionScript3.0 Triangle Class&lt;br /&gt;
&lt;br /&gt;
16. Understanding shearing using Matrix object&lt;br /&gt;
&lt;br /&gt;
17. HowTo create Flash video captions using Subtitle Workshop&lt;br /&gt;
&lt;br /&gt;
18. AS3.0 preloader part II : adding transparency&lt;br /&gt;
&lt;br /&gt;
19. AS3.0 Flash Preloader With Moving TextField&lt;br /&gt;
&lt;br /&gt;
20. Level Timer code explained&lt;br /&gt;
&lt;br /&gt;
21. How To Create Flash Game Level Timer&lt;br /&gt;
&lt;br /&gt;
22. Curves and Fills with AS3 Drawing API&lt;br /&gt;
&lt;br /&gt;
23. Flash AS3 Star System Simulation Tutorial&lt;br /&gt;
&lt;br /&gt;
24. AS3 Loading Animation Tutorial&lt;br /&gt;
&lt;br /&gt;
25. AS3 Drawing API examples&lt;br /&gt;
&lt;br /&gt;
26. ActionScript Random Number Generator With Blur Effect&lt;br /&gt;
&lt;br /&gt;
27. Manipulating Shapes Using Bone Tool in Flash CS4&lt;br /&gt;
&lt;br /&gt;
28. Create Flash Banner Using FuseKit Simple Tutorial&lt;br /&gt;
&lt;br /&gt;
29. Using ActionScript Point class distance method for constant speed&lt;br /&gt;
moving in roadMap function&lt;br /&gt;
&lt;br /&gt;
30. Maui Flash Zoom Tool&lt;br /&gt;
&lt;br /&gt;
31. Flash Pixel Explosion Tutorial&lt;br /&gt;
&lt;br /&gt;
32. It&#39;s never to late (shuffle AS function + more)&lt;br /&gt;
&lt;br /&gt;
33. Free FLV to WMV Conversion&lt;br /&gt;
&lt;br /&gt;
34. Object Movement Functions&lt;br /&gt;
&lt;br /&gt;
35. Tiled Flash Backgrounds Tutorial PART II&lt;br /&gt;
&lt;br /&gt;
36. Tiled Flash Backgrounds Tutorial PART I&lt;br /&gt;
&lt;br /&gt;
37. Making Zoom Tool with Masking in Flash&lt;br /&gt;
&lt;br /&gt;
38. Flash Tutorial : Rain Effect&lt;br /&gt;
&lt;br /&gt;
39. Flash Scale Menu Explained&lt;br /&gt;
&lt;br /&gt;
40. Simple Flex Effects Example&lt;br /&gt;
&lt;br /&gt;
41. Math2 ActionScript functions&lt;br /&gt;
&lt;br /&gt;
42. Custom Gradients Flash Tutorial&lt;br /&gt;
&lt;br /&gt;
43. Code for scale menu&lt;br /&gt;
&lt;br /&gt;
44. Simple Event Mechanism Flash Tutorial&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;iframe height=&quot;480&quot; src=&quot;https://drive.google.com/file/d/1xRbn8an28JKcCisADKQxsAFe15ua6Hp8/preview&quot; width=&quot;640&quot;&gt;&lt;/iframe&gt;

&lt;br /&gt;
&lt;br /&gt;
Please SHARE it if you find it interesting! Thank you.
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://flanture.blogspot.com/feeds/4064677855219530723/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://flanture.blogspot.com/2020/03/free-ebook-programming-and-animation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/4064677855219530723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/4064677855219530723'/><link rel='alternate' type='text/html' href='http://flanture.blogspot.com/2020/03/free-ebook-programming-and-animation.html' title='Free ebook - Programming and Animation Tutorials'/><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://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUukubr3H7xV3WSWly5sEYM8U-7POsnr0bjeXcv7yWVObeOHQau4S8Z1ZW99Bu9cbkTW7-6AoRflHZ0-pOPeaIgJp89hufwCdQbW4rckwSAthkQoSIH0KAAK9-ISCqBPnjujPM2BINx3ow/s72-c/coversm.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932984404072302429.post-3893432359901863511</id><published>2020-03-01T12:47:00.000-08:00</published><updated>2020-05-15T01:43:00.806-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="community"/><category scheme="http://www.blogger.com/atom/ns#" term="polls"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="software"/><category scheme="http://www.blogger.com/atom/ns#" term="web development"/><title type='text'>8 Most Used Python IDEs or Editors by Developers</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;fb-like&quot; data-href=&quot;https://www.facebook.com/flantureblog/&quot; data-width=&quot;&quot; data-layout=&quot;button_count&quot; data-action=&quot;like&quot; data-size=&quot;large&quot; data-share=&quot;false&quot;&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvSdDkCSvpW-gl7b328nNcHdgMMzI9l_XTA5iiOtFkowai-FQS-YXmwbY2gwDpDzDJTIkDYCuIOGkk1MiS6cOsa_1wD17rNVTtVK5DrtrZxiNaafV9Df3_rw4LV11v3l6ZX7PHLdQ9ycl0/s1600/pythoncoder.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;467&quot; data-original-width=&quot;700&quot; height=&quot;425&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvSdDkCSvpW-gl7b328nNcHdgMMzI9l_XTA5iiOtFkowai-FQS-YXmwbY2gwDpDzDJTIkDYCuIOGkk1MiS6cOsa_1wD17rNVTtVK5DrtrZxiNaafV9Df3_rw4LV11v3l6ZX7PHLdQ9ycl0/s640/pythoncoder.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
What is your favorite Python IDE/Editor?&amp;nbsp;&lt;/h4&gt;
&lt;br /&gt;
This question is particularly important among programming beginners. Very often they wanna know what editor is used among senior developers, so they can choose the right tools for their struggle ahead.&lt;br /&gt;
&lt;br /&gt;
Maybe it is about saving some time in learning only one specific IDE.&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
Options for Python programming environment are many.&lt;br /&gt;
&lt;br /&gt;
There are advanced IDEs with introspection based code and integrated debugger like Thonny, NetBeans, PyCharm, PyStudio, Exedore for Mac OS X and others.&lt;br /&gt;
&lt;br /&gt;
There are IDEs like Komodo, Aptana Studio 3, Pcode, eric with introspection based code or integrated debugger and some of them are open source, some commercial.&lt;br /&gt;
&lt;br /&gt;
There are also IDEs with integrated GUI builder like BoaConstructor, Visual Python or MonkeyStudio.&lt;br /&gt;
&lt;br /&gt;
Even more options are available when we talk about Python Editors. There are many multiplatform editors but also platform specific like Beaver for Unix or Notepad++ for Windows or Coda and XCode for Mac.&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
Most used Python IDE or Editor in 2020&lt;/h4&gt;
&lt;br /&gt;
Here are results for most used Python IDE or Editor by developers so far in 2020 according to poll conducted in one of the largest FB Python Developers community.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-FGhpBk88aZhADQIqWDyjlN-mY1-q-VG9bqwt_VEeUXiYvx5eeJbuza3u9D5C-PnBE0IcUh9ikAxJxtxc2vh6xgqKwh6nm5ACltSOMvybWntzUbGEFntSEfAonikkR5sCmHw6dOct50Oz/s1600/PythonEditor.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;328&quot; data-original-width=&quot;550&quot; height=&quot;376&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-FGhpBk88aZhADQIqWDyjlN-mY1-q-VG9bqwt_VEeUXiYvx5eeJbuza3u9D5C-PnBE0IcUh9ikAxJxtxc2vh6xgqKwh6nm5ACltSOMvybWntzUbGEFntSEfAonikkR5sCmHw6dOct50Oz/s640/PythonEditor.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see from this graph, clear winners are Visual Studio Code and PyCharm. Both of these tools are used by one third of all Python developers.&lt;br /&gt;
&lt;br /&gt;
VS Code is used just slightly more than PyCharm 35% against 31%.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://code.visualstudio.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;354&quot; data-original-width=&quot;700&quot; height=&quot;321&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1PdTph97DBX5x35OgbNiCU0M74r2_gtqBliXYUoGnmNwX9zSWCV5EX38zu7t4mQj3u5R8bAk6L4AoRFCQ8YgW6xp8gLTpvzSd8gxS4QOfhf-I3SX03eqh_KtiQebSb6_kiOoI0qXhnImE/s640/VSCode.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Other IDEs or Editors worth mentioning are Jupyter Notebook with 9%, Spyder with 8%, Sublime Text with 7%, Atom with 5%, IDLE which comes with Python 3% and VIM 2%.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So, what&#39;s yours favorite Python IDE or Editor?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*_*&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://flanture.blogspot.com/feeds/3893432359901863511/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://flanture.blogspot.com/2020/03/8-most-used-python-ides-or-editors-by.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/3893432359901863511'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/3893432359901863511'/><link rel='alternate' type='text/html' href='http://flanture.blogspot.com/2020/03/8-most-used-python-ides-or-editors-by.html' title='8 Most Used Python IDEs or Editors by Developers'/><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://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvSdDkCSvpW-gl7b328nNcHdgMMzI9l_XTA5iiOtFkowai-FQS-YXmwbY2gwDpDzDJTIkDYCuIOGkk1MiS6cOsa_1wD17rNVTtVK5DrtrZxiNaafV9Df3_rw4LV11v3l6ZX7PHLdQ9ycl0/s72-c/pythoncoder.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932984404072302429.post-971085985640602793</id><published>2020-02-28T14:49:00.000-08:00</published><updated>2020-05-20T14:47:47.766-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="code"/><category scheme="http://www.blogger.com/atom/ns#" term="examples"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorials"/><title type='text'>Two ways to write Hello World program in Python</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF9sHg6dTy4JEvnctTJYxqWabX81BvsvByj1MHPuserVhQL3O9171noM2Cn4T5tW7mjo-wqeHELM4ClxfKbeoPtxStg__8LoVORLpNk9C0ize8XBLqp-SXAT8QjZwufuwyX1Z-bYR4v9SX/s1600/python.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;338&quot; data-original-width=&quot;600&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF9sHg6dTy4JEvnctTJYxqWabX81BvsvByj1MHPuserVhQL3O9171noM2Cn4T5tW7mjo-wqeHELM4ClxfKbeoPtxStg__8LoVORLpNk9C0ize8XBLqp-SXAT8QjZwufuwyX1Z-bYR4v9SX/s1600/python.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
There are two ways to write Hello World program in Python.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;First way&lt;/b&gt; is to use print statement like this:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 90%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; print(&quot;Hello World&quot;)  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
When program is executed python shell will print very satisfying text message like this:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEji-q68SuCd8l3grhZb-03CPAl77MndxraLFYpee1Gm3BtI1F2IEmjt9Y_QLjVGbzBu9y86APycDL8l2IgSnek-J_UpGnZi4DWeOigDyw1w7aXTo7PInpoBZN2IGCHwl09oOAxLgfow9tpy/s1600/pythonhelloworld1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;245&quot; data-original-width=&quot;350&quot; height=&quot;224&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEji-q68SuCd8l3grhZb-03CPAl77MndxraLFYpee1Gm3BtI1F2IEmjt9Y_QLjVGbzBu9y86APycDL8l2IgSnek-J_UpGnZi4DWeOigDyw1w7aXTo7PInpoBZN2IGCHwl09oOAxLgfow9tpy/s320/pythonhelloworld1.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Nothing fancy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Second Way&lt;/b&gt; is to use tkinter module and create basic GUI window with appropriate title like this:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 90%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; from tkinter import *  
 window = Tk()  
 window.title(&quot;Hello Python World&quot;)  
 window.mainloop()  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
If you do this something magical happens! All of a sudden a window appears, your eyes are opening wide and you realize: I have created something great, I&#39;m ... programmer!&lt;br /&gt;
&lt;br /&gt;
And you run this simple script over and over again, checking it works every time, and magic is still there.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJmV6OY4swfOLAPy-oU3PyKFxbhXYVe6sf_6SKmIOhXhuzzUzKBhVmL9EgtKGn0NIocED7dC-BZToOypb2ylT-h2UB75yrFU9YipMAYNCH8zWQgnihpdkjY6lJIRHxnSpl39AIDgPyaQPl/s1600/PythonHelloWorldTkinter.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;188&quot; data-original-width=&quot;389&quot; height=&quot;154&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJmV6OY4swfOLAPy-oU3PyKFxbhXYVe6sf_6SKmIOhXhuzzUzKBhVmL9EgtKGn0NIocED7dC-BZToOypb2ylT-h2UB75yrFU9YipMAYNCH8zWQgnihpdkjY6lJIRHxnSpl39AIDgPyaQPl/s320/PythonHelloWorldTkinter.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Few years later, magic is still there.&lt;br /&gt;
&lt;br /&gt;
Every time.&lt;br /&gt;
&lt;br /&gt;
This is the first post on this blog (after 300+ of them) about Python programming language.&lt;br /&gt;
&lt;br /&gt;
I think it is appropriate to start with hello world.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://facebook.com/flantureblog&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;93&quot; data-original-width=&quot;101&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZZ7vcdJyzwav6AhtOWwzZmAbpAJploWaPuVj7hvhM79Cokt3LORcxUESAp1-IwqMO_9h5CId33ehdVYqfI7xZ9aAbhR1oDXGn92ND9TXPGaxNj8M4S14yCNDf0CO0mOKuOSE3c-5OaQzx/s1600/fb.jpg&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://twitter.com/flanture&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;93&quot; data-original-width=&quot;99&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwXenBoqhBmV12AEGb67_oJgVv5BZ3-AkUtOSlpMqOHTdzjX8Ot2quaxPgu4RSk1HimuryuMksJ8Z1vDkEbMCSIx1rHuFBPitxz1DJ1peQw00HpNGm_xietlNF-x5tCPpo0zSFDbf7fcJo/s1600/tw.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
*_*&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://flanture.blogspot.com/feeds/971085985640602793/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://flanture.blogspot.com/2020/02/two-ways-to-write-hello-world-program.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/971085985640602793'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/971085985640602793'/><link rel='alternate' type='text/html' href='http://flanture.blogspot.com/2020/02/two-ways-to-write-hello-world-program.html' title='Two ways to write Hello World program in Python'/><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://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF9sHg6dTy4JEvnctTJYxqWabX81BvsvByj1MHPuserVhQL3O9171noM2Cn4T5tW7mjo-wqeHELM4ClxfKbeoPtxStg__8LoVORLpNk9C0ize8XBLqp-SXAT8QjZwufuwyX1Z-bYR4v9SX/s72-c/python.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932984404072302429.post-6777062738375753044</id><published>2020-02-20T15:36:00.000-08:00</published><updated>2020-02-26T14:30:51.962-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="application"/><category scheme="http://www.blogger.com/atom/ns#" term="CSS3"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML5"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="learning"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorials"/><title type='text'>Simple CSS / JavaScript Random Number Generator</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzm1uwsxXFk3FMGCwFovmcdb-A-LsTUKRci_VbZ8o3tZY6siuQUyCEy0YHWeSjF0-EDWz6IJUwcf9nHBdtUcDzsinV7dp1xIGtFb3DXCW5Ag0FShXlk-ZKzHzKMLWa1AxCNxBpLU5vOgS0/s1600/RandomNumbersGenerator.jpg&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;333&quot; data-original-width=&quot;500&quot; height=&quot;266&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzm1uwsxXFk3FMGCwFovmcdb-A-LsTUKRci_VbZ8o3tZY6siuQUyCEy0YHWeSjF0-EDWz6IJUwcf9nHBdtUcDzsinV7dp1xIGtFb3DXCW5Ag0FShXlk-ZKzHzKMLWa1AxCNxBpLU5vOgS0/s400/RandomNumbersGenerator.jpg&quot; width=&quot;400&quot; alt=&quot;Random Numbers&quot;/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
This simple Random Number Generator has only few lines of JavaScript code and some simple CSS styling.&lt;br /&gt;
&lt;br /&gt;
It can be easily modified to have any of the preferred number of ciphers. This example has 3 div tags, one for every cipher. To create Random Number Generator with 4 cipher just add another div tag and one more line of JavaScript code.&lt;br /&gt;
&lt;br /&gt;
Click on Roll button to create new number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Random Number Generator :::&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;margin: auto; width: 600px;&quot;&gt;
&lt;div style=&quot;border: 5px solid silver; display: flex; justify-content: space-between;&quot;&gt;
&lt;div id=&quot;v1&quot; style=&quot;background: navy; color: white; font-family: &amp;quot;verdana&amp;quot;; font-size: 100px; height: 150px; line-height: 150px; text-align: center; vertical-align: middle; width: 150px;&quot;&gt;
0&lt;/div&gt;
&lt;div id=&quot;v2&quot; style=&quot;background: navy; color: white; font-family: &amp;quot;verdana&amp;quot;; font-size: 100px; height: 150px; line-height: 150px; text-align: center; vertical-align: middle; width: 150px;&quot;&gt;
0&lt;/div&gt;
&lt;div id=&quot;v3&quot; style=&quot;background: navy; color: white; font-family: &amp;quot;verdana&amp;quot;; font-size: 100px; height: 150px; line-height: 150px; text-align: center; vertical-align: middle; width: 150px;&quot;&gt;
0&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div onclick=&quot;roll()&quot; style=&quot;background: navy; border: 5px solid silver; color: white; cursor: pointer; font-family: &amp;quot;verdana&amp;quot;; font-size: 30px; height: 50px; line-height: 50px; margin-left: auto; margin-right: auto; margin-top: 30px; text-align: center; vertical-align: middle; width: 150px;&quot;&gt;
Roll&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
function roll() {
 document.getElementById(&quot;v1&quot;).innerHTML = Math.floor(Math.random() * 10);
 document.getElementById(&quot;v2&quot;).innerHTML = Math.floor(Math.random() * 10);
 document.getElementById(&quot;v3&quot;).innerHTML = Math.floor(Math.random() * 10); 
}
&lt;/script&gt;

&lt;br /&gt;
&lt;br /&gt;
HTML file is straightforward, some DIV elements and button.&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 90%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; &amp;lt;body&amp;gt;  
  &amp;lt;div class=&quot;box&quot;&amp;gt;  
     &amp;lt;div class=&quot;eqi-container&quot;&amp;gt;  
      &amp;lt;div id=&quot;v1&quot;&amp;gt;0&amp;lt;/div&amp;gt;  
      &amp;lt;div id=&quot;v2&quot;&amp;gt;0&amp;lt;/div&amp;gt;  
      &amp;lt;div id=&quot;v3&quot;&amp;gt;0&amp;lt;/div&amp;gt;  
     &amp;lt;/div&amp;gt;  
  &amp;lt;/div&amp;gt;      
  &amp;lt;div class=&quot;btn&quot; onclick=&quot;roll()&quot;&amp;gt;Roll&amp;lt;/div&amp;gt;  
     &amp;lt;script src=&quot;app.js&quot;&amp;gt;&amp;lt;/script&amp;gt;  
 &amp;lt;/body&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
JavaScript has only one function with 3 calls to Math.random function.&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 90%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; function roll() {  
     document.getElementById(&quot;v1&quot;).innerHTML = Math.floor(Math.random() * 10);  
     document.getElementById(&quot;v2&quot;).innerHTML = Math.floor(Math.random() * 10);  
     document.getElementById(&quot;v3&quot;).innerHTML = Math.floor(Math.random() * 10);      
 }  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally CSS file for styles.
&lt;br /&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 90%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; .box {  
  width:800px;  
  margin:auto;  
 }  
 .eqi-container {  
  border: 5px solid silver;   
  display: flex;  
  justify-content: space-between;  
 }  
 .eqi-container div {  
  width: 200px;  
  height: 200px;  
  background: navy;  
  text-align: center;  
  vertical-align: middle;  
  line-height: 200px;  
  color: white;  
  font-size: 120px;   
  font-family: Verdana;  
 }  
 .btn {  
  margin-top: 30px;  
  border: 5px solid silver;  
  width: 150px;  
  height: 50px;  
  margin-left: auto;  
  margin-right: auto;  
  background: navy;  
  text-align: center;  
  vertical-align: middle;  
  line-height: 50px;  
  color: white;  
  font-size: 30px;  
  font-style: bold;   
  font-family: Verdana;   
  cursor: pointer;  
 }  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
*_*
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://flanture.blogspot.com/feeds/6777062738375753044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://flanture.blogspot.com/2020/02/simple-css-javascript-random-number.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/6777062738375753044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/6777062738375753044'/><link rel='alternate' type='text/html' href='http://flanture.blogspot.com/2020/02/simple-css-javascript-random-number.html' title='Simple CSS / JavaScript Random Number Generator'/><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://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzm1uwsxXFk3FMGCwFovmcdb-A-LsTUKRci_VbZ8o3tZY6siuQUyCEy0YHWeSjF0-EDWz6IJUwcf9nHBdtUcDzsinV7dp1xIGtFb3DXCW5Ag0FShXlk-ZKzHzKMLWa1AxCNxBpLU5vOgS0/s72-c/RandomNumbersGenerator.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932984404072302429.post-2145992587940291463</id><published>2020-02-17T14:40:00.000-08:00</published><updated>2020-02-29T01:18:36.460-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="digital art"/><category scheme="http://www.blogger.com/atom/ns#" term="game development"/><category scheme="http://www.blogger.com/atom/ns#" term="gamedev"/><category scheme="http://www.blogger.com/atom/ns#" term="games"/><category scheme="http://www.blogger.com/atom/ns#" term="gdevelop5"/><category scheme="http://www.blogger.com/atom/ns#" term="godot engine"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML5"/><category scheme="http://www.blogger.com/atom/ns#" term="learning"/><category scheme="http://www.blogger.com/atom/ns#" term="open source"/><category scheme="http://www.blogger.com/atom/ns#" term="Phaser"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorials"/><title type='text'>Starting out with Gdevelop 5 for Game Development</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
After some thinking I decided to go for Gdevelop 5 for my &lt;a href=&quot;https://flanture.blogspot.com/2020/02/game-engine-for-first-2d-html-game.html&quot; target=&quot;_blank&quot;&gt;first 2D HTML game&lt;/a&gt; ever. Godot engine and Phaser were option too, but since no programming is required when using Gdevelop 5 and engine/editor is open source, I decided to try it.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
I finished platform tutorial from their website after downloading and installing the software and my first reaction was to re-skin it but then I realized that I want something more casual and maybe in the long run suitable for Android export.&lt;/div&gt;
&lt;br /&gt;
&lt;h2&gt;
Using Gdevelop 5 for Game Development&lt;/h2&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Using Paint.net I created few simple graphics (different color balls, some walls and gradient background) and made one level of Pass the ball game. Goal is to pass to ball to the other side of the screen with single direction movement with hitting moving walls.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Adding events was really easy and fun. Just click Add Condition button and start typing in search field for appropriate action and right event would pop up. Then add action like add permanent force or stop the ball or change X position, hit run button and I&#39;m playing right away.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
You can&#39;t get simpler than that.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
After a while I decided to make things better and I downloaded from&amp;nbsp; OpenGameArt some cars and trains sprites and some sand background. Pass the ball became Car Against Trains.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Here is the look of first two levels.&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCBQJupYPJQIM7LUrOnyi-_zXnrpjwuV8vV2eD3K1Mi5ow4oG0zYmAC8KV_V4xmIUdbZKq51RH5tz1dJRr0_jOcYHMKgMR5Y5mmhLEMvElw8_L80-LpjFOKOh3h07iJGsVXEZvaZSDOoNv/s1600/levels12.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;450&quot; data-original-width=&quot;600&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCBQJupYPJQIM7LUrOnyi-_zXnrpjwuV8vV2eD3K1Mi5ow4oG0zYmAC8KV_V4xmIUdbZKq51RH5tz1dJRr0_jOcYHMKgMR5Y5mmhLEMvElw8_L80-LpjFOKOh3h07iJGsVXEZvaZSDOoNv/s1600/levels12.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Playing difficulty should always gradually grow, so first two levels are easy. I have two different trains on first and second level. Brown train goes from right to left and green train goes in opposite direction. They have same speed. First level is trivial, second is just a little bit challenging.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Player can move left and right, can stop the car and launch it. Once the car moves up, player can&#39;t do anything with it. Car will hit the train and go back to start or pass to the other side and go to next level.&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;style&gt;
.amzbox {
  text-align: center;
}
&lt;/style&gt;
&lt;div class=&quot;amzbox&quot;&gt;
&lt;iframe style=&quot;width:120px;height:240px;&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; src=&quot;//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&amp;OneJS=1&amp;Operation=GetAdHtml&amp;MarketPlace=US&amp;source=ac&amp;ref=tf_til&amp;ad_type=product_link&amp;tracking_id=senseqts-20&amp;marketplace=amazon&amp;region=US&amp;placement=1118877160&amp;asins=1118877160&amp;linkId=c6d83cca4af23dfe4be62ba8790cab8d&amp;show_border=false&amp;link_opens_in_new_window=false&amp;price_color=333333&amp;title_color=0066c0&amp;bg_color=ffffff&quot;&gt;
    &lt;/iframe&gt;&amp;nbsp;&amp;nbsp;
&lt;iframe style=&quot;width:120px;height:240px;&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; src=&quot;//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&amp;OneJS=1&amp;Operation=GetAdHtml&amp;MarketPlace=US&amp;source=ac&amp;ref=tf_til&amp;ad_type=product_link&amp;tracking_id=senseqts-20&amp;marketplace=amazon&amp;region=US&amp;placement=1491999152&amp;asins=1491999152&amp;linkId=d4b5e59c750e809bb71873584e32f11e&amp;show_border=false&amp;link_opens_in_new_window=false&amp;price_color=333333&amp;title_color=0066c0&amp;bg_color=ffffff&quot;&gt;
    &lt;/iframe&gt;&amp;nbsp;&amp;nbsp;
&lt;iframe style=&quot;width:120px;height:240px;&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; src=&quot;//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&amp;OneJS=1&amp;Operation=GetAdHtml&amp;MarketPlace=US&amp;source=ac&amp;ref=tf_til&amp;ad_type=product_link&amp;tracking_id=senseqts-20&amp;marketplace=amazon&amp;region=US&amp;placement=1590596153&amp;asins=1590596153&amp;linkId=d8caa698e2744b1c3fe5c5ad87d9401a&amp;show_border=false&amp;link_opens_in_new_window=false&amp;price_color=333333&amp;title_color=0066c0&amp;bg_color=ffffff&quot;&gt;
    &lt;/iframe&gt;&amp;nbsp;&amp;nbsp;
&lt;iframe style=&quot;width:120px;height:240px;&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; src=&quot;//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&amp;OneJS=1&amp;Operation=GetAdHtml&amp;MarketPlace=US&amp;source=ac&amp;ref=tf_til&amp;ad_type=product_link&amp;tracking_id=senseqts-20&amp;marketplace=amazon&amp;region=US&amp;placement=0996781552&amp;asins=0996781552&amp;linkId=d8fdc9eadd0de5db6faab7825193009f&amp;show_border=false&amp;link_opens_in_new_window=false&amp;price_color=333333&amp;title_color=0066c0&amp;bg_color=ffffff&quot;&gt;
    &lt;/iframe&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;h2&gt;
Adding Events (Conditions and Actions) in Gdevelop5&lt;/h2&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
There are several events on every level:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
- Moving trains at the beginning of the Scene.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
- Change trains position on screen out.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
- Move Car on key press.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
- Car / Trains collision.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
- Level finish event.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
- Stop the Car on boundaries.&lt;br /&gt;
&lt;br /&gt;
First, let&#39;s introduce game objects.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBvW4irMvSaMyifA60YFGBaEw5DECPAiuOikmeQIUDx1sSqlJYdOatXofxUp-ajEPgWmmt1rqwvd77D_iRZJRoui2u81Y6rZmP4vmrfKQ38d1qcubXVhZCp-XtlPtFGnPlbASF7oUNQhSA/s1600/GameObjects.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;438&quot; data-original-width=&quot;340&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBvW4irMvSaMyifA60YFGBaEw5DECPAiuOikmeQIUDx1sSqlJYdOatXofxUp-ajEPgWmmt1rqwvd77D_iRZJRoui2u81Y6rZmP4vmrfKQ38d1qcubXVhZCp-XtlPtFGnPlbASF7oUNQhSA/s320/GameObjects.jpg&quot; width=&quot;248&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
As you can see, Car object and all Trains are bold and italic which means they are set as global objects, they will appear on every level. Background will change from level to level and LevelText will also change. OK, now the events.&lt;br /&gt;
&lt;h4&gt;
Move trains / set scene variables&lt;/h4&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwQexZHIXXSh28cp8_1YUwZ8XvbiIUWzeoLwG1OH-RkdKFcXtGHMjcVl6hUR-JiKfigWMHVNRaKHc_cU3ShsFgHsEsZParUiJuTRVrpSSTVCtr2owGYOdyN6scDIwCm6WZ4-v7iBmxxNNr/s1600/event1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;200&quot; data-original-width=&quot;774&quot; height=&quot;164&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwQexZHIXXSh28cp8_1YUwZ8XvbiIUWzeoLwG1OH-RkdKFcXtGHMjcVl6hUR-JiKfigWMHVNRaKHc_cU3ShsFgHsEsZParUiJuTRVrpSSTVCtr2owGYOdyN6scDIwCm6WZ4-v7iBmxxNNr/s640/event1.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Each Train gets own direction, GTrain moves to the right with speed 150 px, KTrain to the left with same speed. I have also train with speed 75 on other levels to make things more interesting and I have static Train as obstacle, I&#39;ll maybe remove that later when I add more graphic elements.&lt;br /&gt;
&lt;br /&gt;
Scene variable CarMoving is set to 0. This will be used in other events.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
Change trains position on screen out&lt;/h4&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTGXqWMkB6HvIxdtbUZOcgq28pTEES_a6IIihIJH7vrwwgwiYB3ZGP6IvoomaHu18jQ9JdomqtmLKAkhy8dFewVgLj7IcFBWWcvgI7ijCRRtVfl2JuTYHZsyuA4aLnpCrUNrIoMy11Dp-B/s1600/event2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;227&quot; data-original-width=&quot;770&quot; height=&quot;188&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTGXqWMkB6HvIxdtbUZOcgq28pTEES_a6IIihIJH7vrwwgwiYB3ZGP6IvoomaHu18jQ9JdomqtmLKAkhy8dFewVgLj7IcFBWWcvgI7ijCRRtVfl2JuTYHZsyuA4aLnpCrUNrIoMy11Dp-B/s640/event2.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
This is simple event. Move (reuse) train when it is out of screen boundaries.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
Move car on key press&lt;/h4&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4Zu8g4eRTXrM4CVOT_gogdkgs0DI2FXnQIb84k3qjgNjum_pUTi0BgpIywnMwiRAJdVajF7S-YN8vwLibynfK6Cb1G31fuQXzo1E2IGYbEBj3p5C5t6m_LBLCEPerR7mzQ9PFxzPkB85-/s1600/event3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;227&quot; data-original-width=&quot;768&quot; height=&quot;188&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4Zu8g4eRTXrM4CVOT_gogdkgs0DI2FXnQIb84k3qjgNjum_pUTi0BgpIywnMwiRAJdVajF7S-YN8vwLibynfK6Cb1G31fuQXzo1E2IGYbEBj3p5C5t6m_LBLCEPerR7mzQ9PFxzPkB85-/s640/event3.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
I&#39;m using CarMoving variable here to prevent user to move the Car once it started going in vertical direction. This is desired choice. I could have done it differently but the game would be much complicated, and I wanted something simpler to begin with.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
Car / Trains collisions&lt;/h4&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjURsoZCIKQGWw_AmDLoYrm-moxdFAdcvlPKeknkrvLRRrcOVTe9mYoq7bKjaQP8_ReRFzFlQQKIQO9Qr6wsWCogSJytbnNsY4_f9Ht1fGP903hrTUjipoB2mBaflkqtHz4QPnTJWx3Wmik/s1600/event4.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;242&quot; data-original-width=&quot;758&quot; height=&quot;204&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjURsoZCIKQGWw_AmDLoYrm-moxdFAdcvlPKeknkrvLRRrcOVTe9mYoq7bKjaQP8_ReRFzFlQQKIQO9Qr6wsWCogSJytbnNsY4_f9Ht1fGP903hrTUjipoB2mBaflkqtHz4QPnTJWx3Wmik/s640/event4.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
This will change later when collision animation is added. Right now Car just re-appears on start position. Again CarMoving variable needs to be set to 0 again.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
Level is finished&amp;nbsp;&lt;/h4&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIIs9ii1oV1L01HyRkmXirsqVnrFOkZKt3aep9yAQfznfmZ7ewFsHXjIg4U77OhVTAkx_T7bwruO2dk9Ypjt6fnq55j4gageMxO1ffAoF6aMkTrVuQ9-tHUMb8PmoRl8TYHlRsT_vh2cY2/s1600/event5.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;125&quot; data-original-width=&quot;766&quot; height=&quot;104&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIIs9ii1oV1L01HyRkmXirsqVnrFOkZKt3aep9yAQfznfmZ7ewFsHXjIg4U77OhVTAkx_T7bwruO2dk9Ypjt6fnq55j4gageMxO1ffAoF6aMkTrVuQ9-tHUMb8PmoRl8TYHlRsT_vh2cY2/s640/event5.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
When user / player &quot;wins&quot; the level, avoid all trains and get to the other side of the screen, scene changes.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
Moving the Car&lt;/h4&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGByNGAv79JWnOirt4-7CRHjMUoKS_q1YPgLSyJztnlUzSdXslIb3zboW-MUEYvODgI10E5923wmCPQJgC9pOlePN5lQtJkfvXiVaaJ7hNBgDUxoskq1JO7PaSl-UoL32n92aRYKRUoBel/s1600/event6.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;461&quot; data-original-width=&quot;787&quot; height=&quot;374&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGByNGAv79JWnOirt4-7CRHjMUoKS_q1YPgLSyJztnlUzSdXslIb3zboW-MUEYvODgI10E5923wmCPQJgC9pOlePN5lQtJkfvXiVaaJ7hNBgDUxoskq1JO7PaSl-UoL32n92aRYKRUoBel/s640/event6.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
If key is pressed and CarMoving is 0 means Car is still in horizontal movement only. Down key stops the Car, right moves it to the right, left moves it to the left, obviously. This could be done without Down key action also.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
Stop Car on screen boundaries&lt;/h4&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCkMYGoKu-T-2oQ9x_td9mug13MfFLAgid7KlWpNuJE79rk9bYaF5uqc45MAAZxUfmmLD-tGH7Hs7SgPJgdD7sPA1YgLtCuXiMC8bDsFDVRFLNtO61i76AD0luO1YRxeM3myBazUwlozvi/s1600/event7.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;149&quot; data-original-width=&quot;716&quot; height=&quot;132&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCkMYGoKu-T-2oQ9x_td9mug13MfFLAgid7KlWpNuJE79rk9bYaF5uqc45MAAZxUfmmLD-tGH7Hs7SgPJgdD7sPA1YgLtCuXiMC8bDsFDVRFLNtO61i76AD0luO1YRxeM3myBazUwlozvi/s640/event7.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally last event is stopping the Car on screen boundaries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Again, very simple and straightforward to add events, and fun.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Next are levels 3 and 4. Here is how they look.&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxXFlmTQ8o6SXJDklzC2XS_2A55ptzYIh0aAAtQrZIon8JWXZ1T8OtLc8Dr12tUGpLtHqN8yiKOXg0Y8AEl-X6VK5vKsUliQ-6rrxZ8q5ROg9_2IgHJqx8Ow1GaIp8yIIXHGGo7xY6Ol5T/s1600/level34.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;444&quot; data-original-width=&quot;600&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxXFlmTQ8o6SXJDklzC2XS_2A55ptzYIh0aAAtQrZIon8JWXZ1T8OtLc8Dr12tUGpLtHqN8yiKOXg0Y8AEl-X6VK5vKsUliQ-6rrxZ8q5ROg9_2IgHJqx8Ow1GaIp8yIIXHGGo7xY6Ol5T/s1600/level34.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Now these are more difficult. Blue train on level 3 has half the speed of green and brown trains. Red train on level 4 is static. It acts as a shield, sort of narrowing playing field for the Car.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
I was thinking of other options too. Should the car be able to move left and right after launching. Can player stop the car once start moving left and right.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
For now there is no animation for the Car. Also background will improve by adding elements like trees, bushes and stones. Music and sounds will be added.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
There are several improvements I&#39;m considering. One is water field which slows down the Car and Ice field which speeds it up. How about a tunnel where Car can enter on the right and exit on the left side of the screen. Also it can go over the train. Possibilities are endless really.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
I hope you enjoyed this Introduction and will follow me on my journey.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Please share this post if you find it interesting.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Thanks for reading.&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;div class=&quot;amzbox&quot;&gt;
&lt;iframe style=&quot;width:120px;height:240px;&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; src=&quot;//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&amp;OneJS=1&amp;Operation=GetAdHtml&amp;MarketPlace=US&amp;source=ac&amp;ref=tf_til&amp;ad_type=product_link&amp;tracking_id=senseqts-20&amp;marketplace=amazon&amp;region=US&amp;placement=1491999152&amp;asins=1491999152&amp;linkId=d4b5e59c750e809bb71873584e32f11e&amp;show_border=false&amp;link_opens_in_new_window=false&amp;price_color=333333&amp;title_color=0066c0&amp;bg_color=ffffff&quot;&gt;
    &lt;/iframe&gt;&amp;nbsp;&amp;nbsp;
&lt;iframe style=&quot;width:120px;height:240px;&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; src=&quot;//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&amp;OneJS=1&amp;Operation=GetAdHtml&amp;MarketPlace=US&amp;source=ac&amp;ref=tf_til&amp;ad_type=product_link&amp;tracking_id=senseqts-20&amp;marketplace=amazon&amp;region=US&amp;placement=1590596153&amp;asins=1590596153&amp;linkId=d8caa698e2744b1c3fe5c5ad87d9401a&amp;show_border=false&amp;link_opens_in_new_window=false&amp;price_color=333333&amp;title_color=0066c0&amp;bg_color=ffffff&quot;&gt;
    &lt;/iframe&gt;&amp;nbsp;&amp;nbsp;
&lt;iframe style=&quot;width:120px;height:240px;&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; src=&quot;//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&amp;OneJS=1&amp;Operation=GetAdHtml&amp;MarketPlace=US&amp;source=ac&amp;ref=tf_til&amp;ad_type=product_link&amp;tracking_id=senseqts-20&amp;marketplace=amazon&amp;region=US&amp;placement=1118877160&amp;asins=1118877160&amp;linkId=c6d83cca4af23dfe4be62ba8790cab8d&amp;show_border=false&amp;link_opens_in_new_window=false&amp;price_color=333333&amp;title_color=0066c0&amp;bg_color=ffffff&quot;&gt;
    &lt;/iframe&gt;&amp;nbsp;&amp;nbsp;
&lt;iframe style=&quot;width:120px;height:240px;&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; src=&quot;//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&amp;OneJS=1&amp;Operation=GetAdHtml&amp;MarketPlace=US&amp;source=ac&amp;ref=tf_til&amp;ad_type=product_link&amp;tracking_id=senseqts-20&amp;marketplace=amazon&amp;region=US&amp;placement=0996781552&amp;asins=0996781552&amp;linkId=d8fdc9eadd0de5db6faab7825193009f&amp;show_border=false&amp;link_opens_in_new_window=false&amp;price_color=333333&amp;title_color=0066c0&amp;bg_color=ffffff&quot;&gt;
    &lt;/iframe&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
*_*&amp;nbsp;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://flanture.blogspot.com/feeds/2145992587940291463/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://flanture.blogspot.com/2020/02/starting-out-with-gdevelop-5-for-game.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/2145992587940291463'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/2145992587940291463'/><link rel='alternate' type='text/html' href='http://flanture.blogspot.com/2020/02/starting-out-with-gdevelop-5-for-game.html' title='Starting out with Gdevelop 5 for Game Development'/><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://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCBQJupYPJQIM7LUrOnyi-_zXnrpjwuV8vV2eD3K1Mi5ow4oG0zYmAC8KV_V4xmIUdbZKq51RH5tz1dJRr0_jOcYHMKgMR5Y5mmhLEMvElw8_L80-LpjFOKOh3h07iJGsVXEZvaZSDOoNv/s72-c/levels12.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932984404072302429.post-8941870130661183673</id><published>2020-02-04T02:29:00.000-08:00</published><updated>2020-02-17T12:59:17.868-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="animations"/><category scheme="http://www.blogger.com/atom/ns#" term="canvas"/><category scheme="http://www.blogger.com/atom/ns#" term="game development"/><category scheme="http://www.blogger.com/atom/ns#" term="gamedev"/><category scheme="http://www.blogger.com/atom/ns#" term="games"/><category scheme="http://www.blogger.com/atom/ns#" term="gdevelop5"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML5"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="polls"/><title type='text'>Game Engine for first 2D HTML Game</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
It is expected that Global Game Market Revenue in 2020 will be around $160Bn with projected growth in 2021. and 2022.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
This means it was never better time to start with game development.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
But how to start if you are solo developer? 

&lt;/div&gt;
&lt;h1&gt;
Game Engine for first 2D HTML Game&lt;/h1&gt;
Recently I asked on &lt;a href=&quot;http://twitter.com/flanture&quot; target=&quot;_blank&quot;&gt;Twitter&lt;/a&gt;&amp;nbsp;&quot;What would you recommend to someone who wants to make 2D HTML game as a beginner?&lt;br /&gt;
&lt;br /&gt;
Here are voting results:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwOzRFxcwNHiWQSKwKrjQ3Pd8wwP_vUipcu0u7s57uZfXZ9RusILrbwZ9NW_GZthiaPp-iEEGE4KzBXKrSfbAspXhMXx-3MbJ3KLaCdVT1Hlw5gxWLyGiya9vg1cbUhD69tjFlwzOygSsm/s1600/Screenshot.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;222&quot; data-original-width=&quot;640&quot; height=&quot;220&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwOzRFxcwNHiWQSKwKrjQ3Pd8wwP_vUipcu0u7s57uZfXZ9RusILrbwZ9NW_GZthiaPp-iEEGE4KzBXKrSfbAspXhMXx-3MbJ3KLaCdVT1Hlw5gxWLyGiya9vg1cbUhD69tjFlwzOygSsm/s640/Screenshot.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Clear winner here is Godot engine, however only 3 options were available and maybe if there were more, maybe the end result would be different.&lt;br /&gt;
&lt;br /&gt;
Here are some of the comments I received.&lt;br /&gt;
&lt;br /&gt;
@indiedevnet wrote:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: #192734; color: white; font-family: , , &amp;quot;blinkmacsystemfont&amp;quot; , &amp;quot;segoe ui&amp;quot; , &amp;quot;roboto&amp;quot; , &amp;quot;ubuntu&amp;quot; , &amp;quot;helvetica neue&amp;quot; , sans-serif; font-size: 16px; white-space: pre-wrap;&quot;&gt;IMO Phaser will give you a solid appreciation for what you need to build for any game, whereas something like GameMaker or Godot abstract a bit. But maybe you don&#39;t want to make the lower level stuff, in which case GameMaker is great for beginners.&lt;/span&gt;&amp;nbsp;&lt;/blockquote&gt;
&lt;br /&gt;
@eric81766 said:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: #192734; color: white; font-family: , , &amp;quot;blinkmacsystemfont&amp;quot; , &amp;quot;segoe ui&amp;quot; , &amp;quot;roboto&amp;quot; , &amp;quot;ubuntu&amp;quot; , &amp;quot;helvetica neue&amp;quot; , sans-serif; font-size: 16px; white-space: pre-wrap;&quot;&gt;I&#39;d prefer Godot to Phaser in general because it seems to me that learning Godot is a bit more versatile. 
For a first game: whatever takes best advantage of what you already know since the &quot;making a game&quot; part is going to require a lot of thinking/learning. &lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/blockquote&gt;
&lt;br /&gt;
and @qubet_b commented:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;background-color: #192734; color: white; font-family: , , &amp;quot;blinkmacsystemfont&amp;quot; , &amp;quot;segoe ui&amp;quot; , &amp;quot;roboto&amp;quot; , &amp;quot;ubuntu&amp;quot; , &amp;quot;helvetica neue&amp;quot; , sans-serif; font-size: 16px; white-space: pre-wrap;&quot;&gt;I recommend prototyping in RPG Maker MV and making your official product in Game Maker Studio 2.&lt;/span&gt;&amp;nbsp;&lt;/blockquote&gt;
&lt;br /&gt;
As I said, there were only 3 options to Poll question, but so many engines available. After some searching online there was IMO one other candidate not mentioned here which is also very good option for first 2D HTML game if you are solo developer - Gdevelop 5.&lt;br /&gt;
&lt;br /&gt;
I&#39;m not going into details here but I need to mention that after only 2 hours of working with Gdevelop5 I have simple working HTML game with 5 levels, ready to be played.&lt;br /&gt;
&lt;br /&gt;
That means I guess I&#39;ll spend some more time on this engine and maybe I can produce few games and tutorials which I will post here.&lt;br /&gt;
&lt;br /&gt;
What would You recommend as first engine to use?&lt;br /&gt;
&lt;br /&gt;
Thank you.&lt;br /&gt;
&lt;br /&gt;
*_*&amp;nbsp;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://flanture.blogspot.com/feeds/8941870130661183673/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://flanture.blogspot.com/2020/02/game-engine-for-first-2d-html-game.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/8941870130661183673'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/8941870130661183673'/><link rel='alternate' type='text/html' href='http://flanture.blogspot.com/2020/02/game-engine-for-first-2d-html-game.html' title='Game Engine for first 2D HTML Game'/><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://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwOzRFxcwNHiWQSKwKrjQ3Pd8wwP_vUipcu0u7s57uZfXZ9RusILrbwZ9NW_GZthiaPp-iEEGE4KzBXKrSfbAspXhMXx-3MbJ3KLaCdVT1Hlw5gxWLyGiya9vg1cbUhD69tjFlwzOygSsm/s72-c/Screenshot.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932984404072302429.post-902311464889065229</id><published>2020-01-24T14:29:00.000-08:00</published><updated>2020-02-15T09:15:12.358-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="canvas"/><category scheme="http://www.blogger.com/atom/ns#" term="digital art"/><category scheme="http://www.blogger.com/atom/ns#" term="examples"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML5"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="open source"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="visualization"/><title type='text'>More about drawing on Canvas using HTML sliders and JavaScript</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGnex2ZvoSdvHiQhQ4_Th6MLiHaka5HBlO0dYNpZ37romCIKD_iIaWXQQpz4pesYxa2XTTg6a-1yrgbVtVKCa7AsrIcy1D78_LyGKQKrFCKqeoh7f11YsaYaLyw6qbMVZiW5zhznXjIHbX/s1600/CanvasDrawingExample.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;640&quot; data-original-width=&quot;966&quot; height=&quot;265&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGnex2ZvoSdvHiQhQ4_Th6MLiHaka5HBlO0dYNpZ37romCIKD_iIaWXQQpz4pesYxa2XTTg6a-1yrgbVtVKCa7AsrIcy1D78_LyGKQKrFCKqeoh7f11YsaYaLyw6qbMVZiW5zhznXjIHbX/s400/CanvasDrawingExample.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
In previous post &lt;a href=&quot;https://flanture.blogspot.com/2020/01/simple-reactive-javascript-sliders-and.html&quot; target=&quot;_blank&quot;&gt;Simple reactive JavaScript sliders&lt;/a&gt; you could see how to attach listener to HTML sliders and how to use JavaScript to draw on Canvas. By moving the sliders shape is changing dynamically. This is very basic example.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
One slightly complicated example is to generate circles on random positions. Below is the code.&lt;/div&gt;
&lt;br /&gt;

&lt;h1&gt;Drawing on Canvas using HTML sliders and JavaScript&lt;/h1&gt;

&lt;span style=&quot;text-align: justify;&quot;&gt;Function Circle has 3 parameters, x is x position of the circle, y is y position of the circle on Canvas and z is radius, current Radius slider value. Both x and y are randomly chosen using Math.random JavaScript function.&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
How this works? Every time slider changes position onSliderChange function is called and if user moves slider to the right Circle object is generated and pushed to array. Then all circles are drawn on Canvas using drawCircles function. If user moves slider to the left elements from array are deleted using pop() function. Simple.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Code is separated into functions in a way that it is very easy to instead of drawCircles one can write drawRectangle or drawAnyShape etc.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
This opens up possibility to write wide range of generators like background generators or some digital art etc.&amp;nbsp;&lt;/div&gt;
&lt;br /&gt;
Styles.css file is the same as in previous tutorial so I&#39;ll skip that.&lt;br /&gt;
&lt;br /&gt;
Here are other two files.&lt;br /&gt;
&lt;br /&gt;
index.html&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 90%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; &amp;lt;!DOCTYPE html&amp;gt;  
 &amp;lt;html&amp;gt;  
   
   &amp;lt;head&amp;gt;  
     &amp;lt;meta charset=&quot;utf-8&quot;&amp;gt;  
     &amp;lt;title&amp;gt;Circles example&amp;lt;/title&amp;gt;  
         &amp;lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;styles.css&quot;&amp;gt;  
   &amp;lt;/head&amp;gt;  
   &amp;lt;body&amp;gt;  
   &amp;lt;div id=&quot;menu&quot; style=&quot;width:160px;float:left;&quot;&amp;gt;  
   &amp;lt;p&amp;gt;  
     Circles: &amp;lt;input type=&quot;range&quot; class=&quot;styled-input&quot; id=&quot;_cir&quot; value=&quot;0&quot; min=&quot;0&quot; max=&quot;20&quot; step=&quot;1&quot;&amp;gt;&amp;lt;br&amp;gt;  
     Radius: &amp;lt;input type=&quot;range&quot; class=&quot;styled-input&quot; id=&quot;_rad&quot; value=&quot;20&quot; min=&quot;20&quot; max=&quot;200&quot; step=&quot;10&quot;&amp;gt;&amp;lt;br&amp;gt;  
         &amp;lt;br&amp;gt;  
   &amp;lt;/p&amp;gt;  
   &amp;lt;/div&amp;gt;  
   &amp;lt;div id=&quot;content&quot; style=&quot;background-color:#EEEEEE;float:left;&quot;&amp;gt;  
   &amp;lt;canvas id=&quot;myCanvas&quot; width=&quot;600&quot; height=&quot;500&quot; style=&quot;border:1px solid #d3d3d3;&quot;&amp;gt;  
   Your browser does not support the HTML5 canvas tag.&amp;lt;/canvas&amp;gt;  
   &amp;lt;/div&amp;gt;  
     &amp;lt;script src=&quot;app.js&quot;&amp;gt;&amp;lt;/script&amp;gt;  
   &amp;lt;/body&amp;gt;  
 &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
app.js&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 90%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; &quot;use strict&quot;;  
 var currCanvas = &quot;myCanvas&quot;;  
   
 var arr = [];  
   
 var slider_cir = document.getElementById(&#39;_cir&#39;);  
 slider_cir.addEventListener(&#39;input&#39;, onSliderChange);  
   
 var slider_rad = document.getElementById(&#39;_rad&#39;);  
 slider_rad.addEventListener(&#39;input&#39;, onSliderChange);  
   
 function Circle(x, y, z) {  
   this.x = x;  
   this.y = y;  
     this.z = z;  
 }  
   
 function init() {  
     // starting position  
     slider_cir.value = 0;  
     slider_rad.value = 20;  
 }  
   
 function addRandomCircle() {  
     // function adds random circle to arr   
     var p = new Circle(Math.floor(Math.random()*600), Math.floor(Math.random()*500), slider_rad.value);  
     // console.log(p);  
     return p;  
 }  
   
 function drawCircles() {  
   
     var ptn;  
     for (ptn = 0; ptn &amp;lt; arr.length; ptn++) {  
         // draw circles one by one  
         var c = document.getElementById(&quot;myCanvas&quot;),  
         ctx = c.getContext(&quot;2d&quot;);  
         ctx.beginPath();  
         ctx.lineWidth = 3;  
         ctx.strokeStyle = &#39;black&#39;;          
         ctx.arc(arr[ptn].x, arr[ptn].y, arr[ptn].z, 0, 2 * Math.PI);  
         ctx.stroke();  
     }            
 }  
   
 function onSliderChange() {  
       
     // update canvas on any slider change  
   var c = document.getElementById(&quot;myCanvas&quot;),  
   ctx = c.getContext(&quot;2d&quot;);  
     ctx.clearRect(0, 0, 600, 500);      
   
     var l = arr.length;  
       
     if (slider_cir.value &amp;gt; l) {  
         // add new circles  
         var diff = slider_cir.value - l;  
           
         var i;  
         for (i=0; i&amp;lt;diff; i++) {  
             var p = addRandomCircle();  
             arr.push(p);  
         }  
           
     } else if (slider_cir.value &amp;lt; l) {  
                 // remove circles   
                 var diff = l - slider_cir.value;  
                 var i;  
                 for (i=0; i&amp;lt;diff; i++) {  
                     arr.pop();  
                 }  
             }  
     drawCircles();  
       
 }  
   
 init();  
   
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
*_* - If you like this post, please share it. Thanx.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://flanture.blogspot.com/feeds/902311464889065229/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://flanture.blogspot.com/2020/01/more-about-drawing-on-canvas-using-html.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/902311464889065229'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/902311464889065229'/><link rel='alternate' type='text/html' href='http://flanture.blogspot.com/2020/01/more-about-drawing-on-canvas-using-html.html' title='More about drawing on Canvas using HTML sliders and JavaScript'/><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://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGnex2ZvoSdvHiQhQ4_Th6MLiHaka5HBlO0dYNpZ37romCIKD_iIaWXQQpz4pesYxa2XTTg6a-1yrgbVtVKCa7AsrIcy1D78_LyGKQKrFCKqeoh7f11YsaYaLyw6qbMVZiW5zhznXjIHbX/s72-c/CanvasDrawingExample.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932984404072302429.post-7652955561685854485</id><published>2020-01-22T14:40:00.001-08:00</published><updated>2020-01-23T15:31:36.305-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="animations"/><category scheme="http://www.blogger.com/atom/ns#" term="canvas"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML5"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="workinprogress"/><title type='text'>Simple Reactive JavaScript sliders and drawing on Canvas</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
For one planned future project I need to create reactive sliders. When user moves any of the sliders (in this example I have six of them) Canvas drawing is updated on any change.&lt;br /&gt;
&lt;br /&gt;
Simple solution is to attach one function, let&#39;s call it onSliderChange to every slider and call this function on input like this:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #cfe2f3;&quot;&gt;var slider_ax = document.getElementById(&#39;ax&#39;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cfe2f3;&quot;&gt;slider_ax.addEventListener(&#39;input&#39;, onSliderChange);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
-- slider_ax is variable for first slider&lt;br /&gt;
-- ax is id of slider input html element&lt;br /&gt;
-- onSliderChange is the name of the function&lt;br /&gt;
&lt;br /&gt;
Every slider gets this function.&lt;br /&gt;
&lt;br /&gt;
Now function onSliderChange will first clear the Canvas and then call makeTriangle function. In this example, makeTriangle consist of 3 drawLine functions for every line in the triangle. This shape is used only for presentation purposes, but it can be really anything.&lt;br /&gt;
&lt;br /&gt;
Here is how it looks.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.blogger.com/video.g?token=AD6v5dzGaXUxaj92Q1VbfzOXsvmbuHfWI_khpzuFc34vswrTZXQ3J-KBCawkzZ2JHCWC8xQlZBlkwJoQAPdt9EBpqg&#39; class=&#39;b-hbp-video b-uploaded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;
note: Sliders values can change with keyboard also, using tab and left and right arrow and shift tab to go up.&lt;br /&gt;
&lt;br /&gt;
index.html
&lt;br /&gt;
&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:90%;height:auto;overflow:auto;background:#f0f0f0;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 charset=&quot;utf-8&quot;&amp;gt;  
     &amp;lt;title&amp;gt;Sliders example&amp;lt;/title&amp;gt;  
         &amp;lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;styles.css&quot;&amp;gt;  
   &amp;lt;/head&amp;gt;  
   &amp;lt;body&amp;gt;  
   &amp;lt;div id=&quot;menu&quot; style=&quot;width:160px;float:left;&quot;&amp;gt;  
   &amp;lt;p&amp;gt;  
     Ax: &amp;lt;input type=&quot;range&quot; class=&quot;styled-input&quot; id=&quot;ax&quot; value=&quot;300&quot; min=&quot;0&quot; max=&quot;600&quot; step=&quot;20&quot;&amp;gt;&amp;lt;br&amp;gt;  
     Ay: &amp;lt;input type=&quot;range&quot; class=&quot;styled-input&quot; id=&quot;ay&quot; value=&quot;20&quot; min=&quot;0&quot; max=&quot;500&quot; step=&quot;20&quot;&amp;gt;&amp;lt;br&amp;gt;  
     Bx: &amp;lt;input type=&quot;range&quot; class=&quot;styled-input&quot; id=&quot;bx&quot; value=&quot;100&quot; min=&quot;0&quot; max=&quot;600&quot; step=&quot;20&quot;&amp;gt;&amp;lt;br&amp;gt;  
     By: &amp;lt;input type=&quot;range&quot; class=&quot;styled-input&quot; id=&quot;by&quot; value=&quot;50&quot; min=&quot;0&quot; max=&quot;500&quot; step=&quot;20&quot;&amp;gt;&amp;lt;br&amp;gt;  
     Cx: &amp;lt;input type=&quot;range&quot; class=&quot;styled-input&quot; id=&quot;cx&quot; value=&quot;400&quot; min=&quot;0&quot; max=&quot;600&quot; step=&quot;20&quot;&amp;gt;&amp;lt;br&amp;gt;  
         Cy: &amp;lt;input type=&quot;range&quot; class=&quot;styled-input&quot; id=&quot;cy&quot; value=&quot;500&quot; min=&quot;0&quot; max=&quot;500&quot; step=&quot;20&quot;&amp;gt;&amp;lt;br&amp;gt;  
         &amp;lt;br&amp;gt;  
   &amp;lt;/p&amp;gt;  
   &amp;lt;/div&amp;gt;  
   &amp;lt;div id=&quot;content&quot; style=&quot;background-color:#EEEEEE;float:left;&quot;&amp;gt;  
   &amp;lt;canvas id=&quot;myCanvas&quot; width=&quot;600&quot; height=&quot;500&quot; style=&quot;border:1px solid #d3d3d3;&quot;&amp;gt;  
   Your browser does not support the HTML5 canvas tag.&amp;lt;/canvas&amp;gt;  
   &amp;lt;/div&amp;gt;  
     &amp;lt;script src=&quot;app.js&quot;&amp;gt;&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;br /&gt;
styles.css
&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:90%;height:auto;overflow:auto;background:#f0f0f0;padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; p {  
     font-family:&#39;Lucida Grande&#39;,Tahoma,Verdana,Arial,Sans-serif;   
     font-size:11px;   
     font-weight:700;  
     width:50px;  
 }  
    
 .styled-input {   
     -webkit-box-shadow:rgba(0,0,0,0.98) 0 1px 0 0;   
     -moz-box-shadow:rgba(0,0,0,0.98) 0 1px 0 0;   
     box-shadow:rgba(0,0,0,0.98) 0 1px 0 0;   
     background-color:#EEE;   
     border-radius:0;   
     -webkit-border-radius:0;   
     -moz-border-radius:0;   
     border:1px solid #999;   
     color:#666;   
     font-family:&#39;Lucida Grande&#39;,Tahoma,Verdana,Arial,Sans-serif;   
     font-size:11px;   
     font-weight:700;   
     padding:1px 3px;   
     height:20px   
 }   
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
app.js
&lt;pre  style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:90%;height:auto;overflow:auto;background:#f0f0f0;padding:0px;color:#000000;text-align:left;line-height:20px;&quot;&gt;&lt;code style=&quot;color:#000000;word-wrap:normal;&quot;&gt; &quot;use strict&quot;;  
 var currCanvas = &quot;myCanvas&quot;;  
   
 var slider_ax = document.getElementById(&#39;ax&#39;);  
 slider_ax.addEventListener(&#39;input&#39;, onSliderChange);  
   
 var slider_ay = document.getElementById(&#39;ay&#39;);  
 slider_ay.addEventListener(&#39;input&#39;, onSliderChange);  
   
 var slider_bx = document.getElementById(&#39;bx&#39;);  
 slider_bx.addEventListener(&#39;input&#39;, onSliderChange);  
   
 var slider_by = document.getElementById(&#39;by&#39;);  
 slider_by.addEventListener(&#39;input&#39;, onSliderChange);  
   
 var slider_cx = document.getElementById(&#39;cx&#39;);  
 slider_cx.addEventListener(&#39;input&#39;, onSliderChange);  
   
 var slider_cy = document.getElementById(&#39;cy&#39;);  
 slider_cy.addEventListener(&#39;input&#39;, onSliderChange);  
   
 function drawLine(x1, y1, x2, y2, ccanvas) {  
   var ctx = document.getElementById(ccanvas).getContext(&quot;2d&quot;);  
   ctx.beginPath();  
   ctx.moveTo(x1, y1);  
   ctx.lineTo(x2, y2);    
   ctx.lineWidth = 3;  
   ctx.strokeStyle = &#39;black&#39;;  
   ctx.stroke();  
 }  
   
 function makeTriangle(ax, ay, bx, by, cx, cy, ccanvas) {  
     drawLine(ax, ay, bx, by, ccanvas);  
     drawLine(bx, by, cx, cy, ccanvas);  
     drawLine(cx, cy, ax, ay, ccanvas);  
 }  
   
 function onSliderChange() {  
     // update canvas on any slider change  
   var c = document.getElementById(&quot;myCanvas&quot;),  
   ctx = c.getContext(&quot;2d&quot;);  
     ctx.clearRect(0, 0, 600, 500);      
     makeTriangle(slider_ax.value, slider_ay.value, slider_bx.value, slider_by.value, slider_cx.value, slider_cy.value, currCanvas);  
 }  
   
 makeTriangle(slider_ax.value, slider_ay.value, slider_bx.value, slider_by.value, slider_cx.value, slider_cy.value, currCanvas);  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
*_*&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://flanture.blogspot.com/feeds/7652955561685854485/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://flanture.blogspot.com/2020/01/simple-reactive-javascript-sliders-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/7652955561685854485'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/7652955561685854485'/><link rel='alternate' type='text/html' href='http://flanture.blogspot.com/2020/01/simple-reactive-javascript-sliders-and.html' title='Simple Reactive JavaScript sliders and drawing on Canvas'/><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><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932984404072302429.post-5590055725039062263</id><published>2020-01-19T14:18:00.000-08:00</published><updated>2020-01-19T14:18:46.457-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="game development"/><category scheme="http://www.blogger.com/atom/ns#" term="gamedev"/><category scheme="http://www.blogger.com/atom/ns#" term="games"/><category scheme="http://www.blogger.com/atom/ns#" term="indie"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="screenshotsaturday"/><category scheme="http://www.blogger.com/atom/ns#" term="twitter"/><category scheme="http://www.blogger.com/atom/ns#" term="Unity"/><category scheme="http://www.blogger.com/atom/ns#" term="workinprogress"/><title type='text'>Game Development Screenshot Saturday Episode 1</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Hello and welcome to my blog if you are first time visitor.&lt;br /&gt;
&lt;br /&gt;
Here are my TOP 5 Indie Game Development Screenshots for this week.&lt;br /&gt;
&lt;br /&gt;
For more cool stuff please follow me on Twitter &amp;gt;&amp;gt; &lt;a href=&quot;https://twitter.com/flanture&quot; target=&quot;_blank&quot;&gt;FLANTURE&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Minute of Islands by @minuteofislands&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJZop843yxPvyySkFuBbIY3Jpc_2JUYerrcjM2T5wv1nYMzu0A2EQmymAOdyPlcyFclIW5ZXrVIqCgqZ0fc9BLx_ih_nsgaNHmE_v_Nrujjc2Yj4dbqNuD8vCU0LFuJsIx_ykHwQmsWA6P/s1600/n5.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;483&quot; data-original-width=&quot;642&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJZop843yxPvyySkFuBbIY3Jpc_2JUYerrcjM2T5wv1nYMzu0A2EQmymAOdyPlcyFclIW5ZXrVIqCgqZ0fc9BLx_ih_nsgaNHmE_v_Nrujjc2Yj4dbqNuD8vCU0LFuJsIx_ykHwQmsWA6P/s400/n5.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
4. BattleTronik by @fracteed made with Godot engine.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXtvwlZ2YHJL0Mfr-VCXaPGeJNuLk3Jsu6LbOFco7qEA-cZUBYDCBSLX5T27cfHseWaQ0f2Pnv7riNgiZC1rEpJI_LrQB4AVjHhw9ScS2BZKypQ_nlmnDPZdO-de1ONI1wsUBHxOTvKJY0/s1600/n4.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;493&quot; data-original-width=&quot;619&quot; height=&quot;317&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXtvwlZ2YHJL0Mfr-VCXaPGeJNuLk3Jsu6LbOFco7qEA-cZUBYDCBSLX5T27cfHseWaQ0f2Pnv7riNgiZC1rEpJI_LrQB4AVjHhw9ScS2BZKypQ_nlmnDPZdO-de1ONI1wsUBHxOTvKJY0/s400/n4.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
3. Early morning screenshot by @claudio_tulio made with Unity&lt;a aria-haspopup=&quot;false&quot; class=&quot;css-4rbku5 css-18t94o4 css-1dbjc4n r-1loqt21 r-1wbh5a2 r-dnmrzs r-1ny4l3l&quot; data-focusable=&quot;true&quot; href=&quot;https://twitter.com/Claudio_Tulio&quot; role=&quot;link&quot; style=&quot;-webkit-box-align: stretch; -webkit-box-direction: normal; -webkit-box-orient: vertical; align-items: stretch; border: 0px solid black; box-sizing: border-box; cursor: pointer; display: inline !important; flex-basis: auto; flex-direction: column; flex-shrink: 1; font: inherit; list-style: none; margin: 0px; max-width: 100%; min-height: 0px; min-width: 0px; outline: none; padding: 0px; position: relative; text-align: inherit; text-decoration-line: none; z-index: 0;&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijusuPdJ9uBYLfhwnoRB0h0pL-n1jOoBP5woae3m8smGt5CwzVKD2vl0n-kFNpFbXhjTqpUmjBJwC5Wl6claQT43127p7sbTVJ6iBDuMBal_8aXR9KIzjbmBCwsiIycCY4Nfd-oMNaEm1a/s1600/n3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;456&quot; data-original-width=&quot;616&quot; height=&quot;295&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijusuPdJ9uBYLfhwnoRB0h0pL-n1jOoBP5woae3m8smGt5CwzVKD2vl0n-kFNpFbXhjTqpUmjBJwC5Wl6claQT43127p7sbTVJ6iBDuMBal_8aXR9KIzjbmBCwsiIycCY4Nfd-oMNaEm1a/s400/n3.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
2. This game is also being created with Unity by @thebigfatjay and it looks great!&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjw3vI6jzkUlhc9_tBUkuHuVZcjf7P_8Fz0BbDHq_K_E-T5KSE4W18CdEADdiw9Wm0X0IV3rSQjLnb5krcBhu7xx0MkUrlRNIGth8lbClrxcno-LSire0KbMVqvkK72IBfSuhTAJh34oyw3/s1600/n2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;399&quot; data-original-width=&quot;641&quot; height=&quot;248&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjw3vI6jzkUlhc9_tBUkuHuVZcjf7P_8Fz0BbDHq_K_E-T5KSE4W18CdEADdiw9Wm0X0IV3rSQjLnb5krcBhu7xx0MkUrlRNIGth8lbClrxcno-LSire0KbMVqvkK72IBfSuhTAJh34oyw3/s400/n2.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
1. My favorite screenshot this week is from game Vernal Edge by @hymynameismatt&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdJKR6MrjisPgWfl-8oa-YjD8QLKFBu91D_Vsm8YZ3tR2dyXH7jCYLpSO6XjTi0jPBH7djRhDS93jStSNbNUG_q4wCb5Lfc_OypKotBUgmFHtun8JciLWkV6rpV1mAhXqv8iBpmuAtFqaW/s1600/n1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;360&quot; data-original-width=&quot;643&quot; height=&quot;223&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdJKR6MrjisPgWfl-8oa-YjD8QLKFBu91D_Vsm8YZ3tR2dyXH7jCYLpSO6XjTi0jPBH7djRhDS93jStSNbNUG_q4wCb5Lfc_OypKotBUgmFHtun8JciLWkV6rpV1mAhXqv8iBpmuAtFqaW/s400/n1.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I hope you liked these shots from work in progress games.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Once again, follow me on twitter &amp;gt;&amp;gt; &lt;a href=&quot;http://www.twitter.com/flanture&quot; target=&quot;_blank&quot;&gt;FLANTURE&lt;/a&gt; and more screenshots next week.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://flanture.blogspot.com/feeds/5590055725039062263/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://flanture.blogspot.com/2020/01/game-development-screenshot-saturday.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/5590055725039062263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/5590055725039062263'/><link rel='alternate' type='text/html' href='http://flanture.blogspot.com/2020/01/game-development-screenshot-saturday.html' title='Game Development Screenshot Saturday Episode 1'/><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://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJZop843yxPvyySkFuBbIY3Jpc_2JUYerrcjM2T5wv1nYMzu0A2EQmymAOdyPlcyFclIW5ZXrVIqCgqZ0fc9BLx_ih_nsgaNHmE_v_Nrujjc2Yj4dbqNuD8vCU0LFuJsIx_ykHwQmsWA6P/s72-c/n5.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932984404072302429.post-3749554240831299313</id><published>2019-10-01T15:12:00.000-07:00</published><updated>2019-10-01T15:12:12.109-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="HTML"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML5"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="quiz"/><category scheme="http://www.blogger.com/atom/ns#" term="web development"/><title type='text'>Learn HTML - Quiz for beginners</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Take this short quiz for beginners to start learning about HTML. Hover for answer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Question 1: &lt;span style=&quot;background-color: #d9ead3;&quot;&gt;The head element is placed between which two tags?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;body and script&lt;/li&gt;
&lt;li&gt;body and h1&lt;/li&gt;
&lt;li&gt;html and body&lt;/li&gt;
&lt;li&gt;h1 and h3&lt;/li&gt;
&lt;/ol&gt;
&lt;div title=&quot;Number 3 is correct&quot;&gt;
&lt;span style=&quot;background-color: lime; margin-left: 25px;&quot;&gt;&amp;nbsp;Answer&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Question 2: &lt;span style=&quot;background-color: #d9ead3;&quot;&gt;Which tag does not describe metadata?&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;meta&lt;/li&gt;
&lt;li&gt;script&lt;/li&gt;
&lt;li&gt;title&lt;/li&gt;
&lt;li&gt;data&lt;/li&gt;
&lt;/ol&gt;
&lt;div title=&quot;Number 4 is correct&quot;&gt;
&lt;span style=&quot;background-color: lime; margin-left: 25px;&quot;&gt;&amp;nbsp;Answer&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Question 3: &lt;span style=&quot;background-color: #d9ead3;&quot;&gt;Which element does not have end tag?&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;html&lt;/li&gt;
&lt;li&gt;body&lt;/li&gt;
&lt;li&gt;script&lt;/li&gt;
&lt;li&gt;none of the above&lt;/li&gt;
&lt;/ol&gt;
&lt;div title=&quot;Number 4 is correct&quot;&gt;
&lt;span style=&quot;background-color: lime; margin-left: 25px;&quot;&gt;&amp;nbsp;Answer&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Question 4: &lt;span style=&quot;background-color: #d9ead3;&quot;&gt;There is only one valid comment among next answers, which one?&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&amp;lt;!&lt;b&gt;-&amp;nbsp;&lt;/b&gt;Valid comment&lt;b&gt;&amp;nbsp;-&lt;/b&gt;&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;!&lt;b&gt;--&amp;nbsp;&lt;/b&gt;Valid comment&lt;b&gt;&amp;nbsp;--&lt;/b&gt;&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;!&lt;b&gt;&amp;nbsp;&lt;/b&gt;Valid comment&lt;b&gt;&amp;nbsp;&lt;/b&gt;&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;!&lt;b&gt;--&amp;nbsp;&lt;/b&gt;Valid comment&lt;b&gt;&amp;nbsp;-&lt;/b&gt;&amp;gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div title=&quot;Number 2 is correct&quot;&gt;
&lt;span style=&quot;background-color: lime; margin-left: 25px;&quot;&gt;&amp;nbsp;Answer&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Question 5: &lt;span style=&quot;background-color: #d9ead3;&quot;&gt;What tag is used to display smallest heading?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;H1&lt;/li&gt;
&lt;li&gt;H6&lt;/li&gt;
&lt;li&gt;H10&lt;/li&gt;
&lt;li&gt;HS&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;div title=&quot;Number 2 is correct&quot;&gt;
&lt;span style=&quot;background-color: lime; margin-left: 25px;&quot;&gt;Answer&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
This is just a start. Quiz will be regularly updated. Stay tuned.&lt;br /&gt;
&lt;br /&gt;
How many answers did you get correctly out of 5?&lt;br /&gt;
&lt;br /&gt;
*_*&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://flanture.blogspot.com/feeds/3749554240831299313/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://flanture.blogspot.com/2019/10/learn-html-quiz-for-beginners.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/3749554240831299313'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/3749554240831299313'/><link rel='alternate' type='text/html' href='http://flanture.blogspot.com/2019/10/learn-html-quiz-for-beginners.html' title='Learn HTML - Quiz for beginners'/><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><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932984404072302429.post-6569900777690426425</id><published>2019-03-21T14:59:00.000-07:00</published><updated>2019-03-21T14:59:25.345-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="animations"/><category scheme="http://www.blogger.com/atom/ns#" term="code"/><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><category scheme="http://www.blogger.com/atom/ns#" term="CSS3"/><category scheme="http://www.blogger.com/atom/ns#" term="examples"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML5"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorials"/><title type='text'>Game of Thrones Final Season CSS Intro Animation</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
While waiting for White Walkers to kill us all, I&#39;ve decided to play a little bit more with CSS animations.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
This simple text intro have 4 keyframes where letter-spacing is changing, creating interesting movie-like effect. Title text is fading in from black to white and subtitle appears at the end giving the animation dramatic ending, which is expected from this kind of show.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
In this case animation lasts for 3 seconds, feel free to play with parameters as you like.&lt;/div&gt;
&lt;br /&gt;
Here is the code and demo:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQvM8UQqleq4CsnpYsbD77jXtxY-xDUlJWkW0p8lzWNj-j5MnEcIT-4qOhZROTE7AkMp4jK1mZnXpT4ttb4G42lAyCSfx8wz705AamWW382F3AmtKbAw0aWtm6vyfJwLNYfRK8I0eyQ42d/s1600/gotanimation.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;392&quot; data-original-width=&quot;744&quot; height=&quot;210&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQvM8UQqleq4CsnpYsbD77jXtxY-xDUlJWkW0p8lzWNj-j5MnEcIT-4qOhZROTE7AkMp4jK1mZnXpT4ttb4G42lAyCSfx8wz705AamWW382F3AmtKbAw0aWtm6vyfJwLNYfRK8I0eyQ42d/s400/gotanimation.gif&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre style=&quot;font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:90%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQrWOI5UQeNjk1kFUHmqx1O8A3QtiF6oEmEpFkpZRhg2q86Lzwb3rnpaKhYeytajc197I_ilHhMpKDCiQoeR6hcYOBMYaBDRoib_edIL1YstqvWi5zEufSz4QWhTA9Q02NP6d2XmmUDE9h/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 charset=&quot;utf-8&quot;&amp;gt;  
      &amp;lt;title&amp;gt;Game of Thrones intro&amp;lt;/title&amp;gt;  
      &amp;lt;style&amp;gt;  
      * {  
           padding: 0;  
           margin: 0;  
           font-family: sans-serif;  
      }  
      body {  
           background: #000;  
      }  
      .container {  
           text-align: center;  
           position: absolute;  
           top: 50%;  
           left: 50%;  
           transform: translate(-50%,-50%);  
      }  
      .container span {  
           text-transform: uppercase;  
           display: block;  
      }  
      .text_title {  
           color: white;  
           font-size: 60px;  
           font-weight: 700;  
           letter-spacing: 8px;  
           margin-bottom: 20px;  
           background: black;  
           position: relative;  
           animation: text 3s 1;  
      }  
      .text_subtitle {  
           font-size: 30px;  
           color: #5DADE2;  
      }  
      @keyframes text {  
           0% {  
                color: black;  
                margin-bottom: -40px;  
           }  
           25% {  
                letter-spacing: 25px;  
                margin-bottom: -40px;  
           }  
           75% {  
                letter-spacing: 5px;  
                margin-bottom: -40px;  
           }  
           95% {  
                letter-spacing: 8px;  
           }  
      }       
      &amp;lt;/style&amp;gt;  
  &amp;lt;/head&amp;gt;  
 &amp;lt;body&amp;gt;  
  &amp;lt;div class=&quot;container&quot;&amp;gt;  
   &amp;lt;span class=&quot;text_title&quot;&amp;gt;Game of Thrones&amp;lt;/span&amp;gt;  
      &amp;lt;span class=&quot;text_subtitle&quot;&amp;gt;final season&amp;lt;/span&amp;gt;  
  &amp;lt;/div&amp;gt;  
 &amp;lt;/body&amp;gt;  
 &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;

The Spring is coming! Happy Coding :)

*_*
</content><link rel='replies' type='application/atom+xml' href='http://flanture.blogspot.com/feeds/6569900777690426425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://flanture.blogspot.com/2019/03/game-of-thrones-final-season-css-intro.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/6569900777690426425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/6569900777690426425'/><link rel='alternate' type='text/html' href='http://flanture.blogspot.com/2019/03/game-of-thrones-final-season-css-intro.html' title='Game of Thrones Final Season CSS Intro Animation'/><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://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQvM8UQqleq4CsnpYsbD77jXtxY-xDUlJWkW0p8lzWNj-j5MnEcIT-4qOhZROTE7AkMp4jK1mZnXpT4ttb4G42lAyCSfx8wz705AamWW382F3AmtKbAw0aWtm6vyfJwLNYfRK8I0eyQ42d/s72-c/gotanimation.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-932984404072302429.post-503968304524091398</id><published>2019-03-01T08:25:00.000-08:00</published><updated>2019-03-01T08:25:53.469-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><category scheme="http://www.blogger.com/atom/ns#" term="examples"/><category scheme="http://www.blogger.com/atom/ns#" term="google"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorials"/><category scheme="http://www.blogger.com/atom/ns#" term="web design"/><category scheme="http://www.blogger.com/atom/ns#" term="web development"/><title type='text'>How To use Google Fonts in your projects</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
This is tutorial for beginners in web design but also a self reminder. &lt;br /&gt;&lt;br /&gt;If
 you want to build a website sometimes it is not enough to have only 
fonts already available on user computer. Those fonts are limited in 
number and more generic. Best way to include more fonts and make design 
more fun is to use fonts hosted on external server like Google Fonts. &lt;br /&gt;&lt;br /&gt;Navigate
 to fonts.google.com and select the fonts you want. Currently there are 
915 font families hosted on this server and it is likely this number 
will grow. Search for the fonts you want and select them by clicking on 
red circle with plus sign on top right side of the font.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqfw_gYKDbwksJ5LB26Zo9ON7bM4ZSa1z6ifr6t0ZXAfUMcD_dnbBKKIWnl24__AjJVuvPfWwYZY2_W22iyDoE7dfKPbKMSOKZk0oeJSFDEXj6Km8-HvH0IzbsPJj7KC9WZO6dwH3BCU5t/s1600/googlefonts1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;551&quot; data-original-width=&quot;750&quot; height=&quot;468&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqfw_gYKDbwksJ5LB26Zo9ON7bM4ZSa1z6ifr6t0ZXAfUMcD_dnbBKKIWnl24__AjJVuvPfWwYZY2_W22iyDoE7dfKPbKMSOKZk0oeJSFDEXj6Km8-HvH0IzbsPJj7KC9WZO6dwH3BCU5t/s640/googlefonts1.jpg&quot; width=&quot;640&quot; /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
When you are done selecting fonts, click on black rectangle at the bottom of the page. &lt;br /&gt;&lt;br /&gt;Then select @import option and copy everything between style tag.&amp;nbsp; &lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjv9GtGtIFFrz9qfoQBjSL0g0wqdgyV4bJSc2hYIYuVDrchczJ1cs8iPhyl2LgOA76Mzi-wdhVRnM4HdRpFrd46oOcQH2qrzntJTRwJXRL5bYlXixkiz7uSYmYLcH7_uj-PR6O5Fie6KnSr/s1600/googlefonts2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;530&quot; data-original-width=&quot;750&quot; height=&quot;451&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjv9GtGtIFFrz9qfoQBjSL0g0wqdgyV4bJSc2hYIYuVDrchczJ1cs8iPhyl2LgOA76Mzi-wdhVRnM4HdRpFrd46oOcQH2qrzntJTRwJXRL5bYlXixkiz7uSYmYLcH7_uj-PR6O5Fie6KnSr/s640/googlefonts2.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Paste selected text into your css file and you are done. Doing this you won&#39;t need to worry if users have fonts you wanna use, unless Google shuts down this service when company collapses in few hundred years. &lt;/div&gt;
&lt;br /&gt;
*_*&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://flanture.blogspot.com/feeds/503968304524091398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://flanture.blogspot.com/2019/03/how-to-use-google-fonts-in-your-projects.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/503968304524091398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/932984404072302429/posts/default/503968304524091398'/><link rel='alternate' type='text/html' href='http://flanture.blogspot.com/2019/03/how-to-use-google-fonts-in-your-projects.html' title='How To use Google Fonts in your projects'/><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://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqfw_gYKDbwksJ5LB26Zo9ON7bM4ZSa1z6ifr6t0ZXAfUMcD_dnbBKKIWnl24__AjJVuvPfWwYZY2_W22iyDoE7dfKPbKMSOKZk0oeJSFDEXj6Km8-HvH0IzbsPJj7KC9WZO6dwH3BCU5t/s72-c/googlefonts1.jpg" height="72" width="72"/><thr:total>0</thr:total></entry></feed>