<?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: amanda-mei</title>
    <description>The latest articles on DEV Community by amanda-mei (@amandamei).</description>
    <link>https://dev.to/amandamei</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%2F634412%2F99f714a8-37c8-4b31-9c6d-206823f2b15b.png</url>
      <title>DEV Community: amanda-mei</title>
      <link>https://dev.to/amandamei</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/amandamei"/>
    <language>en</language>
    <item>
      <title>100 Days of Code - Python Boot Camp Review (First 31 Days!)</title>
      <dc:creator>amanda-mei</dc:creator>
      <pubDate>Thu, 09 Sep 2021 03:38:22 +0000</pubDate>
      <link>https://dev.to/amandamei/100-days-of-code-python-boot-camp-review-first-31-days-2og5</link>
      <guid>https://dev.to/amandamei/100-days-of-code-python-boot-camp-review-first-31-days-2og5</guid>
      <description>&lt;p&gt;I'm a beginner at Python, so I've been looking into how to get better at it. I did some searching and found great reviews and recommendations for &lt;a href="https://www.udemy.com/course/100-days-of-code/"&gt;100 Days of Code - The Complete Python Pro Bootcamp for 2021&lt;/a&gt; by Dr. Angela Yu. This will be my own review for her course.&lt;/p&gt;

&lt;p&gt;So, far I have consistently done the first 31 days of the course. I allowed myself weekends to rest, because even when I was in school I had those days off! I also built in review and lights days for this Python Course so as to not burn out. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;100 Days of Code Days 1-7&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For the first week I felt like it was my second or third time encountering some concepts at the beginning stage. When I first started with a phone app to learn Beginner Python, I primed myself for the basic concepts such as variables, data types, loops, lists, etc. During the 100 Days of Code course, I found that some things I learned in a week taking &lt;a href="https://www.udemy.com/course/the-concise-python-3-bootcamp-2020-for-absolute-beginners/"&gt;Python for Beginners: A to Z Concise Hands-on Course&lt;/a&gt; by Wajih Bukhari were now clearer, or more in depth.&lt;/p&gt;

&lt;p&gt;I found the blank notes template that Angela provided for note-taking very useful. There are headings for Concept, Filename, Day #, Summary, as well as labeled number lines for code and indents. The importance of indents was really drilled into me during Day 3's If / Elif / Else Lectures. Those indents really make or break the code blocks!&lt;/p&gt;

&lt;p&gt;Some concepts, like print(f"This is a f string you can put {int}, {float}, and {str} all in the same line.") make more sense to me now. This time around, the reason for why people used f-strings clicked for me. It really is a time saver to not have to format the different data types individually.&lt;/p&gt;

&lt;p&gt;Day 4 had an important lesson regarding reading documentation. Lists may have certain commands like .append or .extend, but there isn't a need to memorize the exact syntax. It is better to remember what the module can do, and then being able to look at the documentation for the exact command.&lt;/p&gt;

&lt;p&gt;Day 6 with the Reeborg's World robot coding challenges were definitely hurdles I had to overcome, but the process of going through it made me understand Day 5's Loops introduction better.&lt;/p&gt;

&lt;p&gt;Day 7's Hangman project was difficult for me and made me mindful of how I indent things, since it impacts overall functionality of the code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;100 Days of Code Days 8-14&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This was the second week, the first 14 days were labeled Beginner level. During this time, I learned more in depth about Dictionaries and Functions. A mantra that Angela repeated throughout the course was "You won't learn anything by watching me code." And she's right. The main growth I gained was by doing the projects myself, during the "Pause this Video" moments.&lt;/p&gt;

