JPT, a dynamic Chrome extension, ushers in a seamless Python coding experience within ChatGPT, eliminating the hassle of tedious code copying and pasting. Users can harness the complete Python ecosystem, complete with powerful libraries like numpy, scipy, and matplotlib.
This nifty tool leverages Pyodide, a WebAssembly-based Python interpreter, ensuring that code execution transpires entirely within the confines of your browser. Rest assured, the only entities privy to your code are you and OpenAI.
Nonetheless, it’s important to note that while this extension is a promising addition, it’s still a work in progress and necessitates further refinement to emulate a genuine Jupyter Notebook experience within ChatGPT.
Putting JPT to work is a breeze. Simply request ChatGPT to whip up a “Hello, World!” Python program, then hit the “Run” button. Be patient with the first run, as it might take a bit longer, but subsequent runs should be quicker. For in-the-moment Python code edits, you can employ the “Edit” button, which doesn’t retain changes but serves for immediate adjustments.
Additionally, when it comes to importing Python packages, micropip comes to the rescue, offering commands like micropip.install("scipy")
. JPT arms users with the capability to run Python code, make on-the-fly Python code modifications, examine output from stdout, and view visually insightful plots courtesy of matplotlib.
However, it’s worth noting that JPT might experience a freeze if an infinite loop is encountered, necessitating an extension restart. While it doesn’t support user input at the moment, the developers are actively working towards integrating this feature in the near future, along with local filesystem support, chat exportation as notebooks, and an optimized extension size.