Changes between Version 9 and Version 10 of en/HowToCodeInTerminal


Ignore:
Timestamp:
May 16, 2025, 1:56:21 PM (2 weeks ago)
Author:
Ales Horak
Comment:

edited by hales in edit_page_in_vim.py

Legend:

Unmodified
Added
Removed
Modified
  • en/HowToCodeInTerminal

    v9 v10  
    2727  - one window for working with auxiliary files, e.g. edit testing
    2828    data.
     29* for **easy data+code sharing** consider using an independent Git
     30  repository, e.g. https://gitlab.fi.muni.cz/. In that case, you shall
     31  store all your source codes and data files in [https://gitlab.fi.muni.cz/ Gitlab]
     32  and just `git clone` the repository to the server. Use `git add`, `git
     33  commit -a` and `git push` to promote changes that you make on the server
     34  back to [https://gitlab.fi.muni.cz/ Gitlab]. Use `git pull` to update the
     35  previously cloned repository in the server directory with changes made
     36  elsewhere. See e.g. the
     37  [https://missing.csail.mit.edu/2020/version-control/#repositories MIT Git info]
     38  for other details about working with Git.
     39* how to **discover and fix errors** - we suggest two standard options:
     40  `logging` and `pdb` debugging:
     41  - **logging** is based on standard Python
     42    [https://docs.python.org/3/library/logging.html logging library]. It
     43    allows to supplement your program with messages of various levels of
     44    verbosity which can be turned on and off. A simple program may look
     45    like {{{#!python
     46    import logging
     47
     48    logging.basicConfig( level=logging.DEBUG, format="%(message)s")
     49
     50    logging.info("Program starting")
     51    a = 2
     52    b = 2
     53    logging.debug(f"About to sum {a} and {b}")
     54    logging.info(f"The result is {a+b}")
     55    }}}
     56  - **pdb debugging** is run from the command line with include specific
     57    `pdb` module. Start the debugging via `python -mpdb source.py`, then
     58    use line-based commands as described in the
     59    [https://missing.csail.mit.edu/2020/debugging-profiling/#debuggers MIT code page].
     60    Command `q` quits the debugger.
    2961* if you are curious enough to get to a **terminal pro level**, we suggest
    30   to go through the MIT course [https://missing.csail.mit.edu/ The Missing Semester of Your CS Education].
     62  to go through the full MIT course [https://missing.csail.mit.edu/ The Missing Semester of Your CS Education].