Difference between revisions of "IoT Coding basics"

From csn
Jump to navigation Jump to search
Line 7: Line 7:
  
 
In this section, we will run Bash and Python hello world examples. Introduce the shebang
 
In this section, we will run Bash and Python hello world examples. Introduce the shebang
 +
 +
#!/bin/bash
 +
# This is a bash comment
 +
echo "Hello Bash World!"
 +
 +
#!/usr/bin/env python3
 +
# This is a python comment
 +
print("Hello Python World!")
  
 
== Modify the Code 1 ==
 
== Modify the Code 1 ==

Revision as of 01:02, 9 June 2020

Lab showing bash and python as well as execution times Provide some fix the code as well as complete the code examples. Dealing with numbers, printing them, division and decimals

Introducing Bash and Python

Hello World!

In this section, we will run Bash and Python hello world examples. Introduce the shebang

#!/bin/bash
# This is a bash comment 
echo "Hello Bash World!"
#!/usr/bin/env python3
# This is a python comment
print("Hello Python World!")

Modify the Code 1

Examine the following two code snippets of Bash and Python. Squares.


Upgrade the Python2 code

Create an upgrade this code to python3

== Averaging a value

== Exponentially Weighted Moving Averages


Glueing code together =

Glueing code together

  • running Python from bash
  • running bash from python

Code resiliency

Reving processes

Virtual Terminals

Complete some common Fibonacci or squares examples

Modify the code 2