Skip to content

Commit 5ed780c

Browse files
author
Metallicow
committed
Fix Shebang/CleanWS/print('Parenthesis')/__main__
Fix Shebang - Py2.4 complaints not found. CleanWS print('Parenthesis') if __name__ == __main__: wx.App(1)
1 parent 396d1ad commit 5ed780c

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

DisplayRes.py

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#!/usr/bin/env python2.4
1+
#!/usr/bin/env python
22

33
import wx
4-
4+
55
class MyApp(wx.App):
66
def OnInit(self):
77

@@ -11,20 +11,15 @@ def OnInit(self):
1111
Dw_i = Dw_mm / 25.4
1212
Dh_i = Dh_mm / 25.4
1313

14-
print "The display is %i by %i pixels"%(Dw, Dh)
15-
print "The display is %i by %i inches"%(Dw_i, Dh_i)
16-
print "resulting in %i by %i ppi"%(Dw / Dw_i, Dh / Dh_i)
14+
print("The display is %i by %i pixels" %(Dw, Dh))
15+
print("The display is %i by %i inches" %(Dw_i, Dh_i))
16+
print("resulting in %i by %i ppi" %(Dw / Dw_i, Dh / Dh_i))
1717

1818
dc = wx.ScreenDC()
19-
print " The system reports : %s PPI"%dc.GetPPI()
19+
print(" The system reports : %s PPI" %dc.GetPPI())
2020

2121
return True
22-
23-
24-
app = MyApp(0)
25-
app.MainLoop()
26-
27-
28-
29-
3022

23+
if __name__ == '__main__':
24+
app = MyApp(1)
25+
app.MainLoop()

0 commit comments

Comments
 (0)