Package gromacs :: Module core :: Class PopenWithInput
[hide private]
[frames] | no frames]

Class PopenWithInput

source code

      object --+    
               |    
subprocess.Popen --+
                   |
                  PopenWithInput

Popen class that knows its input.

1. Set up the instance, including all the input it shoould receive.
2. Call :meth:`PopenWithInput.communicate` later.

.. Note:: Some versions of python have a bug in the subprocess module
          ( `issue 5179`_ ) which does not clean up open file
          descriptors. Eventually code (such as this one) fails with the
          error:

              *OSError: [Errno 24] Too many open files*

          A weak workaround is to increase the available number of open
          file descriptors with ``ulimit -n 2048`` and run analysis in
          different scripts.

.. _issue 5179: http://bugs.python.org/issue5179

Instance Methods [hide private]
 
__init__(self, *args, **kwargs)
Initialize with the standard :class:`subprocess.Popen` arguments.
source code
 
communicate(self, use_input=True)
Run the command, using the input that was set up on __init__ (for use_input = True)
source code
 
__str__(self)
str(x)
source code

Inherited from subprocess.Popen: __del__, poll, wait

Inherited from subprocess.Popen (private): _close_fds, _communicate, _execute_child, _find_w9xpopen, _get_handles, _handle_exitstatus, _internal_poll, _make_inheritable, _readerthread, _set_cloexec_flag, _translate_newlines

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args, **kwargs)
(Constructor)

source code 
Initialize with the standard :class:`subprocess.Popen` arguments.

:Keywords:
   *input*
       string that is piped into the command
   

Overrides: object.__init__

communicate(self, use_input=True)

source code 
Run the command, using the input that was set up on __init__ (for use_input = True)
Overrides: subprocess.Popen.communicate

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)