Python:替换"%time"

时间:2016-12-07 02:25:05

标签: python python-3.x jupyter

如我们所知,我们可以在"%time ..."的笔记本中使用Jupyter。但是,我们无法在Spyder中使用此行。我有几行用于阅读视频,进行图像处理,然后写一个新视频。

from moviepy.editor import VideoFileClip
from IPython.display import HTML

output = 'test_images/white.mp4' # output video
clip1 = VideoFileClip("test_images/solid.mp4") # video is readed by many clips
clip = clip1.fl_image(process_image) # process_image is a function for processing the image clips from a video
%time clip.write_videofile(output, audio=False)

HTML("""
<video width="960" height="540" controls>
  <source src="{0}">
</video>
""".format(output))

因此,如果我使用spyder (anaconda 3.0)该怎么办?是'%time'

的替代品

0 个答案:

没有答案