出现黑屏,等待按键——如何? [英] Present blank screen, wait for key press -- how?

查看:44
本文介绍了出现黑屏,等待按键——如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

'瞧,

我目前正在尝试为我们计划运行的实验编写一个简单的例程.实验首先输入主题编号并创建一堆文件.我让那部分工作.接下来,我们希望屏幕变为空白并显示一条消息.类似于请填写问卷 1,完成后按 [ENTER]."

I am currently trying to code a simple routine for an experiment we are planning to run. The experiment starts by entering a subject number and creating a bunch of files. I got that part working. Next, we want the screen to go blank and display a message. Something like 'Please fill in questionnaire 1 and press [ENTER] when you are done.'

我的问题是,你如何建议我在空白屏幕上显示一条等待按下某个键的消息?

我有相当多的编程经验,但之前从未使用过 Python,因此非常感谢任何提示.非常感谢您抽出宝贵时间!

I have quite some programming experience but haven't worked with Python before so any hints are greatly appreciated. Thanks a lot in advance for your time!

~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~

一些可能相关的额外信息:我们在 Windows XP (Service Pack 2) 计算机上运行它.这样做的全部意义在于参与者基本上无法访问桌面或计算机上的任何内容.我们希望实验开始并在屏幕上显示一系列说明,受试者必须遵循这些说明,而他们无法中止等.希望这是有道理的.

Some extra info that might be relevant: We are running this on Windows XP (Service Pack 2) computers. The whole point of this is that the participant does not have access to the desktop or anything on the computer basically. We want the experiment to start and display a bunch of instructions on the screen that the subject has to follow without them being able to abort etc. Hope this makes sense.

推荐答案

如果您使用的是 Python 2,请使用 raw_input().

If you're in python 2, use raw_input().

如果您使用的是 python 3,请使用 input().

If you're using python 3, use input().

您可以提示用户输入信息并将结果存储为字符串.

You can prompt the user for information and store the result as a string.

在 python 2.x 中

in python 2.x

response = raw_input("What would you like to do next?")

在 python 3.x 中

in python 3.x

response = input("What would you like to do next?")

这篇关于出现黑屏,等待按键——如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