<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hannan</title>
    <description>The latest articles on DEV Community by Hannan (@hannankhan).</description>
    <link>https://dev.to/hannankhan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F596492%2F47dbb359-0674-44a8-9445-f2ba0824b26d.PNG</url>
      <title>DEV Community: Hannan</title>
      <link>https://dev.to/hannankhan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hannankhan"/>
    <language>en</language>
    <item>
      <title>Getting Started with The IBM zStudent Contest 2022 | Everything You Need to Know</title>
      <dc:creator>Hannan</dc:creator>
      <pubDate>Tue, 01 Nov 2022 17:40:30 +0000</pubDate>
      <link>https://dev.to/hannankhan/getting-started-with-the-ibm-zstudent-contest-2022-everything-you-need-to-know-4014</link>
      <guid>https://dev.to/hannankhan/getting-started-with-the-ibm-zstudent-contest-2022-everything-you-need-to-know-4014</guid>
      <description>&lt;p&gt;The IBM zStudent Contest is an annual coding contest centered around sustainable energy and enterprise computing. It is sponsored by IBM zXplore and, and powered by HackerEarth. You’ll get a chance to compete for global and regional cash prizes, and get a chance to learn some major computing skills, such as JCL, z/OS, SQL, COBOL, Python, APIs, Unix and more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Requirements&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In order to start the contest you need sign up for the IBM zXplore platform and complete the Fundamentals and Concepts levels, and earn your IBM zXplore Concepts Badge.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff8yak6q0nt818y8d4hp2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff8yak6q0nt818y8d4hp2.png" alt="Contest Requirements" width="800" height="309"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Contest&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The contest is divided in 6 different sections (or drops as they are called). You will need to work on your own, as it Is a solo contest&lt;/p&gt;

&lt;p&gt;You can head over to &lt;a href="https://ibmzxplore.influitive.com/users/sign_up?join-code=internationalconnector"&gt;IBM zXplore&lt;/a&gt; to get started.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff9b84ntlie5l4pv5fvf4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff9b84ntlie5l4pv5fvf4.png" alt="IBM zStudent Contest Timeline" width="800" height="309"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The theme of the contest is sustainability. IBM is a longstanding leader in environmental sustainability and the IBM z16 was designed to make a powerful improvement in sustainability intentional and by design. The features on the z16 enable a smaller energy footprint by reducing costs in every aspect. The zSystems machine performances reduce overall system power consumption, require less floor space and reduce CO2 emissions compared to an x86 server.&lt;/p&gt;

&lt;p&gt;To go along with the zSystems machines sustainability, this contest is focused on using your skills on IBM zSystems to meet the sustainability goal of identifying, locating and acquiring the components of a fuel cell to power your zMobile.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prizes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F50e9mik8ssh7mihse42g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F50e9mik8ssh7mihse42g.png" alt="IBM zStudent Contest 2022 Prizes " width="800" height="309"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The cash prizes will be awarded in two categories. If you are selected in on, you will not be considered for the other one and vice versa&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Grand Prize – Global Winners (3) | USD 1,500 each&lt;/li&gt;
&lt;li&gt;Regional Prize – Regional Winners (6) | USD 1,000 each

&lt;ol&gt;
&lt;li&gt;Asia Pacific&lt;/li&gt;
&lt;li&gt;Middle East and Africa&lt;/li&gt;
&lt;li&gt;Europe&lt;/li&gt;
&lt;li&gt;Latin America&lt;/li&gt;
&lt;li&gt;North America&lt;/li&gt;
&lt;li&gt;India&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even if you are not selected among the finalist prize winners, do not fret. All contenders that submit their project, no matter if it is incorrect, will receive a badge to show their contribution in the 2022 zStudent Contest.&lt;/p&gt;

&lt;p&gt;Getting registered for the contest&lt;/p&gt;

