Aims The aim of this lab is to introduce some basic Linux commands and tools
The terminal and why it is important basic linux commands ls,pwd,mkdir,cd,rm,man,history. The environment and how to set it up Getting Started The first thing we need to do is to get a terminal open. On Linux this is usually done by pressing the ctrl-alt-t keys. I actually have a default terminal open on login as I use it so much.
What is Computational Thinking? The idea of computational thinking is allow us to look at problems and determine the best way for a computer to solve this (and related problems). This is basically a way of re-framing the problem / domain so it can be computationally processed.
Simple Programs with Python In this session we will look at writing some simple stand alone programs in Python. We will cover the following topics:
#!/ __main__ sys.argv The first thing to note is that Python is an interpreted language, this means that you can run Python code directly from the command line. This is done by typing python followed by the name of the file containing the Python code. For example to run a file called hello.py you would type:
Overview In this session we will look at how to pass arguments to a Python program from the command line. We will cover the following topics:
sys.argv argparse click What are command line arguments? Command line arguments are values that are passed to a program when it is run from the command line. These values can be used to control the behavior of the program, for example by specifying input files, output files, or other options.
Overview In this session we will look at how to read and write files in Python. We will cover the following topics:
Opening and closing files Reading and writing text files context managers We will also continue to develop our csv writer program from the previous session.