Coder Social home page Coder Social logo

add_python_shebang's Introduction

Add shebang to python files

GitHub repo size GitHub contributors GitHub stars GitHub forks

Add shebang to python files is a utility that allows python developers to add a shebang to their Python files.

This script can be used to add a shebang to a python file, and also a Module Docstring and if __name__ == '__main__' to empty Python files. Personally I use it in vscode with Run on Save.

Installing add shebang to python files

To install add shebang to python files, follow these steps:

Linux and macOS:

  • Clone this repo
  • Copy add_shebang_cli.py to your PATH
  • Make add_shebang_cli.py executable with chmod +x add_shebang_cli.py

Using add shebang to python files

To use add shebang to python files, follow these steps:

  • Add the following lines in settings.json in vscode:
    "runOnSave.commands": [
        {
            "match": ".*\\.py$",
            "command": "add_shebang_cli.py ${file}",
            "runIn": "backend"
        }
    ]

Your python files will now be checked for shebang and if it's not present it will be added.

asciicast

Add run commands and examples you think users will find useful. Provide an options reference for bonus points!

Contributing to add shebang to python files

To contribute to add shebang to python files, follow these steps:

  1. Fork this repository.
  2. Create a branch: git checkout -b <branch_name>.
  3. Make your changes and commit them: git commit -m '<commit_message>'
  4. Push to the original branch: git push origin <project_name>/<location>
  5. Create the pull request.

Alternatively see the GitHub documentation on creating a pull request.

License

This project uses the following license: MIT License.

add_python_shebang's People

Contributors

sonnerberg avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.