diff --git a/finalcif/tools/process.py b/finalcif/tools/process.py index 82ab83d7..610a193e 100644 --- a/finalcif/tools/process.py +++ b/finalcif/tools/process.py @@ -39,6 +39,8 @@ def run_process(self): threading.Thread(target=self._monitor_output_log).start() # self.process.readyReadStandardOutput.connect(self.on_ready_read) self.process.finished.connect(self._onfinished) + if sys.platform.startswith('win'): + self.process.setCreateProcessArgumentsModifier(self.hide_window) self.process.setWorkingDirectory(str(self.cif_file.parent)) self.cif_file.with_suffix('.chk').unlink(missing_ok=True) self.process.start(self.platon_exe, ["-U", str(self.cif_file.name)]) @@ -85,6 +87,11 @@ def _parse_chk_file(self): if line.startswith('# Z'): self.Z = line[19:24].strip(' ') + def hide_window(self, args): + # This needs Windows + args[0] = args[0] | 0x08000000 # CREATE_NO_WINDOW flag + return args + @property def platon_exe(self): if sys.platform.startswith('win'):