How to use the ahk.terminate function in ahk

To help you get started, we’ve selected a few ahk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fx-kirin / pyahk / test / script.py View on Github external
ahk.ready()
        # Define our function
        add = ahk.Function('add', int, '(x, y)', 'return x + y')
        # Test with an assortment of values
        for x, y in tests:
            result = add(x, y)
            expect = int(x) + int(y)
            self.assertEqual(result, expect,
                             msg="Unexpected result {0}, expected {1}!".format(
                             result, expect))

        with self.assertRaises(ValueError):
            # Error during type conversion
            add('abc', 'efg')
        # Cleanup
        ahk.terminate()