简体   繁体   English

当我在 VScode 中使用 python 在终端中写入时,我永远无法像教程那样在终端中写入。 我该如何解决?

[英]When I write in the terminal using python in VScode i can never write in the terminal like the tutorials are doing. how do I fix that?

this is what i get when I write in the terminal, (Im sorry, im super new)这是我在终端写的时候得到的,(对不起,我是新手)

You are typing in a z shell , but you are trying to execute python code.您正在输入z shell ,但您正在尝试执行 python 代码。 To enter python's interactive mode, you can simply type /usr/bin/local/python3 (or python3 directly might work if things are setup correctly on your computer).要进入 python 的交互模式,您只需键入/usr/bin/local/python3 (或者如果您的计算机上的设置正确,则直接使用python3可能会起作用)。 Once you do that, you should see something like一旦你这样做,你应该看到类似的东西

Python 3.9.2 (default, Jul 16 2021, 11:47:35) 
[Clang 12.0.5 (clang-1205.0.22.11)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 

in which you can type your lines of python code您可以在其中键入 python 代码行

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 windows 的 python 脚本中编写终端代码 - how can I write code of terminal inside python script at windows 当我在终端中编写 python 代码时,它只打印文件的旧版本(VScode) - When I write python code in terminal it only prints older version of the file (VScode) 如何使用 Python 写入文本文件,以便我可以在终端/gnuplot 中同时读取它 - How to write to a text file using Python such a way that I can read it simultaneously in the terminal/gnuplot 如何使用 Linux 终端中显示的 JSON 数据写入 JSON 文件 - How can i write the JSON data shown in my Linux terminal to a JSON file using Python 我可以用Python中的一个命令写入终端和给定文件吗? - Can I write to terminal and a given file with one command in Python? 如何在VSCode Python终端中循环到上一个命令 - How do I cycle to previous command in VSCode Python Terminal 如何在 VScode for Python 中将 PowerShell 终端更改为简单的终端? - How can I change a PowerShell terminal to a simple one in VScode for Python? 我如何在没有终端命令的情况下运行 vscode 运行 python - how can i vscode run python without terminal command 如何以编程方式在终端命令上写入预期的输入? - How can I programmatically write expected input on terminal command? 使用 Python 时如何摆脱 Vscode 终端中显示的路径? - How can I get rid of the path shown in Vscode terminal while using Python?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM