一 、Python可以做什么?
可以做网站、后台,可以做很多事情。Python的运行速度比较慢,不过不会影响正常的使用。
Python是解释性语言通过解释器完成相关的工作,Python的解释器有很多,CPython等
二、Python环境搭建完成时候在cmd命令行中输入Python即可进入执行Python语句,exit()退出Python
#是行注释,Python的格式还是比较严格的, : 表示缩进
Python也是大小写敏感的,变量可以是字母、数字、下划线、美元符号,要以字母下划线开头
三、编码问题
字符串有三种编码格式:ASCII、utf-8 、 Unicode
#解决程序中的中文
# -*- coding:utf-8 -*-
#输出
print "This is first python "
#输入
s = raw_input("please input :")
#格式化输出
print "This is input %s" % s
#变量
a = 'abc'
b = a
a = 'qwe'
print b
c = True
print not c
d = True
e = False
print d and e
print d or e
#编码问题
sd = u'编码问题'
print sd
#将unicode编码转换成utf-8
jk = sd.encode('utf-8')
#将utf-8转换成unicode
jk = jk.decode('utf-8')
print jk