Skip to content

Demonstrate how to control device via ioctl from Python ✨🍰✨

License

Notifications You must be signed in to change notification settings

hrchu/playioctl

Repository files navigation

How to do hardware control via ioctl from Python feat. magnetic tape drive

Screenshot

Two operations, i.e., rewind and status, are presented. Both of the operations are implemented in three kinds of ways, including cpython extenstion, ctypes and fcntl. The code is intended to show how to do hardware control in Taipei.py (Sep. 2018) and europython 2020.

Prerequisites

  1. Python 3 / Linux
  2. You will need either a real tape drive or use mhvtl as a simulate tape drive.
  3. root privilege is necessary to operations of magnetic tape drive

How to run

  1. install the cpython extension
  • $ cd [project_home]/by_cpython_extension/pymt
  • $ pip install .
  1. Run the demo code $ python demo.py

Courtesy

About

Demonstrate how to control device via ioctl from Python ✨🍰✨

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published