summaryrefslogtreecommitdiff
path: root/tests/manual/debugger/python/math.py
blob: c21ad293c594d7c7796ff709ce05e39d2c0fa3dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54

import sys
#from PyQt4 import QtGui



def testApp():
    app = QtGui.QApplication(sys.argv)

    class MessageBox(QtGui.QWidget):
        def __init__(self, parent=None):
            QtGui.QWidget.__init__(self, parent)
            self.setGeometry(200, 200, 300, 200)
            self.setWindowTitle("A Test Box")

    messageBox = MessageBox()
    messageBox.show()

    widget = QtGui.QWidget()
    widget.resize(200, 200)
    widget.show()

    return app.exec_()


def testMath():
    def square(a):
        x = a * a
        return a

    def cube(a):
        l = [1, 2, 4]
        t = (1, 2, 3)
        d = {1: 'one', 2: 'two', 'three': 3}
        s = u'unixcode'
        x = range(1, 10)
#        b = buffer("xxx")
        x = square(a)
        x = x * a
        x = x + 1
        x = x - 1
        return x

    print(cube(3))
    print(cube(4))
    print(cube(5))

def main():
    testMath()
    #testApp()
    return 0

if __name__ == '__main__':
    sys.exit(main())