How do I copy a file in python? -


how copy file in python? couldn't find under os.

shutil has many methods can use. 1 of is:

from shutil import copyfile  copyfile(src, dst) 

copy contents of file named src file named dst. destination location must writable; otherwise, ioerror exception raised. if dst exists, replaced. special files such character or block devices , pipes cannot copied function. src , dst path names given strings.


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -