Fix python3 compatibility for iotop when installed
[iotop.git] / sbin / iotop
blobc5202d35a58b4aaa452418d27284a28469d2dd62
1 #!/usr/bin/python
2 # iotop: Display I/O usage of processes in a top like UI
3 # Copyright (c) 2007, 2008 Guillaume Chazarain <guichaz@gmail.com>, GPLv2
4 # See iotop --help for some help
6 from __future__ import print_function
7 import sys
9 try:
10 from iotop.ui import main
11 except ImportError as e:
12 print(e)
13 print('To run an uninstalled copy of iotop,')
14 print('launch iotop.py in the top directory')
15 else:
16 try:
17 main()
18 except KeyboardInterrupt:
19 pass
20 sys.exit(0)