用pyTSL模拟TSLPy
Go to file
Wei guangjing 91f490ff45 fix bugs 2022-06-11 14:42:04 +08:00
README.md init 2022-06-09 12:04:46 +08:00
pyTSLPy.py fix bugs 2022-06-11 14:42:04 +08:00
setup.py fix bugs 2022-06-11 14:42:04 +08:00

README.md

pyTSLPy

用pyTSL模拟TSLPy。

范例

import pyTSLPy as ts

ts.SetConnectConfig('tslclient.ini')
dl = ts.DefaultConnectAndLogin('test')
if dl[0] == 0:
    print("登陆成功")
    data = ts.RemoteExecute("return 'return a string';", {})  # 执行一条语句
    print("数据:", data)
    Close = ts.RemoteExecute("return close();", {"StockID": "SH000001"})
    print("Close:", Close)
    ts.Disconnect()  # 断开连接
else:
    print(dl[1])
import pyTSLPy as ts

ts.ConnectServer('tsl.tinysoft.com.cn', 443)
dl = ts.LoginServer('user', 'password')
if dl[0] == 0:
    print("登陆成功")
    data = ts.RemoteExecute("return 'return a string';", {})  # 执行一条语句
    print("数据:", data)
    ts.Disconnect()  # 断开连接
else:
    print(dl[1])