第一个python程序hello.py

  1. 使用vim编辑代码:
1 #!/usr/bin/python2.7
2 #-*-coding:utf-8-*-
3 name = raw_input('请输入你的名字:')
4 print 'Hello,',name

 

直接运行hello.py:python

$chmod a+x hello.pyvim

./hello.pypython2.7

 

或者 python hello.pyspa

 

  2.命令交互模式code

     输入pythonblog

   退出exit()utf-8

相关文章
相关标签/搜索