How to test Pen Drive speed with Python Code

Its amazing to test pen drive speed with python, a small script in python can check the removable disk’s 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.