School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,416 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,558 people online right now. Registration is fast and FREE... Join Now!




Why isn't my if statement getting detected?

 

Why isn't my if statement getting detected?

xZachtmx

18 Jun, 2009 - 08:22 AM
Post #1

New D.I.C Head
*

Joined: 14 Jun, 2009
Posts: 38



Thanked: 1 times
My Contributions
ok im making an alarm clock desktop widget in python. So it reads the set alarm time from a file and it uploads the alarm time properly.

But im having trouble making the time's text changing colour whenever the hour matches the computer's internal clocks hour

CODE
     if alarmHour == int(time.strftime('%H')):
        timeColour = (0, 255, 0)
    


everything else is correct because it i take away the if statement the text turns colour... but i want it to only be green whenever the alarmHour matches the computer's clock hour. What am i doing wrong?

User is offlineProfile CardPM
+Quote Post


girasquid

RE: Why Isn't My If Statement Getting Detected?

18 Jun, 2009 - 11:03 AM
Post #2

Barbarbar
Group Icon

Joined: 3 Oct, 2006
Posts: 1,628



Thanked: 53 times
Dream Kudos: 825
My Contributions
Are you sure that alarmHour is matching? Try printing out alarmHour just before your if statement, along with what you're checking it against so that you can see whether they're actually matching or not.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/7/09 11:31PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month