&lt;p&gt;To get yourself registered for the contest, first head over the HackerEarth Sign-up &lt;a href="https://ibm.biz/contest-IC"&gt;page.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvi29sj0xokxx3k0e7nh7.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvi29sj0xokxx3k0e7nh7.PNG" alt="SS_01" width="800" height="380"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you're at the Sign-up page, you'll see a blue button that says "Register Now". Once you click this button you can fill in your personal information and start the registration process for the 2022 contest.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F411k850w1n4nh6pttmwt.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F411k850w1n4nh6pttmwt.PNG" alt="SS_02" width="707" height="694"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enter your school, and what region you are participating from. Make sure to enter the correct info. Your regional prize qualification will depend on whichever region you select.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft1xai05l2v5d6xlfgoi2.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft1xai05l2v5d6xlfgoi2.PNG" alt="SS_03" width="654" height="726"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You'll also be prompted to enter your skillset. You can skip this section if you so choose.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvnx4ks79j1vl7ww2fs2l.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvnx4ks79j1vl7ww2fs2l.PNG" alt="SS_04" width="523" height="615"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you are done, you'll receive a confirmation email to your registered email address. You need to confirm your email associated with your zXplore account to proceed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3z2wfuh8wxxt1za0w28g.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3z2wfuh8wxxt1za0w28g.PNG" alt="SS_05" width="800" height="456"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you've confirmed your email, you can head over to IBM zXplore and navigate to the IBM zStudent Contest section. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdwrvcwt3x4ndtq2g4qj6.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdwrvcwt3x4ndtq2g4qj6.PNG" alt="SS_06" width="800" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you're there, you'll be able to see the drops as they occur and track your progress. All of the tracks that you need to complete will appear here.&lt;/p&gt;

&lt;p&gt;This is all you need to know to get started with the 2022 IBM zStudent Contest. Best of luck &amp;amp; happy coding!&lt;/p&gt;

</description>
      <category>ibm</category>
      <category>mainframe</category>
      <category>studentcontest</category>
    </item>
    <item>
      <title>IBM zDay 2022 Recap: Speaking at zDay for The First Time | Optimizing Sustainability with LinuxOne</title>
      <dc:creator>Hannan</dc:creator>
      <pubDate>Wed, 19 Oct 2022 20:06:31 +0000</pubDate>
      <link>https://dev.to/hannankhan/ibm-zday-2022-recap-speaking-at-zday-for-the-first-time-optimizing-sustainability-with-linuxone-3geg</link>
      <guid>https://dev.to/hannankhan/ibm-zday-2022-recap-speaking-at-zday-for-the-first-time-optimizing-sustainability-with-linuxone-3geg</guid>
      <description>&lt;p&gt;IBM zDay is a free one-day virtual conference event hosted by IBM about all things IBM zSystems. Global thought leaders come together to highlight industry trends, Innovations in AI, Quantum Computing, Mainframes, and a lot more! I had the pleasure of being invited to speak at zDay 2022 and open for Dr. Fan Jing Meng from IBM China, conducting a demonstration on the new IBM LinuxOne Emperor 4 and it’s impact on energy consumption.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftbj41kzif9a8hqe8pj7x.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftbj41kzif9a8hqe8pj7x.PNG" alt="Speaker Lineup" width="800" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Speaker Lineup&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;zDay 2022 boasted a speaker lineup of some of the biggest names in Tech and Enterprise Computing such as Linus Sebastian from Linus Tech Tips, Ross Mauri—General Manager at IBM Systems, John Mertic—Program Director at The Linux Foundation, Meredith Stowell—VP at IBM Ecosystems, and many other industry&lt;br&gt;
