Skip to content

Commit aec4c07

Browse files
committed
Python code is now Python 3 compatible; PythonEngine now uses last known Python version; Memo font is now Consolas, size 10
1 parent 232a4ae commit aec4c07

File tree

1 file changed

+48
-37
lines changed

1 file changed

+48
-37
lines changed

Demos/Demo32/Unit1.dfm

Lines changed: 48 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ object Form1: TForm1
1616
OldCreateOrder = True
1717
Visible = True
1818
PixelsPerInch = 96
19-
TextHeight = 11
19+
TextHeight = 13
2020
object Splitter1: TSplitter
2121
Left = 0
2222
Top = 169
@@ -32,6 +32,12 @@ object Form1: TForm1
3232
Width = 576
3333
Height = 170
3434
Align = alClient
35+
Font.Charset = DEFAULT_CHARSET
36+
Font.Color = clWindowText
37+
Font.Height = -13
38+
Font.Name = 'Consolas'
39+
Font.Pitch = fpVariable
40+
Font.Style = []
3541
Lines.Strings = (
3642
'import spam'
3743
''
@@ -40,46 +46,46 @@ object Form1: TForm1
4046
' Self.OffsetBy(v, v)'
4147
''
4248
'p = spam.Point(2, 5)'
43-
'print p, type(p)'
49+
'print (p, type(p))'
4450
'p.OffsetBy( 3, 3 )'
45-
'print p.x, p.y'
46-
'print "Name =", p.Name'
51+
'print (p.x, p.y)'
52+
'print ("Name =", p.Name)'
4753
'p.Name = '#39'Hello world!'#39
48-
'print "Name =", p.Name'
54+
'print ("Name =", p.Name)'
4955
''
50-
'p = spam.Point(2, 5) '
51-
'print p, type(p)'
56+
'p = spam.Point(2, 5)'
57+
'print (p, type(p))'
5258
'p.OffsetBy( 3, 3 )'
53-
'print p.x, p.y'
59+
'print (p.x, p.y)'
5460
''
5561
'# create a subtype instance'
5662
'p = MyPoint(2, 5)'
57-
'print p, type(p)'
63+
'print (p, type(p))'
5864
'p.OffsetBy( 3, 3 )'
59-
'print p.x, p.y'
65+
'print (p.x, p.y)'
6066
'p.Foo( 4 )'
61-
'print p.x, p.y'
62-
'print dir(spam)'
63-
'print spam.Point'
64-
'print "p = ", p, " --> ",'
67+
'print (p.x, p.y)'
68+
'print (dir(spam))'
69+
'print (spam.Point)'
70+
'print ("p = ", p, " --> ",)'
6571
'if type(p) is spam.Point:'
66-
' print "p is a Point"'
72+
' print ("p is a Point")'
6773
'else:'
68-
' print "p is not a point"'
74+
' print ("p is not a point")'
6975
'p = 2'
70-
'print "p = ", p, " --> ",'
76+
'print ("p = ", p, " --> ",)'
7177
'if type(p) is spam.Point:'
72-
' print "p is a Point"'
78+
' print ("p is a Point")'
7379
'else:'
74-
' print "p is not a point"'
80+
' print ("p is not a point")'
7581
''
76-
'# You can raise error from a Python script to !'
82+
'# You can raise errors from a Python script too !'
7783

78-
'print "---------------------------------------------------------' +
79-
'---------"'
80-
'print "Errors in a Python script"'
84+
'print ("--------------------------------------------------------' +
85+
'----------")'
86+
'print ("Errors in a Python script")'
8187
'try:'
82-
' raise spam.EBadPoint, "this is a test !"'
88+
' raise spam.EBadPoint("this is a test !")'
8389
'except:'
8490
' pass'
8591
''
@@ -90,19 +96,21 @@ object Form1: TForm1
9096
' err.c = 3'
9197
' raise err'
9298

93-
'except spam.PointError, what: #it shows you that you can interce' +
94-
'pt a parent class'
95-
' print "Catched an error dirived from PointError"'
99+
'except spam.PointError as what: # this shows that you can interc' +
100+
'ept a parent class'
101+
' print ("Caught an error derived from PointError")'
96102

97-
' print "Error class = ", what.__class__, " a =", what.a, " ' +
98-
' b =", what.b, " c =", what.c'
103+
' print ("Error class = ", what.__class__, " a =", what.a, "' +
104+
' b =", what.b, " c =", what.c)'
99105
''
100-
'if p == spam.Point(2, 5): '
101-
' print "Equal"'
106+
'if p == spam.Point(2, 5):'
107+
' print ("Equal")'
102108
'else:'
103-
' print "Not equal"')
104-
ScrollBars = ssVertical
109+
' print ("Not equal")')
110+
ParentFont = False
111+
ScrollBars = ssBoth
105112
TabOrder = 0
113+
WordWrap = False
106114
end
107115
object Panel1: TPanel
108116
Left = 0
@@ -128,14 +136,17 @@ object Form1: TForm1
128136
Width = 576
129137
Height = 169
130138
Align = alTop
139+
Font.Charset = DEFAULT_CHARSET
140+
Font.Color = clWindowText
141+
Font.Height = -13
142+
Font.Name = 'Consolas'
143+
Font.Pitch = fpVariable
144+
Font.Style = []
145+
ParentFont = False
131146
ScrollBars = ssBoth
132147
TabOrder = 2
133148
end
134149
object PythonEngine1: TPythonEngine
135-
DllName = 'python27.dll'
136-
APIVersion = 1013
137-
RegVersion = '2.7'
138-
UseLastKnownVersion = False
139150
IO = PythonGUIInputOutput1
140151
Left = 32
141152
Top = 16

0 commit comments

Comments
 (0)