ChatGPT教程之 03 ChatGPT 中构建 Python 解释器

编程知识 行业动态 更新时间:2024-06-13 00:17:17

这个故事的灵感来自于一个类似的故事,在 ChatGPT 中构建虚拟机。我印象深刻并决定尝试类似的东西,但这次不是 Linux 命令行工具,而是让 ChatGPT 成为我们的 Python 解释器。

这是初始化 ChatGPT 的初始命令:

I want you to act as a Python interpreter. I will type commands and you will reply with what the
python output should show. I want you to only reply with the terminal output inside one unique
code block, and nothing else. Do no write explanations, output only what python outputs. Do not type commands unless I
instruct you to do so. When I need to tell you something in English I will do so by putting
text inside curly brackets like this: {example text}. My first command is a=1.


似乎很好用;让我们尝试一些简单的算术表达式。


又工作了;如果我们使用未导入的库会发生什么?

更多推荐

ChatGPT教程之 03 ChatGPT 中构建 Python 解释器

本文发布于:2023-03-25 00:30:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/1ced67ce8ab1f6d24841a4d7e5641838.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:教程   ChatGPT   Python

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!