38093201e5c311828cb1d57a4cf2d1c0eea40b66
[swc-setup-installation-test.git] / swc-installation-test-1.py
1 #!/usr/bin/env python
2
3 """Test script to check required Python version.
4
5 Execute this code at the command line by typing:
6
7   python swc-installation-test-1.py
8
9 How to get a command line:
10
11 - On OSX run this with the Terminal application.
12
13 - On Windows, go to the Start menu, select 'Run' and type 'cmd'
14 (without the quotes) to run the 'cmd.exe' Windows Command Prompt.
15
16 - On Linux, either use your login shell directly, or run one of a
17   number of graphical terminals (e.g. 'xterm', 'gnome-terminal', ...).
18
19 Run the script and follow the instructions it prints at the end.
20
21 This test is separate to avoid syntax errors parsing the more
22 elaborate `swc-installation-test-2.py`.
23 """
24
25 import sys as _sys
26
27
28 __version__ = '0.1'
29
30
31 def check():
32     if _sys.version_info < (2, 6):
33         print('check for Python version (python):')
34         print('outdated version of Python: ' + _sys.version)
35         return False
36     return True
37
38
39 if __name__ == '__main__':
40     if check():
41         print('Passed')
42     else:
43         print('Failed')
44         print('Install a current version of Python!')
45         print('http://www.python.org/download/releases/2.7.3/#download')