leaders.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj8ssk5rgo3fpsx2ahdi6.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj8ssk5rgo3fpsx2ahdi6.PNG" alt="Team Intro" width="800" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Optimizing Sustainability&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;My session focused on the effects of big data on the environment and what can be done for the “greening” of the IT sector. According to a report by IBM—titled “IT sustainability beyond the data center, Decarbonizing with hybrid cloud”—Collectively, data centers around the world consume 200 to 250 terawatt-hours (TWh) of electricity, according to the International Energy Agency (IEA). That’s roughly 1% of global electricity demand and approximately 0.3% of all global carbon emissions.9 Demand for data centers and network services will only continue to grow in the future, consuming even more electricity and producing even more carbon. Some estimates suggest that there has been a 43% absolute increase in the power capacity demand by data center operators between 2018 and 2021, and that the global data center market will grow by more than 30% between 2021 and 2027.10 Therefore, action to support further efficiency improvements, lower energy consumption, and reduced carbon impact from data centers is critical.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;IBM Z Linux One&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj9s9a97o59u49aj7sa0c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj9s9a97o59u49aj7sa0c.png" alt="LinuxONE Emperor 4" width="720" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is where IBM’s new LinuxOne Emperor 4 system comes in. It helps organizations that care about achieving sustainability goals reduce energy costs and carbon footprint with a secure high-performance server platform for data-intensive workloads. To learn more about the IBM LinuxONE Emperor 4, head over to the &lt;a href="https://www.ibm.com/products/linuxone-emperor-4"&gt;website&lt;/a&gt; and read more about how it can benefit your organization.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5vt81cuii2l6bcxr2f3l.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5vt81cuii2l6bcxr2f3l.PNG" alt="LinuxOne Stats" width="800" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want to watch the entire demo and all of the other sessions from zDay 2022. Head over to the event website to get free access to the replays &lt;a href="https://ibmzday.bemyapp.com/2022"&gt;here.&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ibm</category>
      <category>linux</category>
      <category>linuxone</category>
      <category>sustainability</category>
    </item>
    <item>
      <title>A Recap of GitHub Field Day Pakistan 2022</title>
      <dc:creator>Hannan</dc:creator>
      <pubDate>Mon, 01 Aug 2022 21:49:48 +0000</pubDate>
      <link>https://dev.to/hannankhan/a-recap-of-github-field-day-pakistan-2022-1g5g</link>
      <guid>https://dev.to/hannankhan/a-recap-of-github-field-day-pakistan-2022-1g5g</guid>
      <description>&lt;p&gt;So as everyone who’s anyone in the Islamabad tech community knows, we held Pakistan’s first ever GitHub Field in Pakistan. As an organizer and avid advocate for community building it was an extraordinary experience.&lt;/p&gt;

&lt;p&gt;A little history for the people that are not familiar with Field Day. It is a regional unconference (a participant-driven meeting) for leaders of technical student communities. Field Day brings together student leaders from different regional communities to hang out, become friends, learn from each other's mistakes and successes, and solve shared problems. It is powered by GitHub Education and is hosted all around the globe.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl843ry61zmmsgktjds96.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl843ry61zmmsgktjds96.png" alt="'Field Day attendees gather outside NIC Islamabad for a group photoshoot'" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Field Day Pakistan was made possible in Islamabad this Sunday due to the very hospitable people at the National Incubation Center ISB. People from all major tech communities showed presence. Microsoft Learn Student Ambassadors, Google Developer Student Club members, and GitHub Campus Experts to name a few, students from universities across Pakistan got a chance to get together and chew over their favourite topic —Tech.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fofnj41ujw2w25z7xngv1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fofnj41ujw2w25z7xngv1.png" alt="'Keynote Speaker Huzaifa Habib giving a talk on the roles of tech communities'" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The main theme of the event was Community Building, keynote speaker Huzaifa Habib (Community Manager Associate at Turing) gave an excellent talk on the roles of tech communities, a topic of interest among those who would like to impact people with their work as members of the tech community.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0lt71vd8vjwfihonv8sa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0lt71vd8vjwfihonv8sa.png" alt="Image description" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But it was not all talk but a lot of lighthearted fun and games as well. Attendees enjoyed playing pool and ping pong while mingling with their peers. There was also pizza (I guess no tech event is really complete without it these days) and that too of the crown crust variety. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0iq61adm9gc8pr36tkjd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0iq61adm9gc8pr36tkjd.png" alt="Image description" width="800" height="1200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This was completely a group effort and nearly impossible without the help of everyone involved. Arsalan Khattak, GitHub Field Expert for arranging the event, Raheel Siddiqui and Abubakar Sattar, GitHub Campus Experts, for their help and support, and all the others who made it all happen. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fctk0z5j3pba3isx9qize.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fctk0z5j3pba3isx9qize.png" alt="Image description" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;No tech event can be initiated without what we all truly come for—Free swag packs. GitHub Field Day Pakistan 2022 not without its swag, and awesome ones at that.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fetn5xs2hn6ax8qwvv9tb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fetn5xs2hn6ax8qwvv9tb.png" alt="Image description" width="800" height="653"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can follow the event news at #GHFieldDayPK and stay in the loop with future Field Day events @GHFieldDayPakistan on all socials. The next one may be held in a certain city of Pakistan which some swear is a whole country in itself. &lt;/p&gt;

