According to the programming tradition, the first to output a "hello,world!", the process is quite simple, directly on the command and results:
>>> print "hello,world!" hello,world!
In the Baidu Encyclopedia mentioned "..., in foreign countries using Python to do scientific calculation of research institutions are increasing, ...", and then a few of my son to learn the math problems to try:
>>> 10+3 >>> 12+18 30
I verify on the calculator, 10+3=13 is right, 12+16=28 is right, this is how to go!!!
In the actual application should put the input into the file, the use of the time used directly on the line, and will not be like the above is not a memory error or input wrong problem.
Next, print "hello,world!" Deposit hello.py
[email protected] pythontest]# cat >> hello.py <<EOF> print "hello,world!" > Eof[[email protected] pythontest]# lltotal 4-rw-r--r--. 1 root root 6 13:09 hello.py[[email protected] pythontest]# chmod +x hello.py [[email protected] pythontest]# Llto Tal 4-rwxr-xr-x. 1 root root 6 13:09 hello.py[[email protected] pythontest]# python hello.pyhello,world! Add the following to the first line of the Python file and you can execute it directly [[email protected] pythontest]# cat hello.py #!/usr/bin/env pythonprint "hello,world!" [Email protected] pythontest]#/hello.py hello,world!
Python self-study takeoff--try