python 计算程序剩余时间的小程序
生活随笔
收集整理的這篇文章主要介紹了
python 计算程序剩余时间的小程序
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
# 計(jì)算爬蟲剩余時(shí)間(根據(jù)程序剩余的個(gè)數(shù) 如 500->250)
import time# 開始的值
s_status0 = raw_input('input start value of status is 0: ')
start_time = time.clock()print "_"*10
print
print
print
print
print
print
print
print "_"*10# 結(jié)束的值
e_status0 = raw_input('input end value of status is 0: ')
m_status = int(s_status0) - int(e_status0)end_time = time.clock()
print 'total time: ' + str(end_time - start_time)second_count = (end_time - start_time)/m_status
hour = (second_count * int(e_status0))/3600
print 'the rest is: %.2f' % hour, 'hour'
print "%.2f" % (hour/24),'day'
raw_input('')
總結(jié)
以上是生活随笔為你收集整理的python 计算程序剩余时间的小程序的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: jquery 这些小技巧你懂吗
- 下一篇: QuickBooks Online Fo