Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8864441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:14:32+00:00 2026-06-14T16:14:32+00:00

If I run shutil.move(file, dest) on its own it works fine, the problem I’m

  • 0

If I run shutil.move(file, dest) on its own it works fine, the problem I’m having is when I loop through, the loop works fine without the shutil.move.

IOError: [Errno 2] No such file or directory: 'test.txt'

path = '/media/usb/Test/'
dest = '/media/usb/Done/'

for file in os.listdir(path):
    fullpath = os.path.join(path, file)
    f = open( fullpath , 'r')
    dataname = f.name
    print dataname

    shutil.copy(file, dest)

I know that this is something simple and I’ve tried a number of different things but just can’t get my head around this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T16:14:33+00:00Added an answer on June 14, 2026 at 4:14 pm

    You are giving shutil.copy the filename (file), and not the full path, so it can find the file.

    Maybe you meant :

    shutil.copy(fullpath, dest)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

run the following, and its supposed to return the company name. The xpath works
Run this at a KornShell (ksh): echo ${MYVAR} | sed 's/\//\\/g' It works fine
I run my JUnit tests through Eclipse (Helios, 1.3.0) through an ant build file
I run into this problem. I have a textarea which I only want to
In Python, when running shutil.rmtree over a folder that contains a read-only file, the
After run: mvn jetty:run HTTP ERROR: 503 Problem accessing /ContactManager. Reason: Service Unavailable Powered
I run in to a problem whan i do somthing like this var abc
Run into a rather interesting problem. An element generated as html and inserted into
I run into an interesting problem I want to understand. I have a table:
Run into a tricky problem with db4o and a simple nested structures. Problem: when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.