Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie Question - Copy a file 1

Status
Not open for further replies.

golcarlad

Programmer
Nov 23, 2004
232
0
0
GB
Hi,

This is going to be a dumb question - but Ive just started Python today (from a C# background), using PythonWin too. I know how to programme fine in C#, so this environment is all a bit wierd to me.

Can someone give me a heads up to get a simple program working.

I just want to copy a file from one place and rename it in another with the todays time and date stamped within the name of the file. Should be pretty easy. I thought I could do it quickly, so I put this code together just to copy a file firstly:

Code:
import sys, string, os, shutil

copyfile("C:\Setup\foo.mdb", "C:\Output\foo.mdb")

but I keep getting an error message when I run:
Code:
...
NameError: name 'copyfile' is not defined


any help much appreciated - I know its a dumb question but I need to get started as quick as possible. Cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top