File: fdisk.py

package info (click to toggle)
python3-dmm 0.1.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 540 kB
  • sloc: python: 441; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 298 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
""" Wrapper around fdisk """
import os


from subprocess import (PIPE, Popen)


def invoke(command):
    '''
    Invoke process and return its output.
    '''
    return Popen(command, stdout=PIPE, shell=True).stdout.read()


def list_disks():
    disklist = invoke('fdisk -l')
    print(disklist)