Skip to main content

Captain's Log Progress Report

Anson learns Python

Here's a progress log on what Anson learns on his Python journey. Just to keep track and see progress.

 

Current Goals

These are taken from notes on 1/5/21

  1. Finish the Udemy course on Python
  2. Create the game snake
  3. Turn my Excel sheet of my video game collection into a SQLite3 database to learn more about Python and databases.
  4. Learn about Kivy and Android Studio
  5. Port snake to Android
  6. Figure out how to turn the SQLite3 video game collection database into an app so I can search through my collection on my phone.
  7. Port snake to pybadge and circuitpython

 

12/20/20 Sun

Starting! My 2 week goal is to create the game Snake in Python. So I can kickstart my new game dev studio.

Learned how Visual Studio Code ("VSCode"), git, and Jupyter notebook worked. Setup note taking log on Phil's Notes Bookstack (Thanks Phil). Created Jupyter notebook for local notetaking for Anson. Created alias to backup files to backup hard drives.

In the Udemy course, I learned:

  • Data Types
  • Numbers
  • Variable Assignments
  • Strings
  • String Indexing
  • String Slicing

 

12/21/20 Mon

Did some research to see what libraries were available for the PyBadge in CircuitPython. Found code that someone made to create snake in micropython. Wondering if that can translate to my pybadge.

In the course today, I learned about:

  • String Properties
  • Print formatting with strings
  • Lists

 

12/22/20 Tues

Discovered these Markdown notes from the Jupyter Notebook documentation which were really helpful. And learned that VSCode can do Markdown editing with previews so I'll be using VSCode to edit all my Markdown notes now!

In the course I learned about:

  • Dictionaries
  • Tuples
  • Sets
  • Boooleans
  • Manipulating files within Jupyter Notebooks and Python 3

Then took the 00-Python Object and Data Structure Basics assessment!

 

12/28/20 Mon

After a smol holiday break, I'm working on the Udemy course again. Today I learned about:

  • Comparison/Boolean Operators in Python
  • Chaining Comparison/Boolean Operators
    • And
    • Or
    • Not

 

12/30/20 Wed

More Udemy coursework. Today I learned about:

  • Control Flow - if/else/elif Statements

 

1/5/21 Tues

New year, same bullshit. Let's learn more Python. Last night I came up with some more goals and ideas:

  1. My original goal stands: I want to finish the Udemy course and make the game snake still.

  2. I want to learn more about Python and SQLite3 databases. SQLite3 should be a part of Python. So I want to load up my video game collection into a database.

  3. I want to turn the database into an Android app using Kivy. So take that database and turn it into a way that I can access the info on my phone.

  4. I want to port my snake game into Android as well. Porting the .py file into an .apk.

  5. Poems for your sprog message of the day: the idea is that I'd create a python program/script that pulls all of /u/poem_for_your_sprog's poems and comments on reddit and displays them as a message of the day when you open up your terminal. Would also be really fun as a bot on discord to get a random sprog.

 

Ubuntu Machine - Installing Jupyter Notebooks and Python

I switched to my Ubuntu machine today. It didn't have pip, anaconda, jupyter, or anything that allowed the Jupyter notebooks to run Python. I kept getting "Data Science libraries notebook and jupyter are not installed in interpreter Python 3.8.5 64-bit." as an error. To fix this, I had to install pip, anaconda, ipykernel, and jupyter. Anaconda came as a script from the anaconda website. To install scripts, I just dragged the script file in the GUI into the terminal. Then I ran the these terminal commands. Remember updateme is my alias that does sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y && sudo apt autoclean -y && sudo snap refresh.

updateme
python3 -m pip install --upgrade pip
python -m pip install ipykernel --force
python -m pip install jupyter --force

 

In terms of the Udemy course, today I learned about:

  • For Loops

1/6/21 Wed

GDQ and trying to learn Python is hard but let's make a little progress today!

In terms of the Udemy course, today I learned about:

  • While Loops

Temperature Converter Program

After I got to the end of the Udemy course and it was testing time, I tried to write a program that converts temperature into Celsius and Fahrenheit. I used this code as the starting point.

The base code is "Temperature Converter.py". Then I wanted to add in mistake proofing so if I put in asdf as the temperature, it would say "Oh you messed up, try again" and reprompt me. Jwaz nerd chat introduced me to "try/except" which is explained nicely here. And they also introduced me to NameError and ValueError which is explained here.

Try/Except doesn't won't set anything if it doesn't work though. It only sets the variable if it works. So I'm getting a NameError with this current code:

temp = (input("Enter temperature = "))
unit = input("Enter C or F (for Celsius or Farhenheit) = ")

try:
    temp_float = float(temp)
except ValueError:
    print("Not a valid temp")

if unit == "F" or unit == "f":
    fahrenheit = (temp_float * 9/5) + 32
    print(f'{round(fahrenheit,2)} F')
elif unit == "C" or unit == "c":
    celsius = (temp_float - 32) * 5/9
    print(f'{round(celsius,2)} C')
elif unit != "F" or unit != "f" or unit != "C" or unit != "c":
    print("Not a valid unit. Try again.")