Skip to content

Instantly share code, notes, and snippets.

@APTy
Last active January 10, 2017 01:07
Show Gist options
  • Save APTy/29f22f28471b37ba00fa032859cb6ab9 to your computer and use it in GitHub Desktop.
Save APTy/29f22f28471b37ba00fa032859cb6ab9 to your computer and use it in GitHub Desktop.
greetme

greetme

The greetme tool will greet any user! This project is an example of how to install a python script from a GitHub Gist.

Installation

You can install this project using pip and run it as follows:

sudo pip install -e git+https://gist.github.com/APTy/29f22f28471b37ba00fa032859cb6ab9#egg=greetme
greetme Tyler

You can modify to install in a virtual environment as needed.

"""CLI used for greeting the user."""
import sys
def usage():
"""Displays program usage and exits with an error."""
print("Usage: greetme <your_name>")
sys.exit(1)
def main():
"""Greets the user."""
if len(sys.argv) != 2:
usage()
name = sys.argv[1]
print("Hello, {}!".format(name))
if __name__ == "__main__":
main()
from setuptools import setup, find_packages
setup(
name='greetme',
version='0.1.0',
description='CLI for greeting a user',
packages=find_packages(),
entry_points={'console_scripts': [
'greetme=greetme:main',
]}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment