How to Add Syntax Highlighting to Command Line Output

Posted on

install the Python syntax highlighter Pygments sudo apt-get install python-pygments choose an alias and assign the pygmentize command to it, customizing the style however you’d like alias catt=’pygmentize -O style=monokai -f console256 -g’ add the alias line to your bash startup file (.bashrc, for example) to have it available every time you log on enjoy…Continue Reading

How to Build a Simple IoT System with Python

Posted on 3 Comments

IoT The Internet of Things (IoT) movement is in full swing and growing bigger every day. Wireless thermostats and refrigerators, home security systems controlled by a mobile app, scales and health monitors that save your weight and fitness data…these are some examples of the “smart” gadgets coming out of the IoT movement. This blog post…Continue Reading

How to Run Python Code from the Command Line

Posted on

run python code from the command line with the -c flag; put the code in single quotes and use double quotes in the Python code python -c ‘print(“hi”)’ you must print your results in the code to display them in the terminal python -c ‘sum([1,2,3,4,5])’ python -c ‘print(sum([1,2,3,4,5]))’ you can enter multi-line strings of code…Continue Reading