class_docstr: Runs a shell command in a 'with' context.
  
  This implementation is Win32-specific.
  
  Example:
      # Runs the command interactively with default console stdin/stdout
      with ShellCommandController('python -i') as scc:
          scc.run()
  
      # Runs the command using the provided functions for stdin/stdout
      def my_stdout_func(s):
          # print or save the string 's'
          write_to_stdout(s)
      def my_stdin_func():
          # If input is available, return it as a string.
          if input_available():
              return get_input()
          # If no input available, return None after a short delay to
          # keep from blocking.
          else:
              time.sleep(0.01)
              return None
    
      with ShellCommandController('python -i') as scc:
          scc.run(my_stdout_func, my_stdin_func)
class_docstr_tok: ["Runs","a","shell","command","in","a","'with","'","context",".","This","implementation","is","Win32-specific",".","Example",":","#","Runs","the","command","interactively","with","default","console","stdin\/stdout","with","ShellCommandController","(","'python","-i","'",")","as","scc",":","scc.run","(",")","#","Runs","the","command","using","the","provided","functions","for","stdin\/stdout","def","my_stdout_func","(","s",")",":","#","print","or","save","the","string","'s'","write_to_stdout","(","s",")","def","my_stdin_func","(",")",":","#","If","input","is","available",",","return","it","as","a","string",".","if","input_available","(",")",":","return","get_input","(",")","#","If","no","input","available",",","return","None","after","a","short","delay","to","#","keep","from","blocking",".","else",":","time.sleep","(","0.01",")","return","None","with","ShellCommandController","(","'python","-i","'",")","as","scc",":","scc.run","(","my_stdout_func",",","my_stdin_func",")"]
docstr: Runs the process using the system standard I/O.
  
  IMPORTANT: stdin needs to be asynchronous, so the Python
             sys.stdin object is not used. Instead,
             msvcrt.kbhit/getwch are used asynchronously.
docstr_tok: ["Runs","the","process","using","the","system","standard","I\/O",".","IMPORTANT",":","stdin","needs","to","be","asynchronous",",","so","the","Python","sys.stdin","object","is","not","used",".","Instead",",","msvcrt.kbhit\/getwch","are","used","asynchronously","."]
code: def _run_stdio(self):
      """Runs the process using the system standard I/O.
  
      IMPORTANT: stdin needs to be asynchronous, so the Python
                 sys.stdin object is not used. Instead,
                 msvcrt.kbhit/getwch are used asynchronously.
      """
      # Disable Line and Echo mode
      # lpMode = DWORD()
      # handle = msvcrt.get_osfhandle(sys.stdin.fileno())
      # if GetConsoleMode(handle, ctypes.byref(lpMode)):
      #    set_console_mode = True
      #    if not SetConsoleMode(handle, lpMode.value &
      #            ~(ENABLE_ECHO_INPUT | ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT)):
      #        raise ctypes.WinError()
  
      if self.mergeout:
          return self.run(
              stdout_func=self._stdout_raw,
              stdin_func=self._stdin_raw_block,
          )
      else:
          return self.run(
              stdout_func=self._stdout_raw,
              stdin_func=self._stdin_raw_block,
              stderr_func=self._stderr_raw,
          )
  
imports: import os, sys, threading
  import ctypes, msvcrt
  from ctypes import POINTER
  from ctypes.wintypes import HANDLE, HLOCAL, LPVOID, WORD, DWORD, BOOL, ULONG, LPCWSTR
label_desc: Use image node_id 10 for calling the Win32ShellCommandController obj's underlying member method code with example usage: obj._run_stdio() and returns: self, self