To learn python, first learn to deploy its environment, then we will deploy the environment
In Linux, it is installed by default and can be installed by Yum or source if it is not installed.
Yum Installation: yum-y install python
SOURCE Installation:
To download the software first:
wget http://www.python.org/ftp/python/2.6.6/Python-2.6.6.tgz
Tar zxf python-2.6.6.tgz ; CD Python-2.6.6
./configure--prefix=/usr/local/python
Make && make install
To do a soft link:
ln-s/usr/local/python/bin/python/usr/bin/python
Now that Python is installed, let's take a look at how to use it.
python-v can view versions
python can enter the python environment
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/74/F5/wKioL1YvVHjTdxnEAAGHQ1Q_7pQ114.jpg "title=" 1.png " alt= "Wkiol1yvvhjtdxneaaghq1q_7pq114.jpg"/>
If you want to quit, you can press Ctrl + D to exit
We can write Python as a script, and call it a Python script.
The suffix of the Python script is. py
We can take a look.
Cat phthon.py
#!/usr/bin/env python
print "Hello World!!!"
This is a simple Python script that outputs "helloworld!"
This article is from the "Ride a Pig to Travel" blog, please be sure to keep this source http://songqinglong.blog.51cto.com/7591177/1706927
Python Learning notes (01)