File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 31
31
from matplotlib import verbose
32
32
from matplotlib import rcParams
33
33
34
+ # Process creation flag for subprocess to prevent it raising a terminal
35
+ # window. See for example:
36
+ # https://stackoverflow.com/questions/24130623/using-python-subprocess-popen-cant-prevent-exe-stopped-working-prompt
37
+ CREATE_NO_WINDOW = 0x08000000
38
+
34
39
# Other potential writing methods:
35
40
# * http://pymedia.org/
36
41
# * libmng (produces swf) python wrappers: https://github.com/libming/libming
@@ -189,7 +194,8 @@ def _run(self):
189
194
' ' .join (command ))
190
195
self ._proc = subprocess .Popen (command , shell = False ,
191
196
stdout = output , stderr = output ,
192
- stdin = subprocess .PIPE )
197
+ stdin = subprocess .PIPE ,
198
+ creationflags = CREATE_NO_WINDOW )
193
199
194
200
def finish (self ):
195
201
'Finish any processing for writing the movie.'
@@ -251,7 +257,8 @@ def isAvailable(cls):
251
257
p = subprocess .Popen (cls .bin_path (),
252
258
shell = False ,
253
259
stdout = subprocess .PIPE ,
254
- stderr = subprocess .PIPE )
260
+ stderr = subprocess .PIPE ,
261
+ creationflags = CREATE_NO_WINDOW )
255
262
p .communicate ()
256
263
return True
257
264
except OSError :
You can’t perform that action at this time.
0 commit comments