python_scripts icon indicating copy to clipboard operation
python_scripts copied to clipboard

用python3运行报错

Open 16bh opened this issue 8 years ago • 1 comments

Traceback (most recent call last): File "crawler.py", line 56, in parse_url_to_html f.write(html) TypeError: a bytes-like object is required, not 'str'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "crawler.py", line 119, in main() File "crawler.py", line 108, in main htmls = [parse_url_to_html(url, str(index) + ".html") for index, url in enumerate(urls)] File "crawler.py", line 108, in htmls = [parse_url_to_html(url, str(index) + ".html") for index, url in enumerate(urls)] File "crawler.py", line 60, in parse_url_to_html print(e.message) AttributeError: 'TypeError' object has no attribute 'message'

16bh avatar Feb 10 '17 10:02 16bh

sudo apt-get install tk-dev python-tk

zh-h avatar Feb 17 '17 15:02 zh-h