</description>
      <category>github</category>
      <category>ghfieldday</category>
      <category>ghfielddaypk</category>
      <category>fieldday</category>
    </item>
    <item>
      <title>The World of GitHub, Version Control Systems</title>
      <dc:creator>Hannan</dc:creator>
      <pubDate>Mon, 05 Apr 2021 10:35:18 +0000</pubDate>
      <link>https://dev.to/hannankhan/the-world-of-github-version-control-systems-577h</link>
      <guid>https://dev.to/hannankhan/the-world-of-github-version-control-systems-577h</guid>
      <description>&lt;p&gt;It wasn’t long ago that I too first ventured in the world of software development, a big step in my journey was discovering the version control system giant i.e. GitHub. GitHub has been a big help, as it is in any developer’s journey as they become part of digitally collaborative workspace. I remember being overwhelmed by the terms &amp;amp; technologies and thinking “why couldn’t we just use Google Drive instead?”, but since then it has proven to one of the most useful tools in my belt, as well as another skill to tick off in my ever developing resume.&lt;/p&gt;

&lt;p&gt;What are version control systems and why do we use them?&lt;br&gt;
Version control is the system of process of keeping track of previous versions of files throughout different phases of development. Not only is it used to keep track of different versions, but also to develop different variations concurrently. You can also restore back to a different point in time anytime you want or merge two or more versions into a single parent version. Version Control Systems eliminate the need to delete or overwrite a file every time a minor change is made or keeping track of a number of files to oversee different duplicates edited differently by various team members in your project.&lt;/p&gt;

&lt;p&gt;If you too are thinking of becoming a part of this world, you will need a few terms to be well acquainted with to get through your journey smoothly. Below are some terms that are the cause for confusion for many young developers, but shouldn’t be:&lt;/p&gt;
&lt;h3&gt;
  
  
  1. Git vs GitHub
&lt;/h3&gt;

&lt;p&gt;Git is a specific VCS (Version Control System). Used for keeping track of changes in source code during software development. Using git starts with installing git with comes with its own git bash terminal. All commands are given through a command terminal, having some knowledge of basic terminal commands is surely helpful. Git can be downloaded from:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://git-scm.com/"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GitHub is the cloud-based platform that makes collaborating using Git easier , so that changes can be seen in real time by all developers involved in the project. You need to sign up to a GitHub account to access its feature’s and link your current offline project to GitHub’s cloud storage. You can sign up using the link below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/join"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  2. What is a Repository? (How is it different from a project?)
&lt;/h3&gt;

&lt;p&gt;A git repository is a master storage location for all files in a particular project. It can be though of as the project folder that contains the entirety of the files to be edited and shared. A repository can be either local (stored in your own device) or remote (stored in a different device, usually a server).&lt;/p&gt;

&lt;p&gt;Once you have navigated to the folder that you want to use as your repository, the following command is used to initialize a repository:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Git init&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Previously a repository and a project were thought to be the same thing on GitHub but fairly recently there has been a change in terms due to GitHub’s release of a new projects feature, separate from repositories. GitHub defines it as “Project boards on GitHub help you organize and prioritize your work. You can create project boards for specific feature work, comprehensive roadmaps, or even release checklists. With project boards, you have the flexibility to create customized workflows that suit your needs.”&lt;/p&gt;
&lt;h3&gt;
  
  
  3. Staging Files
&lt;/h3&gt;

&lt;p&gt;before changes can be made in a file, it must be selected which is referred to as placing a file in the staging area. Staging a file is done through using the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git add file.js&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;multiple files are added by separating using spaces&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git add file.js file2.js file3.js&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  4. Cloning and Forking
&lt;/h3&gt;

&lt;p&gt;One great feature of GitHub is the access to a large library of open source projects made by developers around the world. You can make a copy of an open source project on your profile by forking it. Just simply find a repository and click the fork button, a non destructive copy will be made on your personal GitHub profile.&lt;/p&gt;

&lt;p&gt;To transfer all the source files to your computer you’ll have to clone the repository. It can be done through two ways. You can either use a clone command on your git bash terminal, or download and extract the zip file.&lt;/p&gt;
&lt;h3&gt;
  
  
  5. Commits and How to Write Them
&lt;/h3&gt;

&lt;p&gt;On a large scale project there can be millions of changes made and logged, to keep track of who did what and when, we must add commits (timestamped descriptions of our edits) after performing each individual task so that it can be revisited and verified later by the members of a project. The command for that is:&lt;/p&gt;

