How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask Scott Your Own Question
Scott, MIT Graduate
Category: Homework
Satisfied Customers: 3040
Experience:  MIT Graduate (Math, Programming, Science, and Music)
Type Your Homework Question Here...
Scott is online now
A new question is answered every 9 seconds

Task 1 Write a python script to generate three sets of 50

Customer Question

Task 1
Write a python script to generate three sets of 50 files (150 files total) with random dates in the file name from within the last 50 days:
IT421_unixdate.txt, IT151_unixdate.txt, IT620_unixdate.txt
where unixdate is the seconds since Jan 01 1970. Ex:(###) ###-####is 03/03/2016 @ 0750
Example file: IT421_1456991403.txt
Task 2
Write a python script to:
Check if the folders IT421, IT151, IT620 exist, if they do not, create them.
Move the files that begin with ITx to the folder ITx
If the file already exists in the folder, rename it like the following example:
IT421_1456991403.txt becomes IT421_1456991403(1).txt, IT421_1456991403(1).txt becomes IT421_1456991403(2).txt, and so on….
Task 3
Write a python script to, using the date from the filename, display:
Oldest file
Newest file
How much time has elapsed between the newest and oldest file.
for each of the three folders.
Task 4
Write a python script to:
For each folder, create a folder called old if it does not exist.
Move all files older than 25 days into that folder.
Apply the same renaming scheme as done in task 2.
Submitted: 1 year ago.
Category: Homework
Customer: replied 1 year ago.
I need this before 8:00am PST
Customer: replied 1 year ago.
This is how the program starts.#!/usr/local/bin/python3
import random
import time
import osfolders = ["IT421", "IT151", "IT620"]#task2(1)for i in range(0,len(folders)):
if not os.path.exists(folders[i]):
for i in range (0,50):
for classIT in folders:
pastFiftyDays = int(time.time()) - 432000
currentTime = int(time.time())
timeStamp = str(random.randrange(pastFiftyDays, currentTime))
Expert:  Ingo U replied 1 year ago.


I'm just seeing this now, 40 minutes is a little tight, can you extend the deadline at all?

Customer: replied 1 year ago.
How about 8:40 am PST
Expert:  Ingo U replied 1 year ago.

I'll give it a try.

Expert:  Ingo U replied 1 year ago.

is the code you pasted something you were given and have to use, or is it your work in progress so far?

Customer: replied 1 year ago.
progress so far, but that is how it was suppose to be started
Customer: replied 1 year ago.
I am out the door right now and won't be available until around 8:15. I have to have this zipped and turned in by 8:50am PST.
Expert:  Ingo U replied 1 year ago.

I'm sorry,
After reviewing the question, I regret that I won't be able to assist you at this time.

I am opting out and opening the question up to other professionals here who may be able to help.

Ingo U

Customer: replied 1 year ago.
Thanks anyway. I appreciate your taking the time to look at it.
Customer: replied 1 year ago.
Too late: asking for a refund

Related Homework Questions