No output is generated while executing the python files ...?
<p>I tried to execute these 2 files but no output is generated. I don't known whats the problem of not getting any output.please help me in understanding this problem.</p>

<pre><code># Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php or see LICENSE file.
# Copyright 2007-2009 Brisa Team &lt;brisa-develop@garage.maemo.org&gt;

from brisa.core.reactors import install_default_reactor
reactor = install_default_reactor()
print reactor

import os

from brisa.upnp.device import Device, Service
from brisa.upnp.device.service import StateVariable


class SwitchPower(Service):

    def __init__(self):
        Service.__init__(self,
                         'SwitchPower',
                         'urn:schemas-upnp-org:service:SwitchPower:1',
                         '',
                         os.getcwd() + '/SwitchPower-scpd.xml')
        self.target = False
        self.status = False


    def SetTarget(self, *args, **kwargs):
        self.target = kwargs['NewTargetValue']
        self.status = self.target
        self.set_state_variable('Status', self.target)
        print 'Light switched ', {'1': 'on', '0': 'off'}.get(self.target, None)
        return {}

    def GetTarget(self, *args, **kwargs):
        return {'RetTargetValue': self.target}

    def soap_GetStatus(self, *args, **kwargs):
        return {'ResultStatus': self.status}


class BinaryLight(object):

    def __init__(self):
        self.server_name = 'Binary Light Device'
        self.device = None
    def _create_device(self):
        project_page = 'https://garage.maemo.org/projects/brisa'
        self.device = Device('urn:schemas=upnp-org:device:BinaryLight:1',
                            self.server_name,
                            manufacturer = 'Ankit',
                            model_name = 'Binary Light Device',
                            model_description = 'Test Device',
                            model_number = '1.0',
                            model_url= project_page)
    def _add_service(self):
        switch = SwitchPower()
        self.device.add_service(switch)
    def start(self):
        self._create_device()
        self._add_services()
        self.device.start()
        reactor.add_after_stop_func(self.device.stop)
        reactor.main()

if __name__ == '__main__':
    device = BinaryLight()
    device.start()
</code></pre>

<p>2nd File:</p>

<pre><code>from brisa.core.reactors import install_default_reactor
reactor = install_default_reactor()

from brisa.core.threaded_call import run_async_function

from brisa.upnp.control_point.control_point import ControlPoint

from datetime import datetime

service = ('u', 'urn:schemas-upnp-org:service:SwitchPower:1')
binary_light_type = 'urn:schemas-upnp-org:device:BinaryLight:1'

def on_new_device(dev):
    """ Callback triggered when a new device is found.
    """
    print 'Got new device:', dev.udn
    print "Type 'list' to see the whole list"

    if not dev:
        return

def get_switch_service(device):
    return device.services[service[1]]

def create_control_point():
    """ Creates the control point and binds callbacks to device events.
    """
    c = ControlPoint()
    c.subscribe('new_device_event', on_new_device)
    c.subscribe('removed_device_event', on_removed_device)
    return c

def main():
    """ Main loop iteration receiving input commands.
    """
    c = create_control_point()
    c.start()
    run_async_function(_handle_cmds, (c, ))
    reactor.add_after_stop_func(c.stop)
    reactor.main()


def _exit(c):
    """ Stops the _handle_cmds loop
    """
    global running_handle_cmds
    running_handle_cmds = False

def _search(c):
    """ Start searching for devices of type upnp:rootdevice and repeat
    search every 600 seconds (UPnP default)
    """
    c.start_search(600, 'upnp:rootdevice')

def _get_status(c):
    """ Gets the binary light status and print if it's on or off.
    """
    try:
        service = get_switch_service(c.current_server)
        status_response = service.GetStatus()
        if status_response['ResultStatus'] == '1':
            print 'Binary light status is on'
        else:
            print 'Binary light status is off'
    except Exception, e:
        if not hasattr(c, 'current_server') or not c.current_server:
            print 'BinaryLight device not set.Please use set_light &lt;n&gt;'
        else:
            print 'Error in get_status():', e

def _get_target(c):
    """ Gets the binary light target and print if it's on or off.
    """
    try:
        service = get_switch_service(c.current_server)
        status_response = service.GetTarget()
        if status_response['RetTargetValue'] == '1':
            print 'Binary light target is on'
        else:
            print 'Binary light target is off'
    except Exception, e:
        if not hasattr(c, 'current_server') or not c.current_server:
            print 'BinaryLight device not set.Please use set_light &lt;n&gt;'
        else:
            print 'Error in get_target():', e
def _stop(c):
    """ Stop searching
    """
    c.stop_search()

def _list_devices(c):
    """ Lists the devices that are in network.
    """
    k = 0
    for d in c.get_devices().values():
        print 'Device no.:', k
        print 'UDN:', d.udn
        print 'Name:', d.friendly_name
        print 'Device type:', d.device_type
        print 'Services:', d.services.keys() # Only print services name
        print 'Embedded devices:', [dev.friendly_name for dev in \
             d.devices.values()] # Only print embedded devices names
        print
        k += 1

running_handle_cmds = True
commands = {'exit': _exit, 
            'help': _help,
            'search': _search,
            'stop': _stop,
            'list': _list_devices,
            'turn': _turn,
            'set_light': _set_light,
            'get_status': _get_status,
            'get_target': _get_target}


def _handle_cmds(c):
    while running_handle_cmds:
        try:
            input = raw_input('&gt;&gt;&gt; ').strip()
            if len(input.split(" ")) &gt; 0:
                try:
                    if len(input.split(" ")) &gt; 1:
                        commands[input.split(" ")[0]](c, input.split(" ")[1])
                    else:
                        commands[input.split(" ")[0]](c)
                except KeyError, IndexError:
                    print 'Invalid command, try help'
                except TypeError:
                    print 'Wrong usage, try help to see'
        except KeyboardInterrupt, EOFError:
            c.stop()
            break

    # Stops the main loop
    reactor.main_quit()


if __name__ == '__main__':
    main()
</code></pre>
