Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python help: I have a bunch of files, inside each file is a date (2012/03/22) I need to write a code that creates a directory

Python help: I have a bunch of files, inside each file is a date (2012/03/22) I need to write a code that creates a directory for the year-month, and day in the file. and then moves the files into the proper folder. so the end result would be inside the 2012 folder, inside the 03 folders, inside the 22 folders. is the file that contains 2012/03/22.

all while only using the os. module to list the dirs, move files, join paths etc

all of this should be done through functions and only using functions. also while making it portable to other computers. i have done this by making a basepath function to be stored as a variable with the base path being c:/user/username/python files/data to sort

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Online Market Research Cost Effective Searching Of The Internet And Online Databases

Authors: John F. Lescher

1st Edition

0201489295, 978-0201489293

More Books

Students also viewed these Databases questions