标签:
1读文件:
file_path_name = ‘/home/robot/bzrobot_ws/src/bzrobot/bzrobot_comm/led_show_data/‘+file_name+‘.txt‘
open_file = open(led_file_path_name, ‘r‘)
data_read_file = open_file.read(4096)
2.写文件:
sys_time = rospy.get_time()
desk_path_name = ‘/home/wang/Desktop‘ (ubuntu的桌面路径)
write_file = open(led_file_path_name, ‘w‘)
write_file.write(str(sys_time))
标签:
原文地址:http://www.cnblogs.com/cj2014/p/4267608.html