编辑---编译----运行
python@ubuntu:~/Desktop/pythons06$ vim 01-第1个c语言.c
#include<stdio.h>
int main(int argc,char ** argv)
{
printf("hello world\n");
return 0;
}
python@ubuntu:~/Desktop/pythons06$ gcc 01-第1个c语言.c
python@ubuntu:~/Desktop/pythons06$ ls -a
. 01-第1个c语言.c 1-softlink.txt 2.txt 5.py command
.. 1-hardlink.txt 1.txt 4.py a.out test.sh
python@ubuntu:~/Desktop/pythons06$ ./a.out
hello world
2.第1个Python程序
编辑编译---》直接运行
python@ubuntu:~/pythons06$ vim 02-第1个Python.py
print("hello world")
python@ubuntu:~/pythons06$ python 02-第1个Python.py
hello world
3.python2 和Python3,IPython
推荐:ipython3
python@ubuntu:~/pythons06$ python3
Python 3.5.2 (default, Jul 5 2016, 12:43:10)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> exit()
python@ubuntu:~/pythons06$
python@ubuntu:~/pythons06$ python3 02-第1个Python.py
hello world
python@ubuntu:~/pythons06$
#ipython
python@ubuntu:~/pythons06$ ipython
Python 2.7.12 (default, Jul 1 2016, 15:12:24)
Type "copyright", "credits" or "license" for more information.
IPython 2.4.1 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: exit
#ipython3
python@ubuntu:~/pythons06$ ipython3
Python 3.5.2 (default, Jul 5 2016, 12:43:10)
Type "copyright", "credits" or "license" for more information.
IPython 2.4.1 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: