selfteaching / selfteaching/selfteaching-python-camp

Day02 提交作业前,把脚本在自己的终端做运行试验的几个关键点

Open
#111 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

学习心得分享
Dominant language
Python
Stars
151
Forks
875
PR merge metrics
No merged PRs in 30d

Description

1、从网上寻找输出“hello_world”的代码很简单,建立xx.py文件。

2、为了保险,就在自己的“终端上”试着运行一下。

3、之后有两种方法运行:

(1)打开终端,输入:python回车,确认python环境,然后输入“print('hello_world')”,就可以得到结果 。

(2)直接运行脚本,前提先让解析器能够找到脚本,即确认cmd当前路径是否和脚本所在路径一至。输入pwd,确认当前cmd所在路径,如果与脚本位置一致,直接输入“python xx.py”回车,ok;如果与脚本位置不一致,可以使用“~/anaconda3/bin/python 脚本路径”回车。

(3)最彻底的方法是,更改下系统设置,使得可以在当前脚本所在文件夹直接打开cmd,保证路径一致。更改方法是:访达-服务-服务偏好设置-快捷键栏目下-新建位于文件夹位置的终端窗口打钩。然后,点中包含你要运行脚本的文件夹,右键-服务-新建位于文件夹位置的终端窗口,打开之后,直接输入“python xx.py”即可。

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the issue body as a candidate for instructional documentation about running a Python script from a terminal. Check the Python commands and the macOS Finder/Services steps described there. Done means the intended documentation change and its scope are made explicit and the resulting instructions are clear and accurate.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.