python
CTA定量交易策略
C ,qt,Python量化交易
展开
-
python学习之绘图
from turtle import * colormode(255) lt(90) lv = 14 l = 120 s = 45 width(lv) r = 0 g = 0 b = 0 pencolor(r, g, b) penup() bk(l) pendown() fd(l) def draw_tree(l, level): global r, g, b # save the current...原创 2019-05-03 18:06:20 · 272 阅读 · 0 评论 -
NameError: name 'tcplink' is not defined
Python 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 03:37:03) [MSC v.1900 64 bit (AMD64)] on win32 Type “copyright”, “credits” or “license()” for more information. from turtle import * RESTART: C...原创 2019-05-03 19:19:09 · 1896 阅读 · 1 评论 -
TypeError: a bytes-like object is required, not 'str'
RESTART: C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python36_64/server.py Waiting for connection… RESTART: C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python36_64/server.py W...原创 2019-05-03 19:48:51 · 561 阅读 · 0 评论 -
TypeError: a bytes-like object is required, not 'str'
1:查找文件时: with open(fname, ‘rb’) as f: if b’some-pattern’ in tmp: continue 2:使用socketl连接时: mysock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) mysock.connect((‘www.py4inf.com’, 80)) mysock.send(...原创 2019-05-03 20:13:58 · 311 阅读 · 0 评论 -
python连接数据库
参考python核心编程 编写一个用户洗牌的脚本,根据用户输入,选择连接sqlserver或者MySQL,创建数据库、表,随机生成数据,并实现增删改查。 其中,为了兼容python2和python3,统一了打印函数、录入函数、动态导包等 一些字段声明为全局变量,这样我们在后续的学习中,可以引用这些变量和函数。 ushuffle.py: 复制代码 #python 3.6 #统一输出函数,使用dist...转载 2019-05-05 18:04:06 · 331 阅读 · 0 评论