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))

相关文章:

  • 2021-12-19
  • 2021-11-30
  • 2021-06-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-14
  • 2021-10-08
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案