相关疑难解决方法(0)

键盘输入在Python中超时

你会如何提示用户输入一些信息但是在N秒后超时?

谷歌在http://mail.python.org/pipermail/python-list/2006-January/533215.html上指向了一个关于它的邮件线程,但似乎没有用.超时发生的语句,无论是sys.input.readline还是timer.sleep(),我总是得到:

<type'exception.TypeError'>:[raw_]输入最多需要1个参数,得2

以某种方式,除了没有抓住.

python timeout keyboard-input

53
推荐指数
8
解决办法
7万
查看次数

Python非阻塞控制台输入

我试图在Python中创建一个简单的IRC客户端(作为一个项目,我学习语言).

我有一个循环,我用它来接收并解析什么IRC服务器发送了我,但如果我用raw_input输入的东西,它停止循环在它的轨道死,直到我输入的东西(明显).

如何在没有循环停止的情况下输入内容?

提前致谢.

(我不认为我需要发布代码,我只想输入一些没有while 1循环停止的东西.)

编辑:我在Windows上.

python windows input

47
推荐指数
7
解决办法
5万
查看次数

如何设置raw_input的时间限制

在python中,有没有办法在等待用户输入时计算时间,以便在30秒后raw_input()自动跳过该函数?

python timeout raw-input python-2.7

21
推荐指数
2
解决办法
4万
查看次数

Python错误:io.UnsupportedOperation:fileno

我正在使用此链接中的服务器和客户端程序:http://www.bogotobogo.com/python/python_network_programming_tcp_server_client_chat_server_chat_client_select.php

当我运行客户端时遇到以下错误:

Traceback (most recent call last):
  File "client.py", line 26, in client
    read_sockets, write_sockets, error_sockets =     select.select(socket_list , [], [])
io.UnsupportedOperation: fileno
Run Code Online (Sandbox Code Playgroud)

我正在使用Python 3,但我已经使用print来改变所有行Python 2 to 3.

这是代码:

while 1:
        socket_list = [sys.stdin, s]
        # Get the list sockets which are readable
        read_sockets, write_sockets, error_sockets = select.select(socket_list , [], [])
Run Code Online (Sandbox Code Playgroud)

python sockets

16
推荐指数
1
解决办法
2万
查看次数