最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Python中static相關(guān)知識小結(jié)

 更新時間:2018年01月02日 08:45:12   作者:張學(xué)程  
static用法:是一個修飾符,用于修飾成員(成員變量,成員函數(shù)).當(dāng)成員被靜態(tài)修飾后,就多了一個調(diào)用方式,除了可以被對象調(diào)用外,還可以直接被類名調(diào)用,格式——類名.靜態(tài)成員。

非 static 編譯

不指定額外參數(shù)直接編譯 Python:

$ ./configure
$ make

查看所依賴的共享庫:

$ ldd python
  linux-vdso.so.1 => (0x00007fffcd95a000)
  libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fab5c350000)
  libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fab5c140000)
  libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007fab5bf20000)
  libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fab5bc10000)
  libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fab5b840000)
  /lib64/ld-linux-x86-64.so.2 (0x00007fab5c600000)

static 編譯

指定 static 相關(guān)參數(shù)編譯 Python:

$ ./configure LDFLAGS="-static" --disable-shared
$ make LDFLAGS="-static" LINKFORSHARED=" "

發(fā)現(xiàn)有部分庫未能被編譯,編譯結(jié)果中輸出如下內(nèi)容:

Failed to build these modules:
_bisect      _bsddb       _codecs_cn
_codecs_hk     _codecs_iso2022  _codecs_jp
_codecs_kr     _codecs_tw     _collections
_csv        _ctypes      _ctypes_test
_curses      _curses_panel   _elementtree
_functools     _hashlib      _heapq
_hotshot      _io        _json
_locale      _lsprof      _multibytecodec
_multiprocessing  _random      _socket
_sqlite3      _ssl        _struct
_testcapi     _tkinter      array
audioop      binascii      bz2
cmath       cPickle      crypt
cStringIO     datetime      dbm
fcntl       future_builtins  gdbm
grp        itertools     linuxaudiodev
math        mmap        nis
operator      ossaudiodev    parser
pyexpat      readline      resource
select       spwd        strop
syslog       termios      time
unicodedata    zlib

查看所依賴的共享庫:

$ ldd python
  not a dynamic executable

static 編譯相關(guān) module

編輯 Modules/Setup.local 為:

# Edit this file for local setup changes
*static*
_bisect _bisectmodule.c
# _bsddb _bsddb.c # 額外依賴PyBSDDB
_codecs_cn cjkcodecs/_codecs_cn.c
_codecs_hk cjkcodecs/_codecs_hk.c
_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
_codecs_jp cjkcodecs/_codecs_jp.c
_codecs_kr cjkcodecs/_codecs_kr.c
_codecs_tw cjkcodecs/_codecs_tw.c
_collections _collectionsmodule.c
_csv _csv.c
# _ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/cfield.c _ctypes/malloc_closure.c _ctypes/stgdict.c # 還依賴Python源中的 libffi
# _ctypes_test # 同_ctypes
# _curses _cursesmodule.c # 額外依賴ncurses
# _curses_panel _curses_panel.c # 額外依賴ncurses
# _elementtree _elementtree.c expat/loadlibrary.c expat/xmlparse.c expat/xmlrole.c expat/xmltok.c expat/xmltok_impl.c expat/xmltok_ns.c # 依賴的libexpat可能編譯出錯
_functools _functoolsmodule.c
# _hashlib _hashopenssl.c # 額外依賴OpenSSL
_heapq _heapqmodule.c
_hotshot _hotshot.c
_io _io/_iomodule.c _io/bufferedio.c _io/bytesio.c _io/fileio.c _io/iobase.c _io/stringio.c _io/textio.c
_json _json.c
_locale _localemodule.c
_lsprof _lsprof.c rotatingtree.c
_multibytecodec cjkcodecs/multibytecodec.c
# _multiprocessing _multiprocessing/multiprocessing.c _multiprocessing/pipe_connection.c _multiprocessing/semaphore.c _multiprocessing/socket_connection.c _multiprocessing/win32_functions.c
_multiprocessing _multiprocessing/multiprocessing.c _multiprocessing/socket_connection.c
_random _randommodule.c
_socket socketmodule.c
# _sqlite3 _sqlite/cache.c _sqlite/connection.c _sqlite/cursor.c _sqlite/microprotocols.c _sqlite/module.c _sqlite/prepare_protocol.c _sqlite/row.c _sqlite/statement.c _sqlite/util.c # 額外依賴sqlite3 
# _ssl _ssl.c 額外依賴OpenSSL
_struct _struct.c
_testcapi _testcapimodule.c
# _tkinter _tkinter.c # 額外依賴Tcl/Tk
array arraymodule.c
audioop audioop.c
binascii binascii.c
# bz2 bz2module.c # 額外依賴bzlib
cmath cmathmodule.c
cPickle cPickle.c
# crypt cryptmodule.c # 額外依賴OpenSSL
cStringIO cStringIO.c
datetime datetimemodule.c
# dbm dbmmodule.c # 額外依賴gdbm
fcntl fcntlmodule.c
future_builtins future_builtins.c
# gdbm gdbmmodule.c # 額外依賴gdbm
grp grpmodule.c
itertools itertoolsmodule.c
linuxaudiodev linuxaudiodev.c
math mathmodule.c _math.c
mmap mmapmodule.c
# nis nismodule.c # 依賴glibc/nis
operator operator.c
ossaudiodev ossaudiodev.c
parser parsermodule.c
# pyexpat pyexpat.c # 依賴的libexpat可能編譯出錯
# readline readline.c # 依賴readline
resource resource.c
select selectmodule.c
spwd spwdmodule.c
strop stropmodule.c
syslog syslogmodule.c
termios termios.c
time timemodule.c
unicodedata unicodedata.c
zlib zlibmodule.c zlib/adler32.c zlib/compress.c zlib/crc32.c zlib/deflate.c zlib/example.c zlib/gzclose.c zlib/gzlib.c zlib/gzread.c zlib/gzwrite.c zlib/infback.c zlib/inffast.c zlib/inflate.c zlib/inftrees.c zlib/minigzip.c zlib/trees.c zlib/uncompr.c zlib/zutil.c

