【py code line 1】2023-02-17

In Eng
The three angle brackets (>>>) prompt:三个角括号(>>>)提示符
basic concepts will be shown in a series of snippets:基本概念将在一系列的代码片段中显示
you’ll need to install the Python extension 您需要安装Python扩展

To run your program, select Run4Run Without Debugging or press CTRL-F5

Working Efficiently with VS Code

Configuring VS Code

Simplifying the Output

By default, VS Code shows the output of your programs in an embedded
terminal window. This output includes the commands that are being used
to run the file. For many situations, this is ideal, but it might be more distracting than you want when you’re first learning Python.
To simplify the output, close all the tabs that are open in VS Code and
then quit VS Code
. Launch VS Code again and open the folder that contains the Python files you’re working on; this could just be the python_work(这里的folder很重要,是包含目标.py文件的文件夹)
folder where hello_world.py is saved.
Click the Run/Debug icon (which looks like a triangle with a small
bug), and then click Create a launch.json File. Select the Python options in
the prompts that appear. In the launch.json file that opens, make the following change:

将 from integratedTerminal to internalConsole
以下的consoleCH

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "internalConsole",
            "justMyCode": true
        }
    ]
}

open a .py file such as hello
_world.py, and run it by pressing CTRL-F5. In the output pane of VS Code, click
Debug Console if it’s not already selected. You should see only your program’s
output
, and the output should be refreshed every time you run a program

Commenting Out Blocks of Code 注释代码块
Ctrl+/

Sublime Text
Sublime Text is another minimalist editor that you should consider using if
you find VS Code too busy. Sublime Text has a really clean interface and is
known for working well even on very large files. It’s an editor that will get
out of your way and let you focus on the code you’re writing.
Sublime Text has an unlimited free trial, but it’s not free or open
source. If you decide you like it and can afford to purchase a full license,
you should do so. The purchase is a one-time fee; it’s not a software
subscription.

PyCharm
PyCharm is a popular IDE among Python programmers because it was built
to work specifically with Python. The full version requires a paid subscription, but a free version called the PyCharm Community Edition is also
available, and many developers find it useful.
If you try PyCharm, be aware that, by default, it sets up an isolated environment for each of your projects. This is usually a good thing, but it can
lead to unexpected behavior if you don’t understand what it’s doing for you.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值