Skip to content

Latest commit

 

History

History
51 lines (35 loc) · 3.42 KB

PythonDevNotes.md

File metadata and controls

51 lines (35 loc) · 3.42 KB

This document describes choices made and problems solved in the Python implementation of Conway's Game of Life. This was my first implementation of the game, and I chose Python because it's a popular, widely available scripting language, that I have some familiarity but not really a lot of experience.

Toolkit

I have very limited experience in Python, so I'm starting from scratch here. However, my experience in other languages guides me as to what to ask, and I arrived at the following selections fairly rapidly

Gui Toolkit Selection

I knew I wanted some clickable main area, and since I'm initially writing on a desktop, I thought a standard main window type thing would be good. A mobile interface might be fun too, but, programming is still a desktop-first activity. Sooo.

I googled "Python Main Window with clickable main window Hello world", and found this description of PySimpleGui on the RealPython website. There, they discuss four available toolkits, and state that the TKinter toolkit is the most common and built in, although maybe not the easiest.

GUI implementation

Created hello world by following this Python GUI: Build your first application using TKInter I Choose "grid" layout manager: There are 3 layout managers: auto-layout: pack(), pixel based: place(x=10,y=10), and grid(row=0, column=1)

Overall implementation was pretty straightforward, and took about 1 day of work, despite me having to look up EVERYTHING, such as "GUI Hello World", "Python Avoid Globals", "Object oriented python", "tkinter frames", avoiding globals, how to use ENUMs, string formatting, loops, etc. etc

Problems encountered and solved:

File Format

I only needed a simple file format, and files are probably not very large. A bit of googling shows that the common "JSON" format is natively supported in Python. Easy peasy.