神秘的无功能脚本 - 非常简单 [英] mysteriously nonfunctioning script - very simple

查看:58
本文介绍了神秘的无功能脚本 - 非常简单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以帮我理解以下脚本

不起作用的事实吗?这很简单,我无法想象我错过了什么。任何

帮助将不胜感激。


和平,

STM

##闹钟:

从进口睡眠时间,时间,当地时间


wakeuptime =输入(''小时:''),输入(''分钟:'')

onehourlater =(wakeuptime [0] +1,wakeuptime [1])

而不是wakeuptime< localtime(time())[3:5]< onehourlater:

睡觉(3)

打印''播放声音文件''

解决方案

< BLOCKQUOTE>>>>>> se**********@yahoo.com (Sean McIlroy)(SM)写道:

SM>任何人都可以帮我理解以下脚本的事实
SM>不工作?这很简单,我无法想象我错过了什么。任何
SM>帮助将不胜感激。




你的意思是它不起作用?

-

Piet van Oostrum< pi ** @ cs.uu.nl>

网址: http://www.cs.uu.nl/~piet [PGP]

私人电子邮件: pi ** @ vanoostrum.org


Sean McIlroy写道:

任何人都可以帮助我理解以下剧本
不起作用的事实?这很简单,我无法想象我错过了什么。任何
帮助将不胜感激。




总是发布问题的实际追溯,如果

确实它正在产生追溯。通过*剪切和粘贴*来做这件事总是

,而不是通过重新输入文本。确保

确保不删除任何重要内容,并确保

您运行的是您在此处发布的实际代码。


还总是比

更详细地描述问题只是不起作用。据我们所知,代码运行很好但是它的输出不适合你...


-Peter


2005年3月25日22:13:09 -0800, se **** ****** @ yahoo.com (Sean McIlroy)

在comp.lang.python中声明了以下内容:

任何人都可以帮助我理解以下脚本
不起作用的事实?这很简单,我无法想象我错过了什么。任何
帮助将不胜感激。

和平,
STM

##闹钟:
从进口时间进入睡眠,时间,当地时间

wakeuptime =输入(''小时:''),输入(''分钟:'')


不推荐使用input() ...使用raw_input()和

显式转换数据。

onehourlater =(wakeuptime [0] +1,wakeuptime [1])
而不是唤醒时间< localtime(time())[3:5]< onehourlater:


怎么样把括号括起来...我倾向于读它

as(不是唤醒时间)< ...

- ===================================== ============= ============<
wl ***** @ ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG<
wu******@dm.net | Bestiaria支持人员<
========================================= ========= ============<
主页:< http://www.dm.net/~wulfraed/> <
溢出页面:< http://wlfraed.home.netcom.com/> <



Can anybody help me make sense of the fact that the following script
doesn''t work? It''s so simple I can''t imagine what I''m missing. Any
help will be much appreciated.

Peace,
STM
## ALARM CLOCK:
from time import sleep,time,localtime

wakeuptime = input(''hours: ''), input(''minutes: '')
onehourlater = (wakeuptime[0]+1, wakeuptime[1])
while not wakeuptime < localtime(time())[3:5] < onehourlater:
sleep(3)
print ''PLAY A SOUND FILE''

解决方案

>>>>> se**********@yahoo.com (Sean McIlroy) (SM) wrote:

SM> Can anybody help me make sense of the fact that the following script
SM> doesn''t work? It''s so simple I can''t imagine what I''m missing. Any
SM> help will be much appreciated.



What do you mean `it doesn''t work''?
--
Piet van Oostrum <pi**@cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: pi**@vanoostrum.org


Sean McIlroy wrote:

Can anybody help me make sense of the fact that the following script
doesn''t work? It''s so simple I can''t imagine what I''m missing. Any
help will be much appreciated.



Always post actual tracebacks of the problem, if
indeed it is producing a traceback. Do this always
by *cut and paste*, not by retyping the text. Make
sure not to remove anything important, and make sure
you are running the actual code you have posted here.

Also always describe the problem in more detail than
just "doesn''t work". For all we know, the code runs
fine but its output just doesn''t suit you...

-Peter


On 25 Mar 2005 22:13:09 -0800, se**********@yahoo.com (Sean McIlroy)
declaimed the following in comp.lang.python:

Can anybody help me make sense of the fact that the following script
doesn''t work? It''s so simple I can''t imagine what I''m missing. Any
help will be much appreciated.

Peace,
STM
## ALARM CLOCK:
from time import sleep,time,localtime

wakeuptime = input(''hours: ''), input(''minutes: '')
Use of input() is not recommended... Use raw_input() and
explicitly convert the data.
onehourlater = (wakeuptime[0]+1, wakeuptime[1])
while not wakeuptime < localtime(time())[3:5] < onehourlater:
How about putting some parentheses on that... I tend to read it
as (not wakeuptime) < ...
-- ================================================== ============ <
wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
================================================== ============ <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.netcom.com/> <



这篇关于神秘的无功能脚本 - 非常简单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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