&lt;p&gt;git commit -m "your comment here"&lt;br&gt;
When you first start out working it can seem tiresome to write commits after every minor edit, but believe me, it makes your job a lot easier in the long run, much like when you first develop the habit of adding comments before substantial lines of code.&lt;/p&gt;
&lt;h3&gt;
  
  
  6. Branches
&lt;/h3&gt;

&lt;p&gt;Branches can be thought of as different timelines of a project. If you want the changes you made in the project to not overwrite the work done by your other team members, you can create a separate branch from the main branch (named Master). It way your team can work on infinitely different version of the same project without interfering with each other’s work. Cool! I know right?&lt;/p&gt;
&lt;h3&gt;
  
  
  7. Remotes
&lt;/h3&gt;

&lt;p&gt;Connecting your local git repository to your GitHub project is done through establishing a remote. Not just anyone can upload their edits to anyone else’s repository. You need to connect your local git repository by giving it the link to the GitHub repository, you must provide your GitHub credentials, which must be verified and vetted by the owner of the repository you are uploading to.&lt;/p&gt;
&lt;h3&gt;
  
  
  8. Push, Pull, and Merge Requests.
&lt;/h3&gt;

&lt;p&gt;After a change is made in the source files, the team members must be brought to speed to it. If you make a change locally, it must be pushed from the local Git to GitHub. It can be done using the command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git push -u origin master&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After someone else edits the source files, to update your local repository, the updated files must be pulled down to your local machine. It can be done using the command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git pull origin master&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;When different projects that have deviated from each other are to be merged together. The merge command is used:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git merge &amp;lt;branch-name&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Closing Remarks…
&lt;/h3&gt;

&lt;p&gt;I know all these terms can be a lot at first, but they are really easy to pick up on when you implement them yourselves. So get some practice while your at it and get making your own repositories my young padawans!&lt;/p&gt;

&lt;p&gt;If you do get stuck, here are some really useful youtube videos to assist you on your journey, on Git:&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/USjZcfj8yxE"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;on GitHub:&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/nhNq2kIvi9s"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
    </item>
    <item>
      <title>Random Wikipedia Article Reader | Rookie Week of Python Day 05</title>
      <dc:creator>Hannan</dc:creator>
      <pubDate>Wed, 24 Mar 2021 18:46:40 +0000</pubDate>
      <link>https://dev.to/hannankhan/random-wikipedia-article-reader-rookie-week-of-python-day-05-16b8</link>
      <guid>https://dev.to/hannankhan/random-wikipedia-article-reader-rookie-week-of-python-day-05-16b8</guid>
      <description>&lt;p&gt;Every person that has ever been bored on the internet and read Wikipedia articles to rid themselves of boredom has probably used their random article generator link:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;https://en.wikipedia.org/wiki/Special:Random&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Today we will use this link to write a python script that searches Wikipedia for random articles and gives you a y/n prompt to choose if you'd like to read the article or pick another random article. Since the link can not be refreshed to again search for a different article we will need to use loops.&lt;/p&gt;

&lt;h1&gt;
  
  
  Random Wiki Article Generator
&lt;/h1&gt;

