twstock
twstock copied to clipboard
'OutStream' object has no attribute 'readable'
作業系統 win10 python版本 python3 ide jupyter notebook
pip install後要import 出現如圖情形
想問一下該怎麼解?
開啟twstock/twstock/cli/best_four_point.py 並將所有stdout的刪除:
# -*- coding: utf-8 -*-
import io
import sys
import twstock
# XXX: Repalce sys.stdout prevent Windows UnicodeEncodeError on cmd.exe
#stdout = io.TextIOWrapper(
# getattr(sys.stdout, 'buffer', sys.stdout), encoding='utf-8', errors='replace')
def run(argv):
print('四大買賣點判斷 Best Four Point')
print('------------------------------')
for sid in argv:
bfp = twstock.BestFourPoint(twstock.Stock(sid))
bfp = bfp.best_four_point()
print('%s: ' % (sid), end='')
if bfp:
if bfp[0]:
print('Buy ', bfp[1])
else:
print('Sell ', bfp[1])
else:
print("Don't touch")