Skip to content

Commit

Permalink
hide output window
Browse files Browse the repository at this point in the history
  • Loading branch information
dkratzert committed Sep 10, 2023
1 parent 5479fb7 commit 323486d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions finalcif/tools/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)])
Expand Down Expand Up @@ -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'):
Expand Down

0 comments on commit 323486d

Please sign in to comment.