Python 官方文档学习笔记 topic2 Using the Python Interpreter

来源:互联网 发布:中国最流行的编程语言 编辑:程序博客网 时间:2024/05/29 10:53
1.How to adddirectoryin dos:
set path=%path%;c:\python34
 
2.exit the interpreter
quit() or ctrl+z+enter
 

3.When commands are read from a tty,theinterpreter is said to be in interactive mode. 
4.True False
5. ctrl+c or del cancels the inputorinterrupt the program

6.On BSD'ish Unix systems ,Pythonscriptscan be made directly executable,like shell script, by putting the line

#! /usr/bin/env python3.4

(assuming that the interpreter is on the user's path)at the beginning of the script

7.Source code encoding 

# -*- coding: encoding -*-
the default encoding is UTF-8

8.The interactive startup file 

import osfilename = os.environ.get('PYTHONSTARTUP')if filename and os.path.isfile(filename):    exec(open(filename).read())
9.Customization modules    I can't understand this!
>>> import site>>> site.getusersitepackages()'/home/user/.local/lib/python3.2/site-packages'

0 0
原创粉丝点击