File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,15 +35,18 @@ Getting started
3535
3636It's very simple to start using the `humanfriendly ` package::
3737
38- >>> import humanfriendly
39- >>> user_input = raw_input("Enter a readable file size: ")
40- Enter a readable file size: 16G
41- >>> num_bytes = humanfriendly.parse_size(user_input)
42- >>> print num_bytes
38+ >>> from humanfriendly import format_size, parse_size
39+ >>> from humanfriendly.prompts import prompt_for_input
40+ >>> user_input = prompt_for_input("Enter a readable file size: ")
41+
42+ Enter a readable file size: 16G
43+
44+ >>> num_bytes = parse_size(user_input)
45+ >>> print(num_bytes)
4346 16000000000
44- >>> print "You entered:", humanfriendly. format_size(num_bytes)
47+ >>> print( "You entered:", format_size(num_bytes) )
4548 You entered: 16 GB
46- >>> print "You entered:", humanfriendly. format_size(num_bytes, binary=True)
49+ >>> print( "You entered:", format_size(num_bytes, binary=True) )
4750 You entered: 14.9 GiB
4851
4952Command line
You can’t perform that action at this time.
0 commit comments