Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parsing string with KB/MB/GB etc into numeric value

Tags:

python

string

In order not to invent bicycle I wonder if there is any library that is able to parse various representations of size string (MB,KB,TB,MiB,KiB,etc..) into numeric byte based value.

like image 900
Pablo Avatar asked Mar 04 '12 13:03

Pablo


1 Answers

ActiveState Receipes has an example here , though this is just a snippet, and not a library as such.

The reason it isn't a library is due to the triviality of the task which user1227804 mentions in their comment.

like image 120
Appleman1234 Avatar answered Nov 03 '22 12:11

Appleman1234