Giter VIP home page Giter VIP logo

wtpython's Introduction

PyPI - License PyPI - Python Version PyPI - Status PyPI PyPI - Wheel PyPI - Downloads Discord

Logo

What the Python?!

Find solutions to your Python errors without leaving your IDE or terminal!

Ever have Python throw an error traceback longer than a CVS receipt ๐Ÿงพ? Is it dizzying to read through a bunch of cryptic lines trying to figure out exactly what caused the error? Do you look at the traceback and go, "WHAT THE ....."?๐Ÿ˜•

What the Python (wtpython) is a simple terminal user interface that allows you to explore relevant answers on StackOverflow without leaving your terminal or IDE. When you get an error, all you have to do is swap python for wtpython. When your code hits an error, you'll see a textual interface for exploring relevant answers allowing you to stay focused and ship faster! ๐Ÿš€

wtpython is styled using Rich and the interface is developed using Textual.

Like what you see? Feel free to share #wtpython on social media!

Installation

This project is hosted on PyPI, allowing you to install it with pip.

pip install wtpython

Usage

When you're coding and running your script or application, then all of a sudden, you see an error and think to yourself "what the...?"

$ python example/division_by_zero_error.py
Traceback (most recent call last):
  File "/home/cohan/github/what-the-python/wtpython/example/division_by_zero_error.py", line 1, in <module>
    1 / 0
ZeroDivisionError: division by zero

All you have to do is jump to the beginning of the line and change python to wtpython and the magic will happen.

$ wtpython example/division_by_zero_error.py
# Magic! ๐ŸŽฉ

usage

If you want results but don't want to go into the interface, just pass the -n flag to see the Rich formatted traceback and links to the most relevant questions on StackOverflow.

no-display-usage

If you want, you can always run wtpython in place of python. wtpython is designed to allow your code to function normally and only acts when your code hits an error. wtpython will even allow you to pass arguments to your own script! If our code hits an error, please let us know.

Command Line Options

All command line options should be passed before your script and arguments passed to your script.

Flag Action
-n or --no-display Do not enter the interactive session, just print the error and give me the links!
-c or --copy-error Add the error message to your clipboard so you can look for answers yourself (it's okay, we understand).
--clear-cache wtpython will cache results of each error message for up to a day. This helps prevent you from getting throttled by the StackOverflow API.

Interface Hotkeys

Key Action
s Toggle the sidebar (questions list)
t View the traceback
โ†, k View previous question
โ†’, j View next question
d Open question in your browser
f Search for answers on Google
q, ctrl+c Quit the interface.
i Report an issue with wtpython

Roadmap

This project is still in the early phases, but we have big plans going forward. We hope to tackle:

  • Windows support (without WSL)
  • Jupyter integration
  • More interactive interface
  • User configuration settings
  • Much much more!

Feedback / Support

If you have any feedback, please create an issue or start a discussion. There is also a Discord server which you can join with this invite.

Contributing

See CONTRIBUTING.md

wtpython's People

Contributors

briancohan avatar ethansocal avatar vagishvela avatar mustafaquraish avatar dependabot[bot] avatar asishm avatar eniraa avatar graciedevine 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.