&lt;p&gt;First we will need to pip install two prerequisites, easily done as follows:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pip install beautifulsoup4&lt;/code&gt;&lt;br&gt;
&lt;code&gt;pip install requests&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now to import the above installs and an additional &lt;code&gt;webbrowser&lt;/code&gt; module&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;bs4&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;BeautifulSoup&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;webbrowser&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We will declare a &lt;code&gt;while&lt;/code&gt; loop and three variable.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;url - contains the random wiki link&lt;/li&gt;
&lt;li&gt;soup - used to parse html content&lt;/li&gt;
&lt;li&gt;title - fetch &lt;code&gt;firstheading&lt;/code&gt; value from parsed data
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://en.wikipedia.org/wiki/Special:Random&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;soup&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;BeautifulSoup&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;html.parser&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;title&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;soup&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;class_&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;firstHeading&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A &lt;code&gt;print&lt;/code&gt; statement to prompt the user for a y/n option and an &lt;code&gt;input()&lt;/code&gt; statement. Append the statement with the &lt;code&gt;.lower()&lt;/code&gt; function to convert any uppercase inputs to lowercase as to avoid any incorrect inputs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://en.wikipedia.org/wiki/Special:Random&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;soup&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;BeautifulSoup&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;html.parser&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;title&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;soup&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;class_&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;firstHeading&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;

    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; &lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;Do you want to read this article? (Y/N)&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;""&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Write a conditional statement to perform different functionality based on user input. Execute &lt;code&gt;webbrowser.open()&lt;/code&gt; to open a browser windows with the selected link (program will use the default browser for this purpose).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;y&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://en.wikipedia.org/wiki/%s&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;title&lt;/span&gt;
        &lt;span class="n"&gt;webbrowser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Don&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;t worry. Fetching a new article for you!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;continue&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Invalid Command!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Output
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk1hdtv64cvtib3ysdjy2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk1hdtv64cvtib3ysdjy2.png" alt="Alt Text" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you for reading. You can get the code &lt;a href="https://github.com/thehannankhan/random-wiki-article-generator"&gt;here&lt;/a&gt; from it's GitHub repo.&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>programming</category>
      <category>wikipedia</category>
    </item>
    <item>
      <title>YouTube to MP3 Downloader | Rookie Week of Python Day 04</title>
      <dc:creator>Hannan</dc:creator>
      <pubDate>Tue, 23 Mar 2021 17:33:33 +0000</pubDate>
      <link>https://dev.to/hannankhan/youtube-to-mp3-downloader-rookie-week-of-python-day-03-435o</link>
      <guid>https://dev.to/hannankhan/youtube-to-mp3-downloader-rookie-week-of-python-day-03-435o</guid>
      <description>&lt;p&gt;Who doesn't love YouTube downloaders and MP3 conversion sites? They were the backbone of every teen's MP3 player library not too long ago, before Spotify or Apple Music, but have you ever wondered how these sites worked? In this tutorial we will create a python script to create our very own YouTube to MP3 convertor so you too can download your favourite videos and podcasts in audio form&lt;/p&gt;

&lt;h5&gt;
  
  
  Disclaimer
&lt;/h5&gt;

&lt;p&gt;Technically, it is not illegal to convert a YouTube video to MP3 - but it is illegal to download a copyrighted music video.&lt;/p&gt;

&lt;h1&gt;
  
  
  YouTube to Audio Converter/Downloader
&lt;/h1&gt;

&lt;p&gt;first of all we will need two prerequisites for this program. We need to pip install the &lt;code&gt;youtube_dl&lt;/code&gt; library and the latest &lt;code&gt;ffmpeg&lt;/code&gt; build for your specific operating system.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pip install youtube_dl&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;now to import the libraries needed for the program&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;youtube_dl&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;declare a variable &lt;code&gt;ydl_opts&lt;/code&gt; (in this case) to specify the specifications of the file you want to download. in this case we will select the &lt;code&gt;format&lt;/code&gt; to be the best audio format available, the &lt;code&gt;prefferedcodec&lt;/code&gt; will be mp3 and the rest can be left as default as shown here.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;ydl_opts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;format&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;bestaudio/best&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;postprocessors&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;
        &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;key&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;FFmpegExtractAudio&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;preferredcodec&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;mp3&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;preferredquality&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;192&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}],&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Write an &lt;code&gt;if&lt;/code&gt; statement to download the file and pass the values of the &lt;code&gt;ydl_opts&lt;/code&gt; variable to &lt;code&gt;youtube_dl&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;youtube_dl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;YoutubeDL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ydl_opts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;ydl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;filenames&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:]&lt;/span&gt;
        &lt;span class="n"&gt;ydl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;download&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;filenames&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run your command terminal and execute the python program and append the command line with the URL of any YouTube video (make sure to include "https://").&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;python youtubetomp3.py &amp;lt;URL&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Run the program and if everything goes smoothly you should see the following output:&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcjatb6m4ndk1pijbbwm7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcjatb6m4ndk1pijbbwm7.png" alt="Alt Text" width="800" height="418"&gt;&lt;/a&gt;&lt;br&gt;
