making a memory only fileobject in python with pyfilesystem

后端 未结 1 1183
走了就别回头了
走了就别回头了 2021-01-24 17:18

I have written a motion detection/ video program using opencv2 which saves video output for x seconds. if motion in detected during that time, the output is saved as an altern

1条回答
  •  醉话见心
    2021-01-24 17:30

    To move your file form MemoryFS to real file system, you should read orig file and write it to dest file, something like

    with mem.open('output.avi', 'b') as orig:
        with open('c:\\motion\\' + time.strftime('%m-%d-%y_%H-%M-%S') + '.avi')) as dest:
            dest.write(orig.read())
    

    0 讨论(0)
提交回复
热议问题