diff --git a/docs/en/15-programming/01-connect/01-python.md b/docs/en/15-programming/01-connect/01-python.md index 3557c07763e78ed9906eda7421d6303acf060786..31ee3b83de8195dd25817c9604d2df3a5d69f969 100644 --- a/docs/en/15-programming/01-connect/01-python.md +++ b/docs/en/15-programming/01-connect/01-python.md @@ -28,17 +28,6 @@ You'll need to have Python3 installed. conda install -c conda-forge taospy ``` - - - -For the users who are familiar with Jupyter to program in Python, both TDengine Python connector and Jupyter need to be ready in your environment. - -```bash -pip install jupyterlab -pip install notebook -pip3 install -U taospy -``` - @@ -70,17 +59,6 @@ $env:TDENGINE_CLOUD_TOKEN="" $env:TDENGINE_CLOUD_URL="" ``` - - - -In order for Jupyter to connect to TDengine cloud service, before launching Jupypter, the environment setting must be performed. We use Linux bash as example. - -```bash -export TDENGINE_CLOUD_TOKEN="" -export TDENGINE_CLOUD_URL="" -jupyter notebook -``` - @@ -106,4 +84,34 @@ Copy code bellow to your editor and run it. If you are using jupyter, assuming y For how to write data and query data, please refer to and . -For more details about how to write or query data via REST API, please check [REST API](https://docs.tdengine.com/cloud/programming/connector/rest-api/). \ No newline at end of file +For more details about how to write or query data via REST API, please check [REST API](https://docs.tdengine.com/cloud/programming/connector/rest-api/). + +## Jupyter + +**Step 1: Install** + +For the users who are familiar with Jupyter to program in Python, both TDengine Python connector and Jupyter need to be ready in your environment. If you have not done yet, please use below commands to install them. + +```bash +pip install jupyterlab +pip install notebook +pip3 install -U taospy +``` + +**Step 2: Configure** + +In order for Jupyter to connect to TDengine cloud service, before launching Jupypter, the environment setting must be performed. We use Linux bash as example. + +```bash +export TDENGINE_CLOUD_TOKEN="" +export TDENGINE_CLOUD_URL="" +jupyter notebook +``` + +**Step 3: Connect** + +Once jupyter notebook is launched, Jupyter notebook service is automatically connected and shown in your browser. You can create a new Python file and copy the sample code below and run it. + +```python +{{#include docs/examples/python/develop_tutorial.py:connect}} +``` \ No newline at end of file