#!/usr/bin/env python
"""
This script demostrates the way of subscribing to ros topics.
"""
#-*- encoding: utf-8 -*-
__author__ = 'shehzad ahmed'

import rospy
from std_msgs.msg import String

def eventin_cb(msg):
	rospy.loginfo("eventin_cb message: %s", msg.data)

if __name__ == '__main__':
    '''
    Initilize node and spin which simply keeps python 
    from exiting until this node is stopped
    '''
    rospy.init_node('simple_subscriber_python_examples_node', anonymous=False)
    rospy.loginfo("simple_subscriber_python_examples_node is now running")
    eventin_sub = rospy.Subscriber("/simple_publisher_python_examples_node/event_out", String, eventin_cb)
    rospy.spin()
