forked from lmbelo/python4delphi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUnit1.dfm
More file actions
188 lines (183 loc) · 4.58 KB
/
Unit1.dfm
File metadata and controls
188 lines (183 loc) · 4.58 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
object Form1: TForm1
Left = 214
Top = 174
Width = 592
Height = 422
VertScrollBar.Range = 210
ActiveControl = Memo1
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = 11
Font.Name = 'MS Sans Serif'
Font.Pitch = fpVariable
Font.Style = []
OldCreateOrder = True
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object Splitter1: TSplitter
Left = 0
Top = 169
Width = 576
Height = 3
Cursor = crVSplit
Align = alTop
ExplicitWidth = 584
end
object Memo1: TMemo
Left = 0
Top = 172
Width = 576
Height = 170
Align = alClient
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Consolas'
Font.Pitch = fpVariable
Font.Style = []
Lines.Strings = (
'import sys'
'print (sys.version)'
''
'import spam'
''
'class MyPoint(spam.Point):'
' def Foo(Self, v):'
' Self.OffsetBy(v, v)'
''
'# old way to create a type instance'
'p = spam.CreatePoint(2, 5)'
'print (p, type(p))'
'p.OffsetBy( 3, 3 )'
'print (p.x, p.y)'
'print ("Name =", p.Name)'
'p.Name = '#39'Hello world!'#39
'print ("Name =", p.Name)'
''
'# new way to create a type instance'
'p = spam.Point(2, 5) # no need to use CreateXXX anymore'
'print (p, type(p))'
'p.OffsetBy( 3, 3 )'
'print (p.x, p.y)'
''
'# create a subtype instance'
'p = MyPoint(2, 5)'
'print (p, type(p))'
'p.OffsetBy( 3, 3 )'
'print (p.x, p.y)'
'p.Foo( 4 )'
'print (p.x, p.y)'
'print (dir(spam))'
'print (spam.Point)'
'print ("p = ", p, " --> ",)'
'if type(p) is spam.Point:'
' print ("p is a Point")'
'else:'
' print ("p is not a point")'
'p = 2'
'print ("p = ", p, " --> ",)'
'if type(p) is spam.Point:'
' print ("p is a Point")'
'else:'
' print ("p is not a point")'
'p = spam.CreatePoint(2, 5)'
'try:'
' print ("raising an error of class EBadPoint")'
' p.RaiseError() # it will raise spam.EBadPoint'
'except spam.PointError as what: # this shows that you can interc' +
'ept a parent class'
' print ("Caught an error derived from PointError")'
' print ("Error class = ", what.__class__, " a =", what.a,' +
' " b =", what.b, " c =", what.c)'
''
'# You can raise error from a Python script to !'
'print ("--------------------------------------------------------' +
'----------")'
'print ("Errors in a Python script")'
'try:'
' raise spam.EBadPoint("this is a test !")'
'except:'
' pass'
''
'try:'
' err = spam.EBadPoint()'
' err.a = 1'
' err.b = 2'
' err.c = 3'
' raise err'
'except spam.PointError as what: # this shows that you can interc' +
'ept a parent class'
' print ("Caught an error derived from PointError")'
' print ("Error class = ", what.__class__, " a =", what.a,' +
' " b =", what.b, " c =", what.c)'
''
'if p == spam.CreatePoint(2, 5):'
' print ("Equal")'
'else:'
' print ("Not equal")')
ParentFont = False
ScrollBars = ssVertical
TabOrder = 0
WordWrap = False
end
object Panel1: TPanel
Left = 0
Top = 342
Width = 576
Height = 41
Align = alBottom
BevelOuter = bvNone
TabOrder = 1
object Label1: TLabel
Left = 16
Top = 6
Width = 109
Height = 13
Caption = 'Select Python version :'
end
object Button1: TButton
Left = 336
Top = 6
Width = 75
Height = 25
Caption = 'Execute'
TabOrder = 0
OnClick = Button1Click
end
object cbPyVersions: TComboBox
Left = 144
Top = 6
Width = 161
Height = 21
Style = csDropDownList
TabOrder = 1
OnSelect = cbPyVersionsSelect
end
end
object Memo2: TMemo
Left = 0
Top = 0
Width = 576
Height = 169
Align = alTop
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Consolas'
Font.Pitch = fpVariable
Font.Style = []
ParentFont = False
ScrollBars = ssBoth
TabOrder = 2
end
object PythonGUIInputOutput1: TPythonGUIInputOutput
UnicodeIO = True
RawOutput = False
Output = Memo2
Left = 136
Top = 16
end
end