Python - Hello World 2015-3-31

優秀項目:html

Twitter Stormjava


解釋型語言python


1shell

https://www.python.org/downloads/ windows

其中Windows x86-64 embeddable zip file,即爲綠色版(免安裝)app

綠色版2.7[在用] http://download.csdn.net/download/ricyn/8755279 dom

綠色版33 http://download.csdn.net/download/amwswceud/5727069 python2.7


2 dos>pythonui

100+22url

python hello.py

print('Hello World!')



NumPy

1 安裝setuptools https://pypi.python.org/pypi/setuptools#windows-powershell-3-or-later

不然出現 "no module named setuptools"

python ez_setup.py


下載完成後雙擊執行安裝文件,便可在D:\Program Files\python2.7\scripts下安裝easy_install。包含一個easy_install.exe,而後進行環境變量設置,在系統環境變量中作以下設置:

(也就是將D:\Program Files\python2.7\scripts添加到環境變量中)


2 安裝VCForPython27http://www.microsoft.com/en-us/download/confirmation.aspx?id=44266

不然出現如下錯誤

error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat). Get

it from http://aka.ms/vcpython27


3 安裝pip

http://jingyan.baidu.com/article/e73e26c0d94e0524adb6a7ff.html

 easy_inatall pip


4 安裝 python-dev,直接輸入如下命令安裝, 不然出來如下錯誤

pip install python-dev

    "Cannot compile 'Python.h'. Perhaps you need to "

SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.


5 安裝 pyopenssl ndg-httpsclient pyasn1,不然出現

pip install pyopenssl ndg-httpsclient pyasn1

packages\urllib3\util\ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately a

nd may cause certain SSL connections to fail. For more information, see https://

3 安裝NumPy

http://sourceforge.net/projects/numpy/files/latest/download?source=files

python setup.py install

or

pip install numpy


用上安裝版python一切正常

1 python-2.7.7.amd64.msi

pip install numpy


驗證numpy是否正確安裝

from numpy import *

random.rand(4,4)

randMat=mat(random.rand(4,4))

invRandMat=randMat.I

randMat*invRandMat

myEye=randMat*invRandMat

myEye-eye(4)


23/296

相關文章
相關標籤/搜索