Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'OutStream' object has no attribute 'readable' #80

Open
jimmyyyeh opened this issue Feb 12, 2020 · 1 comment
Open

'OutStream' object has no attribute 'readable' #80

jimmyyyeh opened this issue Feb 12, 2020 · 1 comment

Comments

@jimmyyyeh
Copy link

作業系統 win10
python版本 python3
ide jupyter notebook

pip install後要import 出現如圖情形
想問一下該怎麼解?
messageImage_1581479623699

@joytsay
Copy link

joytsay commented May 4, 2020

開啟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")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants