久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      python中import有什么用法

      python中import有什么用法

      python中import用于導(dǎo)入模塊。

      具體用法:

      下面程序使用導(dǎo)入整個(gè)模塊的最簡(jiǎn)單語(yǔ)法來(lái)導(dǎo)入指定模塊:

      # 導(dǎo)入sys整個(gè)模塊 import sys # 使用sys模塊名作為前綴來(lái)訪問(wèn)模塊中的成員 print(sys.argv[0])

      導(dǎo)入整個(gè)模塊時(shí),也可以為模塊指定別名。例如如下程序:

      # 導(dǎo)入sys整個(gè)模塊,并指定別名為s import sys as s # 使用s模塊別名作為前綴來(lái)訪問(wèn)模塊中的成員 print(s.argv[0])

      也可以一次導(dǎo)入多個(gè)模塊,多個(gè)模塊之間用逗號(hào)隔開。例如如下程序:

      # 導(dǎo)入sys、os兩個(gè)模塊 import sys,os # 使用模塊名作為前綴來(lái)訪問(wèn)模塊中的成員 print(sys.argv[0]) # os模塊的sep變量代表平臺(tái)上的路徑分隔符 print(os.sep)

      在導(dǎo)入多個(gè)模塊的同時(shí),也可以為模塊指定別名,例如如下程序:

      # 導(dǎo)入sys、os兩個(gè)模塊,并為sys指定別名s,為os指定別名o import sys as s,os as o # 使用模塊別名作為前綴來(lái)訪問(wèn)模塊中的成員 print(s.argv[0]) print(o.sep)

      推薦教程:python教程

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)