How can I pr开发者_如何学Pythonint only the current time (not the date) to a file? I need it in this format...
13:55:36
I've tried a few different ideas but they all include the date too.
Try perusing this ctime reference
A combination of using time(), localtime(), strftime(), and the struct tm should get you there
Try strftime()
Use strftime! There is a code example on that page showing how to prepare for use of this function using time(), localtime()...
char timestring[12];
strftime(timestring,sizeof(timestring),"%T",timestruct);
puts(timestring);
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论