1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Masja [62]
2 years ago
9

Create a Python script that takes two parameters to do the following:-

Computers and Technology
1 answer:
tekilochka [14]2 years ago
6 0

Answer:

import sys, time

from os import walk, remove

from os.path import exists, join, getsize, getctime

file_counter = [ ]

folder_name, file_size = argv

isExist = exists( folder_name )

if folder_name == True:

    for root, folder, files in walk( folder_name ):

          for file in files:

               if getsize( join ( root, file ) ) >= file_size:

                   file_log = [ ]

                   file_log.append( file )

                   file_log.append( join ( root, file) )

                   file_log.append( time.ctime( getctime( file ) ) )

                   file_counter.append( file_log )

               else:

                   remove ( join ( root, file ) )

Explanation:

The python script above output the filename, size and file creation date of any folder passed to it.

You might be interested in
Which of the following is the shortcut key combination for pasting copied text?
lys-0071 [83]
Ctrl + v pastes copied text, ctrl + p brings up a print menu, ctrl + x cuts and copies highlighted text, while ctrl + c copies the highlighted text.
3 0
3 years ago
Read 2 more answers
How to become a web developer ?​
statuscvo [17]

Explanation:

1.By Learning web development Fundamentals.

2.Choose a development specialization.

5 0
3 years ago
Choose the correct line of code.
Naddika [18.5K]
Def_pow_(self,b): if not then I’m sorry
5 0
3 years ago
15. Feelings (maps, coins, clues, etc.) and the invisClue books were some innovative ways used to keep __________ players engage
Anit [1.1K]

Answer:

pong i could be wrong i think its right tho

Explanation:

5 0
3 years ago
Read 2 more answers
Password procedures, information encryption software, and firewalls are examples of measures taken to address:
Gnoma [55]
<span>Password procedures, information encryption software, and firewalls are examples of measures taken to address are all measures taken to safeguard information security and protect users data from being tampered or manipulated by invaders. 

In web, if we leave our information without encryption or if we leave our system without firewall, different types of security threats might arise: such as, information being hacked, manipulated or sent to wrong places. To avoid this information encryption is done. We might also need to firewall our system so that we can avoid unwanted access and invading of our privacy using malwares and other tools. </span>
5 0
3 years ago
Other questions:
  • Why Stockholder are interested in the way a company operate?
    12·1 answer
  • Original Problem statement from the Text: A retail company must file a monthly sales tax report listing the sales for the month
    7·1 answer
  • A(n) ____ represents a particular type of object in the real world.
    7·1 answer
  • Who creates Virus ? virus is not made for what?
    14·2 answers
  • You are the IT Administrator for a small corporate network. Until now, the network has consisted only of workstations accessing
    6·1 answer
  • Friday Night Funkin Fans, does this count as a leak if I share it?
    13·2 answers
  • In 3-5 sentences describe whether or not files should be deleted from your computer explain your answer
    12·1 answer
  • In what situations might you need to use a function that calls another function?
    11·1 answer
  • Los organos de los sentidos perciben de la misma manera un estimulo?porque?
    8·1 answer
  • What are some limitations when it comes to testing and ensuring program quality? List at
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!