&lt;p&gt;The Blackjack Capstone project on Day 11 in particular was difficult, but it built upon all previous lessons, as promised. This course's strength is in the steady building of experience, day by day. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;100 Days of Code Days 15-19&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I entered Intermediate stage on Day 15, where we made the transition from lessons done in replit.com/ to a full IDLE like PyCharm. At this point, it got past the beginner concepts I was exposed to and moved to things like Object Oriented Programing. For Day 16, learning OOP was a bit of a struggle, but on Day 17, more practice and instruction helped me to understand it better.&lt;/p&gt;

&lt;p&gt;On Day 18 was when we started with Python's built in turtle module and GUI or Graphical User Interface. As a Graphic Designer, this was exciting to learn. As with previous projects, we broke down the steps to get a goal accomplished. Completing Day 18's challenge to digitally recreate a Hirst painting was satisfying as I saw the turtle draw each row of dots according to the code I had written.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pkyuKNI8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wj5x8rwlwl24zpepu7oa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pkyuKNI8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wj5x8rwlwl24zpepu7oa.png" alt="Hirst painting using Python"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Day 19 built more on the turtle module with a turtle race game. Overall, the course builds on previous knowledge. I felt I had come a long way from just beginner. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;100 Days of Code Days 20-23&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Snake Game, Pong, and Turtle Crossing each had their own challenges, but guided by the course instruction, it was broken down into bit-sized pieces. OOP initialization was something I had to make sure I understood in order to complete those game project based days. I've seen tutorials on how to make these games on Youtube, but I like that these game projects are within the scope of this course, and after I have learned the needed prerequisites.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;100 Days of Code Days 24-26&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Day 24 was a guide to working with Files, Directories, and Paths. It was on this day that I learned to Read/Write files in Python. This was very exciting as I could see how useful it could be for automation.&lt;/p&gt;

&lt;p&gt;Day 25 was working with CSV and Pandas. Prior to this, I had only seen and followed along with a Youtube tutorial on how to manipulate DataFrames. It didn't hurt to take this day and refresh that knowledge. Repeated exposure and experience with a module was very useful to me as a beginner. &lt;/p&gt;

&lt;p&gt;Day 26 was learning List Comprehension, which felt like it leveled up my understanding of Lists and made it more concise. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;100 Days of Code Days 27-31&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Day 27 was learning Tkinter for Python and felt like a GUI level-up. I finally learned what **args (arguments) and **kwargs (keyword arguments) were. When I was looking into implementing a GUI for a phone app, during a Youtube tutorial series, the author mentioned "kwargs" and I had no idea what that was, it sounded like an RPG monster to me. Now I know they are arguments that go into functions. &lt;/p&gt;

&lt;p&gt;Days 28-31 were even more Tkinter projects, each time the difficulty got higher and built off previous lessons. Learning how to use Tkinter's .grid() to layout the GUI was the most helpful.&lt;/p&gt;

&lt;p&gt;So far this course's value is in the day by day projects. I can't transfer the knowledge learned within, I can only recommend the self-guided studying experience of going though it. It's worth the value that its all laid-out, and it does not discount using outside sources such as StackOverflow or Google. I used to do that in the past, but now I better understand the &lt;em&gt;why&lt;/em&gt; of the code. I used to think syntax was very important, now I know its about thinking a certain way, breaking down the problem and figuring out what libraries, modules, and tools can help to solve the end goal. I have the other 2/3rd's left, and I look forward to how much I'll grow.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>First Python Project! Custom MacOS Notification Program</title>
      <dc:creator>amanda-mei</dc:creator>
      <pubDate>Fri, 30 Jul 2021 18:45:07 +0000</pubDate>
      <link>https://dev.to/amandamei/first-python-project-custom-macos-notification-program-4alk</link>
      <guid>https://dev.to/amandamei/first-python-project-custom-macos-notification-program-4alk</guid>
      <description>&lt;p&gt;As a beginner, I've been learning Python on Udemy, but procrastination is always a problem. I find that I was often taking breaks on my phone to check a mobile game I play.&lt;/p&gt;

