新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
創(chuàng)新互聯(lián)Python教程:python的sys模塊在哪
當前使用的python版本: Python 2.7.6

我們提供的服務有:網(wǎng)站建設、成都網(wǎng)站設計、微信公眾號開發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認證、麗江ssl等。為千余家企事業(yè)單位解決了網(wǎng)站和推廣的問題。提供周到的售前咨詢和貼心的售后服務,是有科學管理、有技術的麗江網(wǎng)站制作公司
SYS是python自帶模塊.
利用 import 語句輸入sys 模塊。
當執(zhí)行import sys后, python在 sys.path 變量中所列目錄中尋找 sys 模塊文件。然后運行這個模塊的主塊中的語句進行初始化,然后就
可以使用模塊了 。
sys模塊常見函數(shù)
可以通過dir()方法查看模塊中可用的方法. 結果如下, 很多我都沒有用過, 所以只是簡單介紹幾個自己用過的方法.
$ python Python 2.7.6 (default, Oct 26 2016, 20:30:19) [GCC 4.8.4] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> dir(sys) ['__displayhook__', '__doc__', '__excepthook__', '__name__', '__package__', '__stderr__', '__stdin__', ' __stdout__', '_clear_type_cache', '_current_frames', '_getframe', '_mercurial', '_multiarch', 'api_version', 'argv', 'builtin_module_names', 'byteorder', 'call_tracing', 'callstats', 'copyright', 'displayhook', 'dont_write_bytecode', 'exc_clear', 'exc_info', 'exc_type', 'excepthook', 'exec_prefix', 'executable', 'exit', 'flags', 'float_info', 'float_repr_style', 'getcheckinterval', 'getdefaultencoding', 'getdlopenflags', 'getfilesystemencoding', 'getprofile', 'getrecursionlimit', 'getrefcount', 'getsizeof', 'gettrace', 'hexversion', 'long_info', 'maxint', 'maxsize', 'maxunicode', 'meta_path', 'modules', 'path', 'path_hooks', 'path_importer_cache', 'platform', 'prefix', 'ps1', 'ps2', 'py3kwarning', 'pydebug', 'setcheckinterval', 'setdlopenflags', 'setprofile', 'setrecursionlimit', 'settrace', 'stderr', 'stdin', 'stdout', 'subversion', 'version', 'version_info', 'warnoptions']
更多技術請關注Python視頻教程。
文章名稱:創(chuàng)新互聯(lián)Python教程:python的sys模塊在哪
本文URL:http://m.fisionsoft.com.cn/article/cdgjpgh.html


咨詢
建站咨詢