The MP3 file will appear in the same directory as your program. Since my program is on my desktop you can see the downloaded file here.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb4x92jnknpcq3t4lpx6l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb4x92jnknpcq3t4lpx6l.png" alt="Alt Text" width="800" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for reading, you can find the code on it's GitHub repo &lt;a href="https://github.com/thehannankhan/youtube-to-mp3-converter"&gt;here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>youtube</category>
    </item>
    <item>
      <title>Mad Libs Generator | Rookie Week of Python Day 03</title>
      <dc:creator>Hannan</dc:creator>
      <pubDate>Mon, 22 Mar 2021 17:51:51 +0000</pubDate>
      <link>https://dev.to/hannankhan/mad-libs-generator-rookie-week-of-python-day-02-126f</link>
      <guid>https://dev.to/hannankhan/mad-libs-generator-rookie-week-of-python-day-02-126f</guid>
      <description>&lt;p&gt;Mad libs generator is a fun game that is usually played by kids. In this python game user has to enter substitutes for blanks in the story without knowing the story. It is a fun and creative way to see what stories people come up with.&lt;/p&gt;

&lt;h1&gt;
  
  
  Mad Libs Generator
&lt;/h1&gt;

&lt;p&gt;We will declare a variable &lt;code&gt;loop&lt;/code&gt; and initialize it with the value of &lt;code&gt;1&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;loop&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We will then create a &lt;code&gt;while&lt;/code&gt; loop and increment the &lt;code&gt;loop&lt;/code&gt; variable till it reaches &lt;code&gt;10&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nf"&gt;while &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;loop&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We need some inputs from the user. We will be requiring 2 nouns, 1 plural noun, 1 place, and 1 adjective for our specific Mad Libs Paragraph.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nf"&gt;while &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;loop&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;noun&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Choose a noun: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;p_noun&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Choose a plural noun: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;noun2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Choose a noun: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;place&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Name a place: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;adjective&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Choose an adjective (Describing word): &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;noun3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Choose a noun: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now to output our paragraph with the user entered variables in the appropriate spaces.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nf"&gt;while &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;loop&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;noun&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Choose a noun: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;p_noun&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Choose a plural noun: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;noun2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Choose a noun: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;place&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Name a place: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;adjective&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Choose an adjective (Describing word): &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;noun3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Choose a noun: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;------------------------------------------&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Be kind to your&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;noun&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;- footed&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p_noun&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;For a duck may be somebody&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;noun2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Be kind to your&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;p_noun&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;in&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;place&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Where the weather is always&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;adjective&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="nf"&gt;print &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;You may think that is this the&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;noun3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;,&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Well it is.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;------------------------------------------&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To loop the program back to the initial position we can add redefine the value of the &lt;code&gt;loop&lt;/code&gt; variable within the while statement.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;    &lt;span class="n"&gt;loop&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;loop&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Output
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffl98cxtyih3jtuzxlvrq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffl98cxtyih3jtuzxlvrq.png" alt="Alt Text" width="800" height="430"&gt;&lt;/a&gt;&lt;br&gt;
Feel free to make it as crazy as you like. Remember to have fun.&lt;br&gt;
If you want to get started you can fork this code from GitHub &lt;a href="https://github.com/thehannankhan/mad-libs-generator"&gt;here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Windows Notifier for Covid Stats | Rookie Week of Python Day 02</title>
      <dc:creator>Hannan</dc:creator>
      <pubDate>Sun, 21 Mar 2021 17:37:11 +0000</pubDate>
      <link>https://dev.to/hannankhan/windows-notifier-for-covid-stats-rookie-week-of-python-day-02-131g</link>
      <guid>https://dev.to/hannankhan/windows-notifier-for-covid-stats-rookie-week-of-python-day-02-131g</guid>
      <description>&lt;p&gt;In this article we will be creating a simple windows alert application that pulls data from a rest API. We will be using our program to pull live Covid-19 statistics and push them to the screen&lt;/p&gt;

&lt;h1&gt;
  
  
  Windows Notifier Application
&lt;/h1&gt;

