首页 > 编程语言 > 详细

python 获取时间 存入文件

时间:2015-02-02 15:22:01      阅读:577      评论:0      收藏:0      [点我收藏+]

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

python 获取时间 存入文件

原文:http://www.cnblogs.com/cj2014/p/4267608.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!