Khalsa Labs

Test Pen drive Speed with Python Code Easily

Its amazing to test pen drive speed with python, a small script in python checks the removable disk speed. Just run the code in python and you will get your Removable USB Flash Drive(Pen Drive) Speed. Here is how you can test pendrive speed with ptyhon

How to test Pen Drive speed with Python

It is so easy, just as 1.. 2.. 3..

  1. Plug -in Your Pen Drive to Computer
  2. Open Python 2.7
  3. Run the Code

Python Code For Crazy Speed Test

[alert style=”grey]

import time, os
path = raw_input("Enter the Path Drive Letter of Removale Drive. e.g I ")
pat= path.split(":")
testFile = path+":/crazyTest"
print "Checking your Removable Drive Speed......"
def test(sTime):
f = open(testFile,'a')
for i in range(0,160000):
f.write('we are testing write speed')
diff = time.clock() - sTime
speed = (os.stat(testFile).st_size/1048576)/diff
print "your Removable. drive speed is "+ str(100/int(diff)) +"% near above "+str(speed)+" mb/sec"
startTime = time.clock()


NOTE: May be you will get speed difference for different File Systems. If really I’ll be fixing this issue soon.

You can also check other Python scripts here: Python Scripts

The following two tabs change content below.
Python Developer and DIY lover.

want to comment ??

Your email address will not be published. Required fields are marked *