2 Replies - 125 Views - Last Post: 20 August 2019 - 01:37 AM Rate Topic: -----

#1 prkundan   User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 30
  • Joined: 14-June 18

Copying a file

Posted 19 August 2019 - 08:59 PM

import shutil
shutil.copy(“\\Om-pc\e\Office File\Access Original 14-16\Cash MAR.2017 TO APR.2019.accdb”, "C:\Users\KUNDAN\Desktop\Cash MAR.2017 TO APR.2019.accdb ")



The above code is giving the following error:
Traceback (most recent call last):
File "C:\Users\KUNDAN\backup.py", line 2
shutil.copy(“\\Om-pc\e\Office File\Access Original 14-16\Cash MAR.2017 TO APR.2019.accdb”, "C:\Users\KUNDAN\Desktop\Cash MAR.2017 TO APR.2019.accdb ")
^
SyntaxError: invalid character in identifier

Is This A Good Question/Topic? 1
  • +

Replies To: Copying a file

#2 Salem_c   User is offline

  • void main'ers are DOOMED
  • member icon

Reputation: 2372
  • View blog
  • Posts: 4,499
  • Joined: 30-May 10

Re: Copying a file

Posted 20 August 2019 - 01:15 AM

Look at how the first and second filenames in your post are coloured differently.

Look closer, see those funny looking “” which look almost, but not exactly like the "" you need to use.

Edit those characters, and you should be fine.
Was This Post Helpful? 0
  • +
  • -

#3 andrewsw   User is offline

  • never lube your breaks
  • member icon

Reputation: 6813
  • View blog
  • Posts: 28,190
  • Joined: 12-December 12

Re: Copying a file

Posted 20 August 2019 - 01:37 AM

Make sure that you are using a proper programming, plain text, editor, not word processing software.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1