python的前期工作

python版本

2.x = 默认编码 =ASSIC =不支持
3.x = 默认编码 =UNICODE =默认支持中文

python 2 vs 3
    1。 默认支持中文
    2. 不兼容2.x
    3. 核心语法调整,更易学
    4. 新特性默认只在3.x上有

 

python的缩进

       tab != 4个空格
    官方的要求是4个空格
    缩进级别必须保持一致

交互器模式
    
    开始--》cmd --> cd c:\  -->dir
    cd = change directory
    dir = 查看当前目录文件列表
    
    
    cd .. 返回上一层目录
    cd ../.. 返回上上一层目录
    cd ../../.. 返回上上上一层目录
    cd ../../../.. 返回上上上上一层目录


    D:\>"d:\Program Files\Python35\python.exe" c:\hello.txt
    Hello World!
       

 


    环境变量(;+文件地址)
    
    D:\Program Files\Python35\Scripts\;
    D:\ProgramFiles\Python35\;
    %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;
    D:\Program Files\Python27
    
    
    执行py程序方式为:
        1. 交互器,缺点程序不能永久保存,主要用与简单的语法测试相关
        2. 文件执行

 

 

 


    
   

posted @ 2017-08-10 10:40  NPJ  阅读(159)  评论(0编辑  收藏  举报