waterye

          py2exe

          py2exe is a Python distutils extension which converts python scripts into executable windows programs, able to run without requiring a python installation.

          install py2exe:  py2exe-0.6.3.win32-py2.4.exe

          hello.py
          1def sayHello( name ):
          2    print "hello, ".upper() + name + "!"
          3
          4if __name__ == '__main__':
          5    sayHello( "Water Ye" )

          hello_setup.py
           1from distutils.core import setup
           2import py2exe
           3
           4setup(    
           5    version = "0.0.6",
           6    description = "py2exe sample script",
           7    name = "say hello",
           8
           9    # targets to build
          10    # windows = ["test_wx.py"],
          11    console = ["hello.py"],
          12    )

          running
          G:\python_src> python hello_setup.py py2exe
          note: -b
          python hello_setup.py py2exe -b 2: Specifying a level of 2 includes the .pyd and .dll files into the zip-archive or the executable.
          python hello_setup.py py2exe -b 1: Using a level of 1 includes the .pyd and .dll files into the zip-archive or the executable itself, and does the same for pythonXY.dll.
           
          deploy
          復(fù)制dist下的所有文件到?jīng)]有python環(huán)境的機(jī)器即可運(yùn)行

          posted on 2005-11-18 00:55 waterye 閱讀(595) 評論(0)  編輯  收藏 所屬分類: python


          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 吉安县| 永州市| 石林| 靖江市| 凤台县| 怀柔区| 遵义县| 东明县| 河间市| 阿巴嘎旗| 台前县| 金塔县| 凤城市| 丹东市| 朝阳市| 上犹县| 乌兰察布市| 巩义市| 临江市| 哈巴河县| 高平市| 民和| 昌宁县| 云南省| 烟台市| 乳源| 长顺县| 龙泉市| 夹江县| 买车| 兴文县| 衡水市| 沂南县| 雷山县| 无为县| 义马市| 莱西市| 虞城县| 驻马店市| 平远县| 始兴县|