我是靠谱客的博主 勤奋乐曲,最近开发中收集的这篇文章主要介绍Python学习笔记(一): Build envrionment,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

1. python官网:http://www.python.org/
2. Set environment variables for Python
2.1 首先需要在系统中注册python环境变量:假设python的安装路径为c:python2.6,则修改我的电脑->属性->高级->环境变量->系统变量中的PATH为:

PATH=PATH;D:ToolsPython33
上述环境变量设置成功之后,就可以在命令行直接使用python命令。或执行"python *.py"运行python脚本了。



2.2 此时,还是只能通过"python *.py"运行python脚本,若希望直接运行*.py,只需再修改另一个环境变量PATHEXT:

PATHEXT=PATHEXT;.PY;.PYM

2.4 如何使Python解释器能直接import默认安装路径以外的第三方模块?

为了能import默认安装路径以外的第三方的模块(如自己写的模块),需要新建PYTHONPATH环境变量,值为这个模块所在的目录。

3. Python help:

H:>python
Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 bit (In
tel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> help('print')
Help on built-in function print in module builtins:

print(...)
print(value, ..., sep=' ', end='n', file=sys.stdout, flush=False)

Prints the values to a stream, or to sys.stdout by default.
Optional keyword arguments:
file: a file-like object (stream); defaults to the current sys.stdout.
sep: string inserted between values, default a space.
end: string appended after the last value, default a newline.
flush: whether to forcibly flush the stream.

>>> help('hh');
no Python documentation found for 'hh'

>>> help('hh')
no Python documentation found for 'hh'

4. Exit Python

如何退出Python提示符
如果你使用的是Linux/BSD shell,那么按Ctrl-d退出提示符。如果是在Windows命令行中,则按Ctrl-z再按Enter。

最后

以上就是勤奋乐曲为你收集整理的Python学习笔记(一): Build envrionment的全部内容,希望文章能够帮你解决Python学习笔记(一): Build envrionment所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(51)

评论列表共有 0 条评论

立即
投稿
返回
顶部