成人国产在线小视频_日韩寡妇人妻调教在线播放_色成人www永久在线观看_2018国产精品久久_亚洲欧美高清在线30p_亚洲少妇综合一区_黄色在线播放国产_亚洲另类技巧小说校园_国产主播xx日韩_a级毛片在线免费

資訊專欄INFORMATION COLUMN

python_bomb----python安裝

hedzr / 376人閱讀

摘要:下安裝去官網(wǎng)下載源碼安裝包或者解壓安裝包到目錄安裝編譯過程中需要的依賴包進(jìn)入解壓的安裝包進(jìn)行編譯安裝添加的命令到環(huán)境變量里臨時(shí)添加所在的路徑永久添加添加或者測(cè)試另開一個(gè)輸入表示當(dāng)前用戶家目錄代碼編寫打印中的

linux下安裝python
-去官網(wǎng)下載源碼安裝包
或者lftp 172.25.254.250
cd pub/software/python
get Python-3.6.4.tg
python3.6
-解壓安裝包到/opt目錄
tar xf Python-3.6.4.tgz -C /opt
-安裝編譯過程中需要的依賴包:gcc,zlib,zlib-devel
-進(jìn)入解壓的安裝包進(jìn)行編譯
cd /opt/Python3-*/
./configure --prefix=/usr/local/python --with-ssl

-安裝:make && make install
-添加python3的命令到環(huán)境變量里
echo $PATH
#臨時(shí)添加
export PATH="python3所在的路徑:$PATH"
#永久添加
vim ~/.bashrc
添加 export PATH="/usr/local/python/bin/:$PATH"
或者  echo  PATH="/usr/local/python/bin/:$PATH" >> ~/.bashrc

測(cè)試:

另開一個(gè)SHELL輸入python3
[root@sheen ~]# python3
Python 3.6.4 (default, Aug  6 2018, 22:54:20) 
[GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 

~/ #表示當(dāng)前用戶家目錄

python代碼編寫 python打印

python2中的print既是特殊字符又是函數(shù)

-python2:
    >>> print("hello")
    hello
    >>> print "hello "
    hello 

    
-python3
    >>> print("hello")  
    hello
-python2向python3
    >>> from __future__ import print_function    #導(dǎo)入python2向python3打印的轉(zhuǎn)換模塊
    >>> print "hello"
      File "", line 1
        print "hello"
                ^
    SyntaxError: invalid syntax
    >>> print("hello")
    hello

用命令編譯文件

vim hello.py

#!/usr/local/python/bin/python3
context="hello sheen"
print(context)

chmod +x hello.py
cp hello.py /bin/welcome
測(cè)試:

[root@sheen bin]# welcome
hello sheen
python的編碼格式
python2:ASCII
python3:Unicode

ASCII編碼:

1字節(jié)=8bit,1英文字符=1字節(jié),-----00000000(2^8-1)

Unicode編碼:

一個(gè)字符代表兩個(gè)字節(jié),(2^16-1)

utf-8:

如果是英文,一個(gè)字節(jié)存儲(chǔ);如果是中文,用三個(gè)字節(jié)存儲(chǔ)

文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請(qǐng)注明本文地址:http://systransis.cn/yun/42147.html

相關(guān)文章

  • Python3網(wǎng)絡(luò)爬蟲實(shí)戰(zhàn)---5、存儲(chǔ)庫的安裝:PyMySQL、PyMongo、RedisPy、R

    摘要:相關(guān)鏈接官方文檔安裝推薦使用安裝,命令如下運(yùn)行完畢之后即可完成的安裝。上一篇文章網(wǎng)絡(luò)爬蟲實(shí)戰(zhàn)數(shù)據(jù)庫的安裝下一篇文章網(wǎng)絡(luò)爬蟲實(shí)戰(zhàn)庫的安裝 上一篇文章:Python3網(wǎng)絡(luò)爬蟲實(shí)戰(zhàn)---4、數(shù)據(jù)庫的安裝:MySQL、MongoDB、Redis下一篇文章:Python3網(wǎng)絡(luò)爬蟲實(shí)戰(zhàn)---6、Web庫的安裝:Flask、Tornado 在前面一節(jié)我們介紹了幾個(gè)數(shù)據(jù)庫的安裝方式,但這僅僅是用來存...

    AlanKeene 評(píng)論0 收藏0

發(fā)表評(píng)論

0條評(píng)論

hedzr

|高級(jí)講師

TA的文章

閱讀更多
最新活動(dòng)
閱讀需要支付1元查看
<