This repository has been archived by the owner on Oct 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
check.py
208 lines (156 loc) · 4.86 KB
/
check.py
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
#!/usr/bin/env python
# -*- coding: latin-1 -*-
"""
script/SimpleGUICS2Pygame_check.py
(January 13, 2016)
Piece of SimpleGUICS2Pygame.
https://bitbucket.org/OPiMedia/simpleguics2pygame
GPLv3 --- Copyright (C) 2013, 2014, 2015, 2016 Olivier Pirson
http://www.opimedia.be/
"""
from __future__ import print_function
import os
import sys
########
# Main #
########
if __name__ == '__main__':
print("""script/SimpleGUICS2Pygame_check.py (January 13, 2016)
=====================================================""")
# Environment variables
print('PATH:')
path_str = os.getenv('PATH')
if path_str is not None:
for path in path_str.split(os.pathsep):
print(' ', path)
print()
print('PYTHONPATH:')
path_str = os.getenv('PYTHONPATH')
if path_str is not None:
for path in path_str.split(os.pathsep):
print(' ', path)
print('\n')
# Python
print('python - version', sys.version, end='\n\n')
print('sys.path:')
for path in sys.path:
print(' ', path)
print('\n')
# matplotlib
CMD = 'import matplotlib'
try:
import matplotlib
print(CMD, 'ok - Version', matplotlib.__version__)
except Exception as exc:
print(CMD, 'FAILED!', exc)
print('\n')
# Pygame
CMD = 'import pygame'
try:
import pygame
print(CMD, 'ok - Version', pygame.version.ver)
CMD = 'pygame.init()'
try:
SUCCESS, FAILED = pygame.init()
if FAILED == 0:
print(' ', CMD, SUCCESS, 'modules loaded ok')
else:
print(' ', CMD, SUCCESS, 'modules loaded',
FAILED, 'failed WARNING!')
except Exception as exc:
print(' ', CMD, 'FAILED!', exc)
except Exception as exc:
print(CMD, 'FAILED!', exc)
print('\n')
# simplegui
CMD = 'import simplegui'
try:
import simplegui
print(CMD, """PROBLEM - The package simplegui is installed!
It is a Python package which has the same name as SimpleGUI of CodeSkulptor,
but it is totally something else.
If you don't uninstall it,
you must replace the recommended import of SimpleGUICS2Pygame.
""")
except Exception as exc:
pass
# SimpleGUITk
CMD = 'import simpleguitk'
try:
import simpleguitk
print(CMD, """WARNING - The package simpleguitk is installed!
It is another implementation of SimpleGUI of CodeSkulptor,
using Tkinter and some others packages.
If you don't uninstall it,
you must be careful with the import of SimpleGUICS2Pygame.
""")
except Exception as exc:
pass
# SimpleGUICS2Pygame
CMD = 'import SimpleGUICS2Pygame'
try:
import SimpleGUICS2Pygame
print(CMD, 'ok - Version', SimpleGUICS2Pygame._VERSION)
except Exception as exc:
print(CMD, 'FAILED!', exc)
print()
CMD = 'import SimpleGUICS2Pygame.codeskulptor'
try:
import SimpleGUICS2Pygame.codeskulptor
print(CMD, 'ok')
except Exception as exc:
print(CMD, 'FAILED!', exc)
CMD = 'import SimpleGUICS2Pygame.codeskulptor_lib'
try:
import SimpleGUICS2Pygame.codeskulptor_lib
print(CMD, 'ok')
except Exception as exc:
print(CMD, 'FAILED!', exc)
CMD = 'import SimpleGUICS2Pygame.numeric'
try:
import SimpleGUICS2Pygame.numeric
print(CMD, 'ok')
except Exception as exc:
print(CMD, 'FAILED!', exc)
CMD = 'import SimpleGUICS2Pygame.simplegui_lib'
try:
import SimpleGUICS2Pygame.simplegui_lib
print(CMD, 'ok')
except Exception as exc:
print(CMD, 'FAILED!', exc)
CMD = 'import SimpleGUICS2Pygame.simplegui_lib_draw'
try:
import SimpleGUICS2Pygame.simplegui_lib_draw
print(CMD, 'ok')
except Exception as exc:
print(CMD, 'FAILED!', exc)
CMD = 'import SimpleGUICS2Pygame.simplegui_lib_fps'
try:
import SimpleGUICS2Pygame.simplegui_lib_fps
print(CMD, 'ok')
except Exception as exc:
print(CMD, 'FAILED!', exc)
CMD = 'import SimpleGUICS2Pygame.simplegui_lib_keys'
try:
import SimpleGUICS2Pygame.simplegui_lib_keys
print(CMD, 'ok')
except Exception as exc:
print(CMD, 'FAILED!', exc)
CMD = 'import SimpleGUICS2Pygame.simplegui_lib_loader'
try:
import SimpleGUICS2Pygame.simplegui_lib_loader
print(CMD, 'ok')
except Exception as exc:
print(CMD, 'FAILED!', exc)
CMD = 'import SimpleGUICS2Pygame.simpleguics2pygame'
try:
import SimpleGUICS2Pygame.simpleguics2pygame
print(CMD, 'ok')
except Exception as exc:
print(CMD, 'FAILED!', exc)
CMD = 'import SimpleGUICS2Pygame.simpleplot'
try:
import SimpleGUICS2Pygame.simpleplot
print(CMD, 'ok')
except Exception as exc:
print(CMD, 'FAILED!', exc)