第一個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

相關文章
相關標籤/搜索