Check out example codes for "python application insights azure". It will help you in understanding the concepts better.

Code Example 1

pip install applicationinsights
from applicationinsights import TelemetryClient
tc = TelemetryClient('<YOUR INSTRUMENTATION KEY GOES HERE>')
tc.track_event("Test event")
tc.flush()

Learn ReactJs, React Native from akashmittal.com