Hey all, just trying to make a simple script in Python and getting an error.
Wondered if anyone would be kind enough to help me out.
All this is doing (or what im hoping its going to do) is run through a folder, checking if the extension of a file is whats given, if it is, it will move the file.
My error is at this line
shutil.move(folder."\\".filename, destination)
Points to the second quotation mark "invalid syntax.
Help appreciated.
Wondered if anyone would be kind enough to help me out.
All this is doing (or what im hoping its going to do) is run through a folder, checking if the extension of a file is whats given, if it is, it will move the file.
Code:
#! /usr/bin/env python
import sys
import os
import shutil
folder = os.path.join('F:\\', 'Tumblr')
destination = os.path.join('F:\\', 'jpeg')
extmove = 'jpeg'
for filename in os.listdir(folder):
extension = filename.split(".")[-1]
if extension == extmove:
shutil.move(folder."\\".filename, destination)
My error is at this line
shutil.move(folder."\\".filename, destination)
Points to the second quotation mark "invalid syntax.
Help appreciated.