未验证 提交 5bac6877 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #3672 from taosdata/feature/examples

python example support custom IP
......@@ -22,8 +22,12 @@ if __name__ == '__main__':
# @password : Password
# @database : Database to use when connecting to TDengine server
# @config : Configuration directory
conn = taos.connect(host="127.0.0.1", user="root", password="taosdata", config="/etc/taos")
if len(sys.argv)>1:
hostname=sys.argv[1]
conn = taos.connect(host=hostname, user="root", password="taosdata", config="/etc/taos")
else:
conn = taos.connect(host="127.0.0.1", user="root", password="taosdata", config="/etc/taos")
# Generate a cursor object to run SQL commands
c1 = conn.cursor()
# Create a database named db
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册