Python Enhancement Proposals, PEPs, provide guidance for many aspects of programming in Python. One of particular importance to this class is PEP 20, The Zen of Python. Keep it in mind as you make decisions about your programs. Another one to consider is PEP 8, but keep in mind this is the most important part of PEP 8.
CodingBat by Nick Parlante is a site to practice writing code to solve relatively simple problems involving strings, list, and boolean logic.
This video above demonstrates using terminal to run a Python 3 program.
The above video by Raymond Hettinger covers quickly many ways to improve your Python code including some techniques useful for the final project.
A comma at the end of a print statement enabled printing without a newline at the end in Python 2, but in Python 3 the print function keyword argument "end" changes the default from a newline to any other string. An empty string provides the same behavior as a comma in Python 2.
print('some string', end='')brew doctor to confirm the installation completed successfully.Use the following commands at the prompt as shown below to install the software packages:
$ brew install git$ brew install python3$ brew cask install github$ brew cask install atomThe software is now ready to use. Every week or two run the command brew upgrade to keep the software up to date.
Open a terminal window and type the following commands:
You will need to enter your GitHub username & password if prompted to do so.
Note: Creating the repository may need to be performed at the start of each class due to the way school computers are managed, but only once on a personal device where user data is saved. Be sure you commit any changes and run git push origin master at the end of each work session or class as well as git pull origin master at the beginning.
Git Tutorial for Beginners: Command-Line Fundamentals
git command reference
( Triple-click to copy an entry. Always precede installations with: sudo apt update )
Install Visual Studio Code
Download and install the signing key:
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpgsudo install -g root -o root -m 644 microsoft.gpg /usr/share/keyrings/microsoft-archive-keyring.gpgAdd the repository to the sources:
sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'Install the program:
sudo apt updatesudo apt install code # or code-insidersInstall Chrome (optional)
Download and install the signing key:
curl https://dl.google.com/linux/linux_signing_key.pub | gpg --dearmor > google.gpgsudo install -g root -o root -m 644 google.gpg /usr/share/keyrings/google-archive-keyring.gpgAdd the repository to the sources:
sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/google-archive-keyring.gpg] https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list'Install the program:
sudo apt updatesudo apt install google-chrome-stableInstall Atom (***Something is broken with atom. The reason for the two line key download is the slow response of the server yielding an error when utilizing curl. The installation runs smoothly, but the program fails to open.***)
Download and install the signing key:
wget -O atom https://packagecloud.io/AtomEditor/atom/gpgkeygpg --dearmor atomsudo install -g root -o root -m 644 atom.gpg /usr/share/keyrings/atom-archive-keyring.gpgAdd the repository to the sources:
sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/atom-archive-keyring.gpg] https://packagecloud.io/AtomEditor/atom/any/ any main" > /etc/apt/sources.list.d/atom.list'Install the program:
sudo apt updatesudo apt install atomNote: GitHub Desktop is not currently usable on Linux so the command line git commands must be used.
Beautiful is better than ugly.Explicit is better than implicit.Simple is better than complex.Complex is better than complicated.Flat is better than nested.Sparse is better than dense.Readability counts.Special cases aren't special enough to break the rules.Although practicality beats purity.Errors should never pass silently.Unless explicitly silenced.In the face of ambiguity, refuse the temptation to guess.There should be one-- and preferably only one --obvious way to do it.Although that way may not be obvious at first unless you're Dutch.Now is better than never.Although never is often better than *right* now.If the implementation is hard to explain, it's a bad idea.If the implementation is easy to explain, it may be a good idea.Namespaces are one honking great idea -- let's do more of those!