【发布时间】:2020-08-20 16:16:27
【问题描述】:
Ubuntu 18.04.2 LTS 上的 Python 3.7.1
使用 Pycharm 版本:
PyCharm 2019.1.3 (Professional Edition)
Build #PY-191.7479.30, built on May 30, 2019
Linux 4.18.0-22-generic
os.get_terminal_size() 函数调用有问题
从终端窗口运行命令有效:
Python 3.7.1 (default, Oct 22 2018, 11:21:55)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.get_terminal_size()
os.terminal_size(columns=223, lines=18)
但是从 Python 控制台窗口运行它不会
>>>import os
>>>os.get_terminal_size()
Traceback (most recent call last):
File "<input>", line 1, in <module>
OSError: [Errno 25] Inappropriate ioctl for device
我的谷歌搜索没有针对我手头的问题提供太多信息。 OSError: [Errno 25] Inappropriate ioctl for device 究竟是什么意思,我该如何解决?
【问题讨论】:
标签: module operating-system pycharm python-3.7