Giter Site home page Giter Site logo

python_school's Introduction

*.md格式是Markdown格式,需要Markdown的阅读器才能正确显示。 所以我们先下载可以阅读markdown格式的阅读器,这个角色可以用VSCode代替 所以在进行下面的步骤时,当安装完markdown preview enhanced后,使用VSCode重新打开本文件 在文件的空白处右键,选择MPE:打开侧边预览

准备工作

  1. 安装VSCode

在下一步之前保证已经安装了VSCode

  1. 安装插件
    1. Chinese (简体中文)
      • 用于中文支持
    2. Markdown All in One
      • Markdown的支持
    3. markdown preview enhanced
      • Markdown预览
    4. python
      • python适配
    5. python debugger
      • python调试
    6. python indent
      • python换行与缩进 增强codding体验
    7. pylance
      • 语言服务器 增强代码补全和智能感知 提供静态类型检测等
    8. isort
      • Shift + Alt + O对导入模块排序
    9. Black Formatter
      • black风格的代码格式化
    10. GitLens — Git supercharged
      • git拓展
    11. git graph
      • git线路图显示
    12. TONGYI AI
      • 通义灵码 使用通义千问模型的智能代码提示
    13. better comments
      • ! ? * TODO 双重注释 等特殊注释增加额外的显示效果
    14. bookmarks
      • 书签 方便快速跳转
    15. todo tree
      • 对于TODO注释自动形成树状结构 方便快速查看和跳转
    16. code spell checker
      • 拼写检查 选中对应的词 右键 找到对应的选项 可以添加词到字典中
    17. prettier
      • JavaScript、TypeScript、Flow、JSX、JSON、CSS、SCSS、Less、HTML、Vue、Angular、GraphQL、Markdown、YAML、C#、Elm、Java、Twig、XML、Svelte、Php代码进行格式化
    18. path intellisense
      • 路径智能提示
    19. live server
      • 启动一个本地服务器,用来预览网页(HTML文件)
  2. 安装python环境
    1. 进入python官网
    2. python可以多个版本共存
    3. 我们使用python3.11.9 点我直接下载
    4. 在安装时勾选Add PATH(或类似字样的选择)
  3. 创建一个干净的文件夹
  4. 打开VSCode
  5. 从左上角的 文件 选择 打开文件夹 选择刚刚创建的文件夹
  6. 在左侧的资源管理器中点击新建文件的按钮(alt text{width='20px'})
  7. 创建文件test.py
  8. 输入print("hello world")
  9. 按下F5 选择 python debugger 然后选择 python 文件
  10. 如果控制台显示hello world 则说明安装成功

运行python代码

运行python代码有很多方式 本质上都是调用python解释器 下面不带数字,一条就是一种方法,不是分步操作哦 带数字的才需要分步操作

  • VSCode中运行
    • F5 -> python debugger -> python 文件
    • 点击运行按钮(alt text{width='20px'})
  • 不使用VSCode
    1. 打开你喜欢的终端(一般电脑上都有的cmd,你可以使用Win+R输入cmd打开)
    2. 进入你想要运行的文件夹例如输入cd D:\python\test并回车
    3. 如果你的电脑上有多个python的版本,你需要具体指定哪个版本的python解释器路径
    4. 例如: C:\Users\Administrator\AppData\Local\Programs\Python\Python311\python.exe script.py
    5. 上面的例子是使用了位于上述路径的的python 来运行 D:\python\test\script.py文件

python_school's People

Contributors

iceriny avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.