 
      
    | You are here | abhinavomprakash.com | ||
| | | | | www.blog.pythonlibrary.org | |
| | | | | When you are working on your personal or work projects in Python, you usually want to have a way to enforce code standards. You can use tools like Flake8, | |
| | | | | hibbard.eu | |
| | | | | Learn how to create a GitHub action which sends a tweet whenever a pull request is merged. | |
| | | | | www.architect.io | |
| | | | | Learn how to automate the steps to build, test, and deploy your code using GitHub Actions. | |
| | | | | 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. | ||