Giter Club home page Giter Club logo

pyjokes

One line jokes for programmers (jokes as a service)

Installation

Install the pyjokes module with pip:

pip3 install pyjokes

Usage

Command line

Once installed, simply call pyjoke or pyjokes from the command line:

$ pyjoke
Why do Java programmers have to wear glasses? Because they don't see sharp.

Or add it to your .bashrc or .zshrc file to see a joke every time you open a terminal!

See pyjokes --help for more info.

Python

You can also access the jokes in your own project by importing pyjokes and using the function get_joke:

>>> import pyjokes
>>> print(pyjokes.get_joke())
Why do programmers confuse Halloween with Christmas? Because OCT 31 == DEC 25.

We support many languages, and have multiple joke categories:

>>> import pyjokes
>>> print(pyjokes.get_joke("eu"))  # basque joke
Zer dira 8 Bocabits? BocaByte bat
>>> print(pyjokes.get_joke("es", "chuck"))  # spanish chuck norris joke
El teclado de Chuck Norris no tiene tecla F1, es el ordenador el que le pide ayuda a él.

There is also a get_jokes function which returns all the jokes in the given language and category:

import pyjokes

for joke in pyjokes.get_jokes():
    print(joke)

Alternatively, use the pyjokes.forever generator function:

import pyjokes

for joke in pyjokes.forever():
    # This will go on forever... you're welcome.
    print(joke)

Maintainers

The project is maintained by the members of the PyJokes Society:

  • Ben Nuttall
  • Alex Savio
  • Borja Ayerdi
  • Oier Etxaniz (RIP)

Contributing

  • The code is licensed under the BSD Licence
  • Please use GitHub issues to submit bugs and report issues
  • Feel free to contribute to the code
  • Feel free to contribute jokes (via pull request or proposal issue)
  • See the contributing policy

Website and documentation

The pyjokes website and documentation is available at https://pyjok.es/

The story of pyjokes

The story of pyjokes was told by co-founder Ben Nuttall at the PyCon UK conference: https://www.youtube.com/watch?v=nCyquLc47RE

PyJokes logo

The logo was designed by Sam Alder. The PyJokes Society is eternally grateful for his contribution.

pyjokes's Projects

pyjokes icon pyjokes

One line jokes for programmers (jokes as a service)

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.