Coders Packet

Stack Overflow error query tool using Python 3.0

By Nediff Amala Nixon

GUI based error query tool that will check for error in a python file and search for relevant discussions in Stack Overflow.

Software development involves lots of debugging where a developer spends countless hours searching for articles relevant to the error faced. This tool is created to ease the difficulty in finding valuable articles in Stack Overflow. 

This is a GUI based error query tool that will check for error in a python file and search for relevant discussions in Stack Overflow. Since Python is an interpreter language, the execution of the file will terminate at the occurrence of the first error. Only that error will be available to be searched. Once this error is resolved then the subsequent errors can be searched.

I have set the tool to return the first six queries fetched from the API.

Python 3.0 modules used:

1. PySimpleGUI module (using pip install)

This module will be used to design the GUI of the application.

In-built modules that were used to facilitate these above modules are subprocess, requests, sys and webbrowser.

Working of the tool:

1. The tool has various divisions such as getting the file directory to search for the error, process the error, search the error using Stack Overflow API, produce a list of URLs and let the user choose the URLs to open.

2. The user can browse the .py file that will be searched for any error.

3. Once an error is found, the user is asked to choose where to find queries for the error found or not.

4. Process the error and embed it into the Stack Overflow API URL.

5. For example an error will be processed which results in an error string like "TypeError unsupported operand type(s) for +: 'int' and 'str'"

6. This string will be used in the API link, for example https://api.stackexchange.com/"+"2.2/searchorder=desc&sort=activity&tagged=python&intitle={}&site=stackoverflow".format(error)

where the intitle={} will be the error string.

7. This will be requested using the requests module. The result will be stored in a JSON format.

8. From this JSON data, get the top 6 URLs for the error query and store them in a dictionary with topic and URL as key-value pair.

9. These topics will then be displayed in the GUI for the user to choose.

10. The user can choose to open multiple links and once the user clicks the "open links" button, the chosen links will open in the default browser.

Run the start.py file to start the application.

Download project

Reviews Report

Submitted by Nediff Amala Nixon (nixonnna)

Download packets of source code on Coders Packet