#!/usr/bin/env python3
import rospy
from std_msgs.msg import Int32
import time

rospy.init_node('count')                                # ノード名「count」に設定
pub = rospy.Publisher('count_up', Int32, queue_size=1)  # パブリッシャ「count_up」を作成
rate = rospy.Rate(10)                                   # 10Hzで実行
n = 0

time.sleep(2)

while not rospy.is_shutdown():
        n += 1
        if n % 3 == 0:
            print("これは%d" % n)
            pub.publish(n)
        else:
            pub.publish(n)
        if n == 227:
            print("\nThis is unko\n")
        rate.sleep()

[((6, 0, 6, 24), 'rospy.init_node', 'rospy.init_node', ({(6, 16, 6, 23): '"""count"""'}, {}), "('count')", False, 'import rospy\n'), ((7, 6, 7, 54), 'rospy.Publisher', 'rospy.Publisher', (), '', False, 'import rospy\n'), ((8, 7, 8, 21), 'rospy.Rate', 'rospy.Rate', ({(8, 18, 8, 20): '10'}, {}), '(10)', False, 'import rospy\n'), ((11, 0, 11, 13), 'time.sleep', 'time.sleep', ({(11, 11, 11, 12): '(2)'}, {}), '(2)', False, 'import time\n'), ((13, 10, 13, 29), 'rospy.is_shutdown', 'rospy.is_shutdown', ({}, {}), '()', False, 'import rospy\n')]