Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

0
Don't know very much about python but I wanted to make a script to transfer files from my camera to my computer quicker, will this do the trick?
Post Flair (click to view more posts with a particular flair)
Post Body

I have very basic knowledge on python and heard chatgtp could be used pretty effectively for at least simpler things like this, so I thought I'd give it a try and to my eye it looks like this should work? All I'm trying to do here is take raw and jpeg photo files from my camera and put them each in a respective folder on my laptop when I run this with an SD card plugged in.

import os import shutil

def copy_files(source_folder, dest_folder_jpg, dest_folder_arw): if not os.path.exists(dest_folder_jpg): os.makedirs(dest_folder_jpg) if not os.path.exists(dest_folder_arw): os.makedirs(dest_folder_arw)

for filename in os.listdir(source_folder):
    file_path = os.path.join(source_folder, filename)
    if os.path.isfile(file_path):
        if filename.lower().endswith('.jpg'):
            shutil.copy(file_path, dest_folder_jpg)
        elif filename.lower().endswith('.arw'):
            shutil.copy(file_path, dest_folder_arw)

source_folder = 'E:/source_folder' dest_folder_jpg = 'C:/destination_folder_jpg' dest_folder_arw = 'C:/destination_folder_arw'

copy_files(source_folder, dest_folder_jpg, dest_folder_arw)

Author
Account Strength
50%
Account Age
1 year
Verified Email
Yes
Verified Flair
No
Total Karma
437
Link Karma
84
Comment Karma
353
Profile updated: 3 days ago
Posts updated: 8 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
9 months ago