Ros launch (Python Script) [closed]
I wrote a single node and package ros program
the python program is
#! /usr/bin/env python
import rospy
rospy.init_node('hassan')
print "My name is Hassan Ismail"
but when i launch the program then the following error occurred.
File "/home/robotics/catkin_ws/src/my_package/src/ismail.py", line 5
rospy.init_node('hassan')
^
IndentationError: unexpected indent
[hassan-2] process has died [pid 5873, exit code 1, cmd /home/robotics/catkin_ws/src/my_package/src/ismail.py __name:=hassan __log:=/home/robotics/.ros/log/f0f7a8d6-e629-11ea-9691-f54b74ed3492/hassan-2.log].
log file: /home/robotics/.ros/log/f0f7a8d6-e629-11ea-9691-f54b74ed3492/hassan-2*.log
I'm sorry, but this is not a ROS question.
I would suggest you post your question on a more appropriate forum. One about learning Python should be able to help you.
Take a look at the official docs for 2.7. Also, the hint that the interpreter is giving you