Re: [Pythonmac-SIG] Some test code

2011-02-03 Thread Fandekasp
If you have only 4 type of cards, it's even better to write a oneliner : print card in ["Hearts", "Diamonds"] and "That car is red" or "That card is > Black" On 3 February 2011 07:48, Henning Hraban Ramm wrote: > Am 2011-02-03 um 05:45 schrieb Chris Rebert: > > > if (card == "Hearts" or card

Re: [Pythonmac-SIG] [py-appscript] is System Events sleeping ?

2011-01-30 Thread Fandekasp
Ok so the only solution for me is to map a sleep key which will call my program and plan some tasks (threading.Timer), and my program will force my system to sleep after that. Thank you Adam for your answer ! On 30 January 2011 14:49, Adam Morris wrote: > Hi there, > > > I can force my system t

[Pythonmac-SIG] [py-appscript] is System Events sleeping ?

2011-01-30 Thread Fandekasp
Hello, I'm a new user of appscript, and I can't find a way to know when my computer is sleeping or not. with : > from appscript import * app("System Events").sleep() I can force my system to sleep, but what I would like is to know when my system is going to sleep, to launch some routines behi