重新編譯后能將部分 Modules 編譯為 static 庫,輸出:

Failed to build these modules:
_bsddb     _ctypes     _ctypes_test
_curses     _curses_panel  _elementtree
_hashlib    _sqlite3    _ssl
_tkinter    bz2       crypt
dbm       gdbm      nis
pyexpat     readline

查看所依賴的共享庫:

$ ldd python
  not a dynamic executable

參考:

https://wiki.python.org/moin/BuildStatically

相關(guān)文章

  • python數(shù)據(jù)可視化matplotlib繪制折線圖示例

    python數(shù)據(jù)可視化matplotlib繪制折線圖示例

    這篇文章主要為大家介紹了python數(shù)據(jù)可視化matplotlib繪制折線圖的示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪
    2022-06-06
  • Python使用Flask框架同時上傳多個文件的方法

    Python使用Flask框架同時上傳多個文件的方法

    這篇文章主要介紹了Python使用Flask框架同時上傳多個文件的方法,實例分析了Python中Flask框架操作文件實現(xiàn)上傳的技巧,需要的朋友可以參考下
    2015-03-03
  • Python實現(xiàn)windows下模擬按鍵和鼠標(biāo)點擊的方法

    Python實現(xiàn)windows下模擬按鍵和鼠標(biāo)點擊的方法

    這篇文章主要介紹了Python實現(xiàn)windows下模擬按鍵和鼠標(biāo)點擊的方法,涉及Python模擬實現(xiàn)鼠標(biāo)及鍵盤事件的技巧,具有一定參考借鑒價值,需要的朋友可以參考下
    2015-03-03
  • 在Django的視圖中使用數(shù)據(jù)庫查詢的方法

    在Django的視圖中使用數(shù)據(jù)庫查詢的方法

    這篇文章主要介紹了在Django的視圖中使用數(shù)據(jù)庫查詢的方法,是Python的Django框架使用的基礎(chǔ)操作,需要的朋友可以參考下
    2015-07-07
  • python3多線程中使用線程睡眠的方法實現(xiàn)

    python3多線程中使用線程睡眠的方法實現(xiàn)

    線程睡眠是一個常見且有用的工具,用于控制線程的執(zhí)行順序和速度,本文主要介紹了python3多線程中使用線程睡眠的方法實現(xiàn),具有一定的參考價值,感興趣的可以了解一下
    2024-08-08
  • Python?pluggy框架使用示例代碼

    Python?pluggy框架使用示例代碼

    這篇文章主要介紹了Python?pluggy框架基礎(chǔ)用法總結(jié),本文通過三個例子結(jié)合代碼給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2022-05-05
  • 用Python實現(xiàn)寫倒序輸出(任意位數(shù))

    用Python實現(xiàn)寫倒序輸出(任意位數(shù))

    這篇文章主要介紹了用Python實現(xiàn)寫倒序輸出(任意位數(shù)),具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2022-05-05
  • Python-split()函數(shù)實例用法講解

    Python-split()函數(shù)實例用法講解

    在本篇文章里小編給大家整理的是一篇關(guān)于Python-split()函數(shù)實例用法講解,有興趣的朋友們可以學(xué)習(xí)下。
    2020-12-12
  • Python3.9.1中使用match方法詳解

    Python3.9.1中使用match方法詳解

    這篇文章主要介紹了Python3.9.1中使用match方法詳解,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2021-02-02
  • Python?ConfigParser庫輕松讀寫INI文件實例探究

    Python?ConfigParser庫輕松讀寫INI文件實例探究

    這篇文章主要為大家介紹了Python?ConfigParser庫輕松讀寫INI文件實例探究,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪
    2024-01-01

最新評論

青田县| 河池市| 宝丰县| 邹平县| 调兵山市| 扎囊县| 涞源县| 大兴区| 繁昌县| 石渠县| 丽水市| 奉节县| 常宁市| 泗阳县| 穆棱市| 贵港市| 岳阳市| 七台河市| 驻马店市| 怀化市| 登封市| 左云县| 松滋市| 米泉市| 长沙市| 西华县| 威远县| 台东县| 溧阳市| 余干县| 桐乡市| 忻城县| 南投县| 湘西| 木里| 自贡市| 定襄县| 襄垣县| 瑞金市| 龙州县| 洪洞县|