|
You are here |
schinckel.net | ||
| | | | |
blog.oddbit.com
|
|
| | | | | I recently acquired both a Raspberry Pi and a PiFace IO board. I had a rough time finding examples of how to read the input ports via interrupts (rather than periodically polling for values), especially for the newer versions of the PiFace python libraries. After a little research, here's some simple code that will print out pin names as you press the input buttons. Button 3 will cause the code to exit: #!/usr/bin/python import pifacecommon.core import pifacecommon.interrupts import os import time quit =... | |
| | | | |
www.morelightmorelight.com
|
|
| | | | | [AI summary] A blog post from 2010 discussing various topics including technology, design, and personal experiences, with a focus on learning and sharing knowledge. | |
| | | | |
willhaley.com
|
|
| | | | | See here an example of a custom Linux mount script, written in Python, that can be used to mount disks with /etc/fstab. The mount script is installed at /usr/bin/mount.my-command and is executable. #!/usr/bin/env python3 import sys import subprocess device = sys.argv[1] mount_point = sys.argv[2] options = sys.argv[4] # Any customization could be done here to the `mount` command that is run. mount_command = ['mount', '-o', options, device, mount_point] output = subprocess.run( mount_command, capture_output=True ) if output.returncode != 0: print("error mounting") print(output.stderr.decode('UTF-8')) sys.exit(output.returncode) See here how the custom script can then be used in /etc/fstab like any "normal" mount. | |
| | | | |
www.kaidenshi.com
|
|
| | | [AI summary] The author reviews their experience using FreeBSD as a daily driver operating system, highlighting its performance, installation process, and comparison with other OSes like Void Linux and OpenBSD. | ||