第一天学习:python的安装及helloworld

1、linux 默认安装python,centos6.5默认python2.6,centos7默认python2.7
源码包安装:
# wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
# tar -xvf Python-2.7.10.tgz
# cd Python-2.7.10
# ./configure
# make
# make install
# python
Python 2.7.10 (default, Oct 15 2017, 05:50:03) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 

  

2、mac 默认安装python2.7
 
3、windows:在官网上:https://www.python.org/downloads/
下载python安装包,然后配置环境变量,
在系统环境变量中Path的值中加入 :D:\Python27;D:\Python27\Scripts;
验证:
D:\>python
Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] on wi
n32
Type "help", "copyright", "credits" or "license" for more information.
>>>

  

4、学习print:print ‘helloworld’
>>> print 'helloworld'
helloworld
>>>

  

posted @ 2017-10-16 19:49  男孩别哭  阅读(572)  评论(0编辑  收藏  举报