{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Hello World\n" ] } ], "source": [ "print('Hello World')" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "from datetime import datetime\n", "\n", "int_var = 10\n", "str_var = 'Hello World'\n", "list = []\n", "\n", "for i in range(10):\n", " json_data = {\n", " 'measurement': 'Weather',\n", " 'time': datetime.now(),\n", " 'fields': {\n", " 'Temperature (C)': 15 + i,\n", " 'Pressure (hPa)': 1019 + i\n", " },\n", " 'tags': {\n", " 'Country': 'Poland'\n", " }\n", " }\n", " list.append(json_data)" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "{'measurement': 'Weather', 'time': datetime.datetime(2021, 5, 18, 10, 50, 2, 727948), 'fields': {'Temperature (C)': 15, 'Pressure (hPa)': 1019}, 'tags': {'Country': 'Poland'}}\n", "{'measurement': 'Weather', 'time': datetime.datetime(2021, 5, 18, 10, 50, 2, 727953), 'fields': {'Temperature (C)': 16, 'Pressure (hPa)': 1020}, 'tags': {'Country': 'Poland'}}\n", "{'measurement': 'Weather', 'time': datetime.datetime(2021, 5, 18, 10, 50, 2, 727954), 'fields': {'Temperature (C)': 17, 'Pressure (hPa)': 1021}, 'tags': {'Country': 'Poland'}}\n", "{'measurement': 'Weather', 'time': datetime.datetime(2021, 5, 18, 10, 50, 2, 727977), 'fields': {'Temperature (C)': 18, 'Pressure (hPa)': 1022}, 'tags': {'Country': 'Poland'}}\n", "{'measurement': 'Weather', 'time': datetime.datetime(2021, 5, 18, 10, 50, 2, 727978), 'fields': {'Temperature (C)': 19, 'Pressure (hPa)': 1023}, 'tags': {'Country': 'Poland'}}\n", "{'measurement': 'Weather', 'time': datetime.datetime(2021, 5, 18, 10, 50, 2, 727979), 'fields': {'Temperature (C)': 20, 'Pressure (hPa)': 1024}, 'tags': {'Country': 'Poland'}}\n", "{'measurement': 'Weather', 'time': datetime.datetime(2021, 5, 18, 10, 50, 2, 727980), 'fields': {'Temperature (C)': 21, 'Pressure (hPa)': 1025}, 'tags': {'Country': 'Poland'}}\n", "{'measurement': 'Weather', 'time': datetime.datetime(2021, 5, 18, 10, 50, 2, 727981), 'fields': {'Temperature (C)': 22, 'Pressure (hPa)': 1026}, 'tags': {'Country': 'Poland'}}\n", "{'measurement': 'Weather', 'time': datetime.datetime(2021, 5, 18, 10, 50, 2, 727982), 'fields': {'Temperature (C)': 23, 'Pressure (hPa)': 1027}, 'tags': {'Country': 'Poland'}}\n", "{'measurement': 'Weather', 'time': datetime.datetime(2021, 5, 18, 10, 50, 2, 727983), 'fields': {'Temperature (C)': 24, 'Pressure (hPa)': 1028}, 'tags': {'Country': 'Poland'}}\n", "10\n", "Hello World\n" ] } ], "source": [ "for entry in list:\n", " print(entry)\n", "\n", "print(int_var)\n", "print(str_var)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.4" } }, "nbformat": 4, "nbformat_minor": 4 }