Project Setup
Contents
Project Setup#
We begin all Python applications by coming up with a program name. This name becomes the name of a single directory somewhere on your development system. Under that directory we will keep everything needed to recreate this program on another machine.
We will manage that directory using a very popular Source Code Control System called Git. This tool tracks all changes to your project and lets you “back up” if you manage to break the project. No self-respecting developer works without using a tool like Git today!
We will host a copy of the project directory on a public server: Github. This site is home to literally millions of open-source* projects as well as some private projects not visible except to registered users. Github is free, and all you need to do to use it is to navigate to their Github website and register. You will be asked to pick a user name which will become part of the URL you use to reach your projecta. My Github user name is rblack42. At the present time I have over 100 projects hosted there, as well as a huge number of student projects from my teaching days! (I do pay a subscription fee to let me keep student work private.)
Verify Development Tools are in place#
Let’s start off by verifying that we have the basic tools we will need, ready to go. Details on installing these tools is included in the appendix. I will show how I check this on the Macbook laptop I use for development work:
Python#
Python is a very popular programming language for beginners. I taught this to beginning college students for many years. You can see an example of my course notes at COSC1336 Lecture notes. (No, you cannot get credit for taking this course, I am retired10
!python --version
Python 3.10.8
Git#
I use Git to track changes to all of my software development projects. When combined with an account on Github you have a reliable way to protect your code and make it available to collaborators who might want to join you in your development work.
!git --version
git version 2.37.1 (Apple Git-137.1)
Programmer’s Editor#
My favorite editor for all text writing, but especially for writing software code is Vim. It has been around longer that the personal computer. It was originally developed back when computers only had command line interfaces. No mice anywhere! Feel free to install any editor you like. Just make sure it produces simple text output. Do NOT not use something fancy like a word processor.
!vim --version
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Sep 15 2022 19:27:32)
macOS version - x86_64
Included patches: 1-472
Compiled by GitHub Actions
Huge version with MacVim GUI. Features included (+) or not (-):
+acl +find_in_path +mouse_xterm -tcl
+arabic +float +multi_byte +termguicolors
+autocmd +folding +multi_lang +terminal
+autochdir -footer -mzscheme +terminfo
-autoservername +fork() +netbeans_intg +termresponse
+balloon_eval +fullscreen +num64 +textobjects
+balloon_eval_term +gettext +odbeditor +textprop
+browse -hangul_input +packages +timers
++builtin_terms +iconv +path_extra +title
+byte_offset +insert_expand +perl/dyn +toolbar
+channel +ipv6 +persistent_undo +transparency
+cindent +job +popupwin +user_commands
+clientserver +jumplist +postscript +vartabs
+clipboard +keymap +printer +vertsplit
+cmdline_compl +lambda +profile +vim9script
+cmdline_hist +langmap +python/dyn +viminfo
+cmdline_info +libcall +python3/dyn +virtualedit
+comments +linebreak +quickfix +visual
+conceal +lispindent +reltime +visualextra
+cryptv +listcmds +rightleft +vreplace
+cscope +localmap +ruby/dyn +wildignore
+cursorbind +lua/dyn +scrollbind +wildmenu
+cursorshape +menu +signs +windows
+dialog_con_gui +mksession +smartindent +writebackup
+diff +modify_fname +sodium -X11
+digraphs +mouse -sound -xfontset
+dnd +mouseshape +spell +xim
-ebcdic +mouse_dec +startuptime -xpm
+emacs_tags -mouse_gpm +statusline -xsmp
+eval -mouse_jsbterm -sun_workshop -xterm_clipboard
+ex_extra +mouse_netterm +syntax -xterm_save
+extra_search +mouse_sgr +tag_binary
-farsi -mouse_sysmouse -tag_old_static
+file_in_path +mouse_urxvt -tag_any_white
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$VIM/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
defaults file: "$VIMRUNTIME/defaults.vim"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe -DMACOS_X -DMACOS_X_DARWIN -g -O2 -arch x86_64 -arch arm64 -I/usr/local/Cellar/libsodium/1.0.18_1/include -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -Wall -Wextra -Wshadow -Werror -Wno-error=missing-field-initializers -Wno-error=deprecated-declarations -Wno-error=unused-function
Linking: clang -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/readline/lib -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/readline/lib -arch x86_64 -arch arm64 -L/usr/local/lib -o Vim -lm -lncurses /usr/local/lib/libsodium.a -liconv /usr/local/lib/libintl.a -framework AppKit -fstack-protector -L/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE
That is a lot of output. This program has many features for serious development work, and it can even be extended using Python to teach it new tricks.