selfteaching / selfteaching/selfteaching-python-camp
Day02 提交作业前,用终端给自己的脚本文件运行试验时,过程中的几个关键点
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 脚本路径”回车。
最彻底的方法是,更改下系统设置,使得可以在当前脚本所在文件夹直接打开cmd,保证路径一致。更改方法是:访达-服务-服务偏好设置-快捷键栏目下-新建位于文件夹位置的终端窗口打钩。然后,点中包含你要运行脚本的文件夹,右键-服务-新建位于文件夹位置的终端窗口,打开之后,直接输入“python xx.py”即可。
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the issue body as the proposed Day02 guidance for running a Python script from the terminal on macOS. Verify the described commands and paths against the project’s existing Day02 materials, then consider the documentation complete when the instructions have a clear location and are accurate and understandable to learners.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100