Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Python/Free_Disk_Space/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Free Disk Space
Script to find free disk space present in the given path.

## How to use this script?

Just type the following in your command prompt:

python script.py

## Screenshot
![demo](https://user-images.githubusercontent.com/56690856/99070578-8173a180-25d6-11eb-8eec-526624f80866.png)
13 changes: 13 additions & 0 deletions Python/Free_Disk_Space/script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import shutil

# Path
path = input("Enter the path:")

# Get the disk usage statistics
# about the given path
stat = shutil.disk_usage(path)

# Print free space in the disk
# shutil.disk_usage(path) returns a tuple with the attributes total, used and free in bytes, therefore the free disk space can be found in the index 2
print("Free disk space present in the given path:"+str(stat[2])+" bytes")