Re: [Tutor] copy/paste/move files
Ok! On Wed, May 17, 2017 at 4:11 PM, Alan Gauld via Tutorwrote: > On 17/05/17 20:09, Michael C wrote: > > > How do I move files to a designated folder or copy/paste? > > copy/paste is a UI specific thing, you don't do that in Python code. > What you do is either copy a file or move it. > > The shutil module provides easy functions for both. > See the documentation for the module. > > > -- > Alan G > Author of the Learn to Program web site > http://www.alan-g.me.uk/ > http://www.amazon.com/author/alan_gauld > Follow my photo-blog on Flickr at: > http://www.flickr.com/photos/alangauldphotos > > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] copy/paste/move files
On 2017-05-17 12:09, Michael C wrote: Hi all, How do I move files to a designated folder or copy/paste? The first hit when I googled "how to move a file using python" was http://stackoverflow.com/questions/8858008/how-to-move-a-file-in-python which in turn suggests the use of: os.rename() or shutil.move() depending on whether you need only to rename or to actually move a file. (The unix mv utility is used to do both but the 'twofor' is not available in Python to my knowledge.) Don't forget to import os or import shutil depending on your needs. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] copy/paste/move files
On 17/05/17 20:09, Michael C wrote: > How do I move files to a designated folder or copy/paste? copy/paste is a UI specific thing, you don't do that in Python code. What you do is either copy a file or move it. The shutil module provides easy functions for both. See the documentation for the module. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
[Tutor] copy/paste/move files
Hi all, How do I move files to a designated folder or copy/paste? thanks! ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor