<aside> ℹ️ The focus of this tutorial is scripting in Python!
</aside>
#!/bin/dash
, how should we modify this to use it with Python?if __name__ == '__main__':
construct. How does this work? Why is this useful?head
command in Python, that accepts an optional command line argument in the form -n
, where n
is a number, and displays the first n
lines from its standard input. If the -n
option is not used, then the program simply displays the first ten lines from its standard input.head
program from the previous question so that, as well as handling an optional -n
argument to specify how many lines, it also handles multiple files on the command line and displays the first n
lines from each file, separating them by a line of the form ==> FileName <===
.search
, match
, and fullmatch
?grep
?