Sunday, 29 September 2013

Python method with *args and **args

Python method with *args and **args

I am trying to understand a method that uses *args, **kwargs,
Here is the complete details of the method,
Help on method open in module pyaudio:
open(self, *args, **kwargs) method of pyaudio.PyAudio instance
Open a new stream. See constructor for
:py:func:`Stream.__init__` for parameter details.
:returns: A new :py:class:`Stream`
..
class pyaudio.Stream(PA_manager, rate, channels, format, input=False,
output=False, input_device_index=None, output_device_index=None,
frames_per_buffer=1024, start=True,
input_host_api_specific_stream_info=None,
output_host_api_specific_stream_info=None, stream_callback=None)
PortAudio Stream Wrapper.
Use PyAudio.open() to make a new Stream.
__init__(PA_manager, rate, channels, format, input=False, output=False,
input_device_index=None, output_device_index=None, frames_per_buffer=1024,
start=True, input_host_api_specific_stream_info=None,
output_host_api_specific_stream_info=None, stream_callback=None)
Initialize a stream; this should be called by PyAudio.open(). A stream can
either be input, output, or both.
What I want to do is to use
PyAudio.open()
method and set the value of input_device_index= to 1
But I couldn't understand how to pass the arguments in this function as I
have no idea how these *args and **kwargs works.

No comments:

Post a Comment