linux下能运行python,(转)Linux下运行python
原文: http://blog.csdn.net/jackywgw/article/details/48847187
在linux命令行下運行python,可以直接輸出hello world
jackywgw@jackywgw-A8F:~/python_learning$?python
Python?3.3.6?(default,?Apr?17?2015,?00:20:01)
[GCC?4.9.2]?on?linux
Type?"help",?"copyright",?"credits"?or?"license"?for?more?information.
>>>?print('hello?world')
hello?world
>>>
如果將print ('hello world')寫入first_helloworld.py中,通過python first_helloworld.py可以輸出hello world.
如果想直接運行./first_helloworld.py,則先要chmod u+x first_helloworld,然后還要在first_helloworld.py最前面加入#!/usr/bin/python3
#!/usr/bin/python3
print('hello?world')
#!/usr/bin/python3 這個為python的可執行路徑,可以通過which python3/ which python來獲取。
jackywgw@jackywgw-A8F:~/python_learning$?which?python3
/usr/bin/python3
jackywgw@jackywgw-A8F:~/python_learning$?which?python
/usr/bin/python
jackywgw@jackywgw-A8F:~/python_learning$
這樣就可以直接運行./first_helloworld.py輸出hello world了。
linux下配置python環境 django創建helloworld項目
linux下配置python環境 1.linux下安裝python3 a. 準備編譯環境(環境如果不對的話,可能遇到各種問題,比如wget無法下載https鏈接的文件) yum groupinstal ...
如何在Windows下開發Python:在cmd下運行Python腳本+如何使用Python Shell(command line模式和GUI模式)+如何使用Python IDE
http://www.crifan.com/how_to_do_python_development_under_windows_environment/ 本文目的 希望對于,如何在Windows下, ...
python 基礎1.1--windows/linux 下安裝python
一.windows下安裝python 1>windows上python后綴是.msi的,下載下來后,直接雙擊運行.會在c盤生成python.exe的文件,把python.exe的文件加入到win ...
Linux04 /創建虛擬環境、在linux環境運行Python項目
Linux04 /創建虛擬環境.在linux環境運行Python項目 目錄 Linux04 /創建虛擬環境.在linux環境運行Python項目 1. 大體流程 2. linux環境安裝python3 ...
Sublime Text3配置在可交互環境下運行python快捷鍵
安裝插件 在Sublime Text3下面寫代碼感覺很不錯,但是寫Python的時候遇到了一些問題.?用Sublime Text3打開python文件,或者在Sublime Text3下寫好pytho ...
linux下安裝python
在Linux下安裝Python的操作相當簡單,按如下步驟操作即可: 命令: wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgzt ...
Linux下運行memcached失敗
Linux下運行memcached失敗 1.錯誤信息如下 [root@localhost ~]# memcached can't run as root without the -u switch 2 ...
Linux 下安裝python軟件包(pip、nose、virtualenv、distribute )
新手剛開始學習Python,目前學習ing- 在學習習題46時需要安裝幾個軟件包:pip.nose.virtualenv.distribute !在此記錄Linux ...
Java項目打包在CMD或者Linux下運行
Java項目打包在CMD或者Linux下運行 1.在CMD下運行 在eclipse中將項目export成jar包,然后用壓縮軟件解壓
隨機推薦
利用Apache Ant編譯Hadoop2.6.0-eclipse-plugin
環境要求:系統不重要,重要的是要有Ant環境,這里不做贅述,自行百度配置去. 1)在github上下載Hadoop-eclipse-plugin-master的zip包,下載地址. 2)在Hadoop ...
3D照片放大展示窗口
ext/babel"> var Myelement=React.createClass({ handleClick:function(){ ...
機器學習筆記(二)- from Andrew Ng的教學視頻
省略了Octave的使用方法結束,以后用得上再看吧 week three: Logistic?Regression: 用于0-1分類 Hypothesis Representation: :Sigmo ...
python隨機圖片驗證碼的生成
Python生成隨機驗證碼,需要使用PIL模塊. 安裝: 1 pip3 install pillow 基本使用 1. 創建圖片 1 2 3 4 5 6 7 8 9 from?PIL?import?Im ...
在 Linux 下用 mkdir 命令來創建目錄和子目錄
mkdir 是什么呢 Mkdir 是一個用來在 Linux 系統下創建目錄的命令.此命令屬于內建命令. 運行 mkdir 命令 你可以在你的控制臺直接鍵入?mkdir?來使用它. $ mkdir 默認 ...
WCF系列教程之WCF實例化
本文參考自http://www.cnblogs.com/wangweimutou/p/4517951.html,純屬讀書筆記,加深記憶 一.理解WCF實例化機制 1.WCF實例化,是指對用戶定義的服務 ...
.net增刪該查DBAccess的應用
1.首先引用dll文件 2.?//DBAccess.dll引用一個dll文件??? private IDBAccess _access;??? private static readonly stri ...
cgic實現輸入文件名,打開文件的功能
a.c文件 #include #include #include #include
總結
以上是生活随笔為你收集整理的linux下能运行python,(转)Linux下运行python的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 接口隔离原则(ISP)
- 下一篇: linux 其他常用命令