How do I copy a file in Python?

前端 未结 16 2292
隐瞒了意图╮
隐瞒了意图╮ 2020-11-21 07:12

How do I copy a file in Python?

I couldn\'t find anything under os.

16条回答
  •  一个人的身影
    2020-11-21 07:50

    Python provides in-built functions for easily copying files using the Operating System Shell utilities.

    Following command is used to Copy File

    shutil.copy(src,dst)
    

    Following command is used to Copy File with MetaData Information

    shutil.copystat(src,dst)
    

提交回复
热议问题