在Windows系统中搭建Python编程环境
#!/usr/bin/env python
此code表达在windows系统中pycharm使用条件!
ACISS码在不同工具中使用的条件
手机,MP3支持各种版本GB2312,
可收录不同文字用作编写程序
而电脑可支持GB18030
unicode表示为统一万国码,及各个国家的编码都可使用
它为每个语言中的每个字符设定了统一并且唯一的二进制编码,规定虽有的字符和符号最少由16位来表示(2个字节),即:2**16=65536
utf-8表示可变长的
utf-8用于Python2.0中将字符代码转换成中文,而在Python3.0不存在此情况,创作者已经将code进行了系统升级!
ACISS码转换的历史
ASCII 255 1bytes
--> 1980 gb2312 7000多汉字
--> 1995 GBK.0 2w+
--> GB18030 27xxx
--> unicode 2bytes
--> utf-8 e:1byte, zh:3bytes
-->raw_input 2.x = input 3.x
用户交互程序:
------info of %s ----
------info of ''' + character + ''' ----
------info of {_name}----
# Author Eric feng
name = input("name:")
#raw_input 2.x input 3.x
#input 2.x =
age = int(intput("age:"))#integer
print(type(age), type( str(age)))
job = input("job:")
salary = input("Salary:")
info = ""
-------info of %s -----
Name:%s
Age:%d
job:%s
Salary:%s
"%(name,name,age,job,salary)
info2 = ""
------info of {_name} -----
Name:{_name}
Age:{_age}
Job:{_salary}
'''.format(_name=name,
_age=age,
_job=job,
_salary=salary)
info3 = ""
-------info of {0}-----
Name:{0}
Age:{1}
Job:{2}
Salary:{3}
'''.format(name,age,job,salary)
print(info3)
这是三种不同用户交互模式
区别:info of 后缀格式不同,Y just use different code named "%s"But "%s"can not use into integer string,Y need change the %d to explore the number function,Sometimes plus "int" forhead of the age ,That will can be apply the program,
Second two:
Y just plus the {} this one to recongise different code.For instance {_name} and {int},So What is defferent ,You see. different line just like instead of the code,give the new meaning