interrupting a statement like ``x = 2L ** 2L ** 32''

Will Stuyvesant hwlgw at hotmail.com
Mon Oct 14 14:25:13 EDT 2002


How to interrupt a statement like
x = 2L ** 2L ** 32 
?  

My goal is to find a way to set a maximum time for statements.
The only thing that seems to work is a keyboard interrupt.  I am
using Windows so I do not know if the signal thing works.  So what
now?  Doing the calculation in another process, have that process
communicate with the calling process, via sockets perhaps, and
listening via select()?  Did anybody do this before and if so
could show some source code?  I even don't know how to start
another process and how to send it an interrupt from software.
Geez this is much harder than I thought it would be.


'''
QOTD, about interrupts

        Approaching the gates of the monastery, Hakuin found Ken
the Zen preaching to a group of disciples.
        "Words..." Ken orated, "they are but an illusory veil
obfuscating the absolute reality of --"
        "Ken!" Hakuin interrupted. "Your fly is down!"
        Whereupon the Clear Light of Illumination exploded upon
Ken, and he vaporized.
        On the way to town, Hakuin was greeted by an itinerant
monk imbued with the spirit of the morning.
        "Ah," the monk sighed, a beatific smile wrinkling across
his cheeks, "Thou art That..."
        "Ah," Hakuin replied, pointing excitedly, "And Thou art
Fat!"
        Whereupon the Clear Light of Illumination exploded upon
the monk, and he vaporized.
        Next, the Governor sought the advice of Hakuin, crying:
"As our enemies bear down upon us, how shall I, with such
heartless and callow soldiers as I am heir to, hope to withstand
the impending onslaught?"
        "US?" snapped Hakuin.
        Whereupon the Clear Light of Illumination exploded upon
the Governor, and he vaporized.
        Then, a redneck went up to Hakuin and vaporized the old
Master with his shotgun.  "Ha! Beat ya' to the punchline, ya'
scrawny li'l geek!"
'''



More information about the Python-list mailing list