&lt;p&gt;The game has a standard energy bar that most mobile games have, where players spend energy points to make moves. This game in particular gave the player +1 energy every 6 minutes. With what I learned so far, I thought to myself, what if I had a variable that held the energy number and then had it notify me when my bar is nearly full? That way I would have less of an excuse to check my mobile game.&lt;/p&gt;

&lt;p&gt;My checklist ended up being something like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;have user input current energy&lt;/li&gt;
&lt;li&gt;add 1 energy every 6 minutes&lt;/li&gt;
&lt;li&gt;max energy is 70&lt;/li&gt;
&lt;li&gt;notify when energy is at 50, 60, and 70&lt;/li&gt;
&lt;li&gt;get time stamp for notifications&lt;/li&gt;
&lt;li&gt;work with MacOS Notification Center&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I begin with the current_energy variable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;current_energy = int(input("What is your current energy? "))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, I needed to add 1 energy every 6 minutes. In my search to figure out how to get what I wanted, I found the schedule and time modules. These were super useful and had the documentation I needed down to days, hours, and minutes. It also showed examples of how to define a job. I setup if/elif statements at 50, 60, and 70 for the current_energy.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def energy_adder():
    global current_energy
    current_energy = current_energy + 1
    if current_energy &amp;gt;= 70:
        print(current_energy)
    elif current_energy == 60:
        print(current_energy)
    elif current_energy == 50:
        print(current_energy)
    else:
        print(current_energy)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;paired with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;schedule.every(6).minutes.do(energy_adder)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I Googled how to make a custom MacOS notification. It involved using import os. I defined a new job for when the current_energy hit 70.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def energy70():
    title = "Your energy bar is at 70"
    message = "Your energy bar is FULL!"
    command = f'''
    osascript -e 'display notification "{message}" with title "{title}"'
    '''
    os.system(command)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I repeated this and changed some words for 50 and 60 with energy50() and energy60(). Soon, I had a program that would ask me the current energy I had in game, then every 6 minutes it would add an energy point to the energy bar variable. I set it so that if it hit 50, it would notify me. Same for 60 and then 70, which meant it was full. I also had it set back to 70 again instead of going to 71, since that was the maximum in game.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def energy_adder():
    global current_energy
    current_energy = current_energy + 1
    if current_energy &amp;gt;= 70:
        energy70()
        current_energy = 70
        print(current_energy)
    elif current_energy == 60:
        energy60()
        print(current_energy)
    elif current_energy == 50:
        energy50()
        print(current_energy)
    else:
        print(current_energy)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I also had other ideas for notifications that I implemented as well:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In-game currency event that refreshes every day at midnight&lt;/li&gt;
&lt;li&gt;Calendar of prizes that refreshes every day at 7pm&lt;/li&gt;
&lt;li&gt;Quests that refresh every day at noon&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;An example of one notification was this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def job():
    title = "Objectives Refreshed at Noon"
    message = "Remember to do your objectives!"
    command = f'''
    osascript -e 'display notification "{message}" with title "{title}"'
    '''
    os.system(command)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;paired with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;schedule.every().day.at("12:00").do(job)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The test notifications looked like this: &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--R2fROHag--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uw1hrgu0lnyqvgkj61qv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--R2fROHag--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uw1hrgu0lnyqvgkj61qv.png" alt="Screencap of example MacOS Notifications"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, I used &lt;a href="https://www.pyinstaller.org/"&gt;PyInstaller&lt;/a&gt; to wrap up my program as a simple executable to run in the terminal.&lt;/p&gt;

&lt;p&gt;My code is on &lt;a href="https://github.com/amanda-mei/gamebarnotifier"&gt;GitHub&lt;/a&gt; , for all you beginner Python students and mobile gamers out there. &lt;/p&gt;

&lt;p&gt;Hopefully this will solve my issue with picking up the phone! Still, I'm pretty proud that I learned quite a bit about breaking down the goals and looking for what I needed with Python on this first project.&lt;/p&gt;

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