&lt;p&gt;What will we need are the python requests and the win10toast libraries. They can be installed by the follow &lt;code&gt;pip install&lt;/code&gt; commands in your preferred command terminal.&lt;br&gt;
&lt;code&gt;pip install requests&lt;/code&gt;&lt;br&gt;
&lt;code&gt;pip install win10toast&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now to import the libraries we will simply use the &lt;code&gt;import&lt;/code&gt; statements&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;win10toast&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ToastNotifier&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We will first check the connection to our rest API with a &lt;code&gt;try&lt;/code&gt; &amp;amp; &lt;code&gt;except&lt;/code&gt; block. We will store the output from our API in a variable named &lt;em&gt;data&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;http://corona-rest-api.herokuapp.com/Api/pakistan&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;except&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;You are not connected to a network. Please check internet connection.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the API returns some data then our &lt;em&gt;data&lt;/em&gt; variable will not be null and we can use an &lt;code&gt;if&lt;/code&gt; statement with the following variable declarations.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;getData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;covidPK&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;getData&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Success&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Declare a variable named &lt;em&gt;title&lt;/em&gt; to hold the title string and use the &lt;code&gt;format()&lt;/code&gt; finction to place the date and time.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;title&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Covid Pakistan / {}&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;today&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Similarly declare a variable for the message body and use the &lt;code&gt;covidPK&lt;/code&gt; variable to pull the appropriate data from the API.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;In Pakistan Covid-19 Cases: {}, Deaths: {}, Recovered: {}, Cases Today: {}&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;covidPK&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cases&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="n"&gt;covidPK&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;deaths&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="n"&gt;covidPK&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;recovered&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="n"&gt;covidPK&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;todayCases&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now assign the &lt;code&gt;win10toast()&lt;/code&gt; function to a variable of your choosing like so.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;toaster&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;ToastNotifier&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, push the values to the windows alert message. Use &lt;code&gt;icon_path&lt;/code&gt; to point to an &lt;code&gt;.ico&lt;/code&gt; format file which will act as the icon for the notification. Use &lt;code&gt;duration&lt;/code&gt; to define the time in seconds for how long the alert will stay visible on screen.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;toaster&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;show_toast&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;icon_path&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;E:\Software\Python 3\Python Projects/covid-icon.ico&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;duration&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Output
&lt;/h3&gt;

&lt;p&gt;If everything worked out fine, you should get the following output on your screen.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq76annvmro7buier5gjr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq76annvmro7buier5gjr.png" alt="Alt Text" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also check out the code on it's GitHub repo &lt;a href="https://github.com/thehannankhan/Covid-Stats-Windows-Alert"&gt;here&lt;/a&gt;. Thank you for reading. Don't forget to check in tomorrow for more, cheers!&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>programming</category>
      <category>windows</category>
    </item>
    <item>
      <title>Welcome | Rookie Week of Python Day 01</title>
      <dc:creator>Hannan</dc:creator>
      <pubDate>Sat, 20 Mar 2021 16:57:44 +0000</pubDate>
      <link>https://dev.to/hannankhan/welcome-rookie-week-of-python-day-01-2li2</link>
      <guid>https://dev.to/hannankhan/welcome-rookie-week-of-python-day-01-2li2</guid>
      <description>&lt;p&gt;Python. The first and last love of most newbie programmers. Love it or hate it (does anyone really?) almost everyone has been drawn to it at one time or another. Recently I have started coding in python once again, and if like me, you too are a bit more than a little rusty at it, or maybe just hungover from the move to Python 3 from Python 2 in your time away from the language, this series of beginner level python projects is for you. Yes, I am bringing you a week straight of python projects, in varying difficulty levels, from around the web (I, in no way claim that these are the most original idea). Follow along and get back on the horse.&lt;br&gt;
For Day 1 we will be creating a very simple Email splitter program.&lt;/p&gt;

&lt;h1&gt;
  
  
  Email Splitter
&lt;/h1&gt;

&lt;p&gt;The concepts we will use in it are strings, strip() functions, and basic input methods. Easy enough right?&lt;br&gt;
We will start with a very basic variable input and use a strip() function to split it.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;email = input("Enter Email:").strip()&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Next we will declare two variables, each to hold the username and the domain name respectively. We will be splitting the string at the '@' like so.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;userName = email[:email.index("@")]&lt;br&gt;
domainName = email[email.index("@")+1:]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now that we have our two values stored in separate variables, we need to be able to use them independently, In this case, being able to print them.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;output = "Username: '{}'    Domain Name: '{}'".format(userName,domainName)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you want the code used here you can also check it out on my GitHub repository &lt;a href="https://github.com/thehannankhan/A-Simple-Email-Splitter"&gt;here&lt;/a&gt;. feel free to make it more complex.&lt;br&gt;
Now that you have started your first project, stay tuned for more tomorrow. &lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>projects</category>
    </item>
  </channel>
</rss>
