Python论坛  - 讨论区

标题:[python-chinese] 如何 用py2exe 打包成一个文件

2007年07月04日 星期三 14:49

python.py python.py在163.com
星期三 七月 4 14:49:44 HKT 2007

请问如何用py2exe生成一个单独的文件?我现在生成是一个dist文件夹,里很多东西。
是否能生成一个单独的exe文件? 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://python.cn/pipermail/python-chinese/attachments/20070704/37d1cbdf/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年07月04日 星期三 15:15

鲁捷 qiuhuafeng612在hotmail.com
星期三 七月 4 15:15:52 HKT 2007

ÎÒÒ²ÈÌÊܲ»×¡ÁË£¬ÓïÑÔÖ»ÊÇÒ»ÖÖ¹¤¾ß£¬Ë¼Ïë²ÅÄܸıäÊÀ½ç£¬ÎÞÂÛºÎÖÖ¼ÆËã»úÓïÑÔ¶¼ÓÐÆäÓÅÊƺÍÁÓÊÆ¡£
¶øÇÒ²»Í¬µÄÈË£¬²»Í¬µÄ¿ª·¢Ð¡×飬²»Í¬µÄÏîÄ¿£¬Ê¹Óò»Í¬µÄÓïÑÔÓÐÆäÓÅÊƺÍÁÓÊÆ£¬µ½µ×Ñ¡ÓúÎÖÖÓïÑÔ¿ª·¢£¬
Òª¸ù¾Ýʵ¼ÊµÄÇé¿öÀ´Ëµ£¬Í¨¹ý¶Ôʱ¼ä¡¢³É±¾¡¢ÖÊÁ¿µÄ×ÛºÏȨºâ£¬Ñ¡ÔñÓïÑÔ¡£
ûÓÐÒ»ÖÖÓïÑÔÄܹ»Í³Ò»ÊÀ½ç£¬Ö»ÓÐÖ÷Á÷Óë·ÇÖ÷Á÷ ¡£
 
                                                                                                                                                                 ´ËÖ                                            ¾´Àñ                                                                                                                              ³½Ý> Date: Wed, 4 Jul 2007 15:00:56 +0800> From: python_lzj在163.com> To: python-chinese在lists.python.cn> Subject: Re: [python-chinese] ´ó¼ÒÀ´ËµËµ×Ô¼ºÔÚʵ¼Ê¹¤×÷ÖÐÓ¦ÓÃPythonµÄ°¸Àý°É> > ÈÌÎÞ¿ÉÈÌ£¬ ÎÞÐëÔÙÈÌ£¡Êܲ»ÁËÁË£¬ ³öÀ´Í¸öÅÝ¡£> ¡°µ«C++µÄÖ´ÐÐЧÂÊÊDz»¸ßµÄ£¬ÖÁÉÙ±ÈCÒªÀ´µÃÂý¡£Èç¹ûûÓÐʹÓÃרҵ±àÒëÆ÷ÓÅ»¯·½Ê½£¬ºÜÄÑÂú×ã¸ßÐÔÄÜ»·¾³µÄ¼ÆËãÒªÇ󡣡±> ±§Ç¸ÎÒºÜÄÑÃ÷°×Äú˵µÄËùνµÄ¸ßÐÔÄÜ»·¾³ÊÇָʲô¶«Î÷£¬ Èç¹ûC++¶¼²»ÄÜʤÈÎÄÇôpython¾Í¸üÏ붼²»ÒªÏëÁË¡£> ÎÒÊÇC++³ÌÐòÔ±£¬ ËäÈ»ÎÒÏÖÔÚÒ²ÔÚ¹Ø×¢python£¬ ʹÓÃpython¡£ µ«ÊÇÕâ¸öthread¶ÔC++µÄ³¬¼¶ÎÞÖªºÍ¶ÔpythonµÄ¹ý> ·Ö´µÅõÎÒ¿´²»ÏÂÈ¥ÁË¡£> > > > On Wed, 4 Jul 2007 14:48:56 +0800> "ÑîÎÄ" <wyang在chinaclear.com.cn> ׫дÓÚ:> > > PythonµÄÖ´ÐÐЧÂÊÓжà¸ß£¬Õâ¸öÎÒûÓÐʲôÌå»á£¨Ö÷ÒªÊÇPython»¹Ã»ÓÐÈëÃÅ£©> > > > µ«C++µÄÖ´ÐÐЧÂÊÊDz»¸ßµÄ£¬ÖÁÉÙ±ÈCÒªÀ´µÃÂý¡£Èç¹ûûÓÐʹÓÃרҵ±àÒëÆ÷ÓÅ»¯·½Ê½£¬ºÜÄÑÂú×ã¸ßÐÔÄÜ»·¾³µÄ¼ÆËãÒªÇó¡£> > > > C++µÄÓÅÊÆÔÚÓÚ´úÂëµÄÔÙά»¤ÐÔÉÏ£¬Ê¹ÓÃÁËOO˼Ïëºó¡£È·ÊµÊ¹µÃ´úÂëµÄ¿É¶ÁÐÔ¸üÇ¿> > > > > > ----- Original Message ----- > > From: ÂíºêÁÁ > > To: python-chinese在lists.python.cn > > Sent: Wednesday, July 04, 2007 2:37 PM> > Subject: Re: [python-chinese]´ó¼ÒÀ´ËµËµ×Ô¼ºÔÚʵ¼Ê¹¤×÷ÖÐÓ¦ÓÃPythonµÄ°¸Àý°É> > > > > > ²»Ì«Ã÷°×£¬PythonµÄÖ´ÐÐЧÂʱÈC++¸ß£¿> > > > > > 2007/7/4, ÉòáË <wileishn在gmail.com>:> > OK, »ù±¾ÉÏÄúºÜëyµÃµ½ÄúËùÐèÒªµÄ´ð°¸¡£“þÎÒËùÕJ×RµÄ Python ºÚ¿ÍºÍš˜I Python ³ÌÐò†T¶¼ÊǘOžé ¡­¡­ ˜OžéµÍÕ{µÄ,> > ²»ß^¿ÉÒÔÀí½â, ¹«é_Ëû‚ƒµÄ°¸ÀýŽ§íµÄÂ韩ßhßhÒª±È“Ë®¶àµÃ¶à¡£ÎÒß@ÑYÖ»º††ÎµØÕfÒ»ÏÂÎҵȍëH‘ªÓÃ:> > > > ®” Yacc/Lex —£²»‰òÓõĕrºò, Ö»ºÃÓà Python ¾ŽŒ‘ÁËÒ»·NÉ̘I³ÌÐòÕZÑÔ¡£ß@·NÕZÑÔÒѽ›ÀÛӋÉú®aÁˎ×Ê®ÈfÐдú´a¡£> > > > ¾ŽŒ‘ÁËÒ»·N²»ÄÇ÷áСƒº¿ÆµÄ IDE¡£¸ßÙ|Á¿µÄ Python ´ú´aºÜÈÝÒ׶®, Òò´Ë vi Òѽ›Ì«‰òÓÃÁË, ï@È»Î҂ƒ¾ŽŒ‘µÄ IDE Êǽo»¯ÍâÈËÊ¿Óõġ£ > > > > Ò»‚€ÈÕ̎Àí½üǧÈf‚€ÈË–î}µÄ×ÔÈ»ÕZÑÔÈ˹¤ÖÇÄÜ¡£ºÜï@Ȼֱ½ÓÕÕ°á C µÄÉñ½›¾W½jËã·¨µ½ Python ߀²»ÈçÖ±½ÓÓà C, µ«ÊÇ Python> > ÓÐÔS¶àÓÐЧµÃ³öÆæµÄÌصÄÓÐËã·¨¡£> > > > ·åֵÿÃë 2000 ´ÎՈÇóÒÔÉϵĄӑB CGI Õ¾üc¡£Í¨³£ FastCGI ÔÚͬµÈÇé›rÏÂÒѽ›°c¯ˆ, ¶ø Python ÊǞéÿÃëÉÏÈf´ÎµÄ Web> > ՈÇó¶øÔOӋµÄ (®”È»ÎÒ²»ÊÇÖ¸ Django »òÕß Twisted ß@·N¹Åµä¿ò¼Ü), Ò»Çж¼¾b¾bÓÐðN¡£ > > > > Ž×Ì×Äú›]ÓРÕfß^µÄ Python Web ¿ò¼Ü, ÒÔ¼°Ê¹ÓÃß@Щ¿ò¼Ü¾ŽŒ‘µÄÄú²»ÖªµÀµÄÆæ¹ÖÕ¾üc¡£> > > > »ùÓÚ Tkinter »òÕß PyQt µÄ·þ„ÕÆ÷ˆDÐλ¯¹ÜÀí½çÃæ¡£³£ÒŽµÄ CRM¡¢CMS ÒÔ¼° OA ϵ½y¡£ß@Щ¶¼ÊǺܺÃÍæµÄ–|Î÷, ÄãºÜëyÖªµÀÓжàÉÙÈ˘·ÖÔÅc´Ë¡£> > > > ՈעÒâ, ÉÏÃæµÄËùÓБªÓö¼ÊǼƒ Python ¾ŽŒ‘µÄ¡£ÔÚÈκεط½Ç¶Èë C++ ¶¼•þ½µµÍϵ½yµÄˆÌÐÐЧÂʺͷ€¶¨ÐÔ, µÃ²»ƒ”ʧ¡£> > > > ºÜï@È», Èç¹ûÄú²»ÒÔ Google »òÕß NASA ß@Щ¹«Ë¾žéßx“ñµÄԒ, Python ¹ÀӋ›]ʲ÷áÓÃ̎¡£Œ¦ÔS¶àÕ¼Õ¼×ԵõÄС¹«Ë¾¶øÑÔ, > > Ëû‚ƒ²¢²»ÐèÒª Python µÄ¸ßˆÌÐÐЧÂÊ, Œ¦Ëû‚ƒíÕf C++ µÄˆÌÐÐЧÂÊÒѽ›‰òÓÃÁË¡£Ëû‚ƒí”¶àÓà Python ×÷һЩСÄ_±¾, ¶ø¼ƒ> > Python ‘ªÓÃͨ³£²¢²»ÐèÒªß@÷áÂ韩¡£¶øÇÒС¹«Ë¾ºÜëy•þÓд󵽱ØíšÊ¹Óà Python µÄ‘ªÓá£> > > > µÚ¶þ, ʹÓà Python µÄ¹«Ë¾Í¨³£¶¼ºÜµÍÕ{, ͬ•rËû‚ƒÍ¨³£²»•þÌ«êPÐÄÄúÊÇ·ñ•þÍæ Python, ²»ÊìϤ Unix> > ¾Ž³Ì¼¼Ë‡µÄ³ÌÐò†TÊǟo·¨°l“] Python µÄÍþÁ¦µÄ¡£ËùÒÔÎ҂ƒºÜÉٕþ¿´µ½ÓÐ̖·QʹÓà Python ¼¼ÐgµÄ¹«Ë¾¡£Í¬•r, ½^´ó¶à”µ Python > > ³ÌÐò†T¶¼²»ÊÇÒòžé Python ¶øÕÒµ½¹¤×÷šλµÄ¡£> > > > Ï£Íûß@ЩÄ܌¦ÄúÓÐËùŽÍÖú¡£> > > > ÔÚ 07-7-3£¬Li Qingfeng<liqfemail在gmail.com> дµÀ£º> > > ʵ¼ÊÉÏÎÒ¸ü¶àµÄÊÇÏëÎÊÔÚ¹úÄÚµÄÓ¦Ó㬱Ͼ¹¿ìҪȥÕÒ¹¤×÷ÁË¡£> > > GoogleºÍNASAËƺõ²»ÄܸøÎÒÏëÒªµÄ´ð°¸¡£> > >> > >> > > ÔÚ07-7-3£¬ÂóÌïÊØÍûÕß <qcxhome在gmail.com> дµÀ£º> > > > On 7/3/07, Li Qingfeng <liqfemail在gmail.com> wrote:> > > > > > > > ×÷ΪһÃûÐÅϢרҵµÄÔÚУÑо¿Éú£¬½Ó´¥pythonÓаëÄêÁË£¬·¢ÏÖƽʱÓÃËüÀ´Íê³ÉһЩСµÄ±à³ÌÈÎÎñµÄÈ·ºÜ·½±ã£¬¶ÔËü·Ç³£Ï²°®¡£> > > > > Ö»ÊÇÔø¾­ÓÃpythonʵÏÖµÄBPÉñ¾­ÍøÂç¼ÆËãËٶȺܲ»ÀíÏ룬ӦÓÃnumpyÒ²ÎÞ¼ÃÓÚÊ£¬×îºóÓÃC++½â¾öÁËÎÊÌâ¡£> > > > > »¹ÓÐÒ»Äê¾ÍÒª±ÏÒµÁË£¬ºÜÏ£ÍûÌýÌý¸÷λµÄ½éÉÜ£¬pythonÔÚ´ó¼ÒµÄʵ¼Ê¹¤×÷ÖÐÓ¦Óù㷺Âð£¿ÓÐÄÄЩ°¸ÀýÄØ£¿> > > > > ÔÚÕâÀïÏÈ˵ÉùллÁË¡£ > > > >> > > > È¥ÎÊÎÊGoogleºÍNASA°É ;-)> > > >> > > > --> > > > GoogleTalk: qcxhome在gmail.com> > > > MSN: qcxhome在hotmail.com > > > > My Space: tkdchen.spaces.live.com> > > > BOINC: boinc.berkeley.edu> > > > Öйú·Ö²¼Ê½¼ÆËã×ÜÕ¾: www.equn.com> > > > _______________________________________________> > > > python-chinese> > > > Post: send python-chinese在lists.python.cn> > > > Subscribe: send subscribe to > > > python-chinese-request在lists.python.cn> > > > Unsubscribe: send unsubscribe to> > > python-chinese-request在lists.python.cn > > > > Detail Info:> > > http://python.cn/mailman/listinfo/python-chinese> > >> > >> > > _______________________________________________ > > > python-chinese> > > Post: send python-chinese在lists.python.cn> > > Subscribe: send subscribe to> > > python-chinese-request在lists.python.cn> > > Unsubscribe: send unsubscribe to> > > python-chinese-request在lists.python.cn> > > Detail Info:> > > http://python.cn/mailman/listinfo/python-chinese> > >> > > > ---> > ÉòáË (ŬÁ¦ŒWÁ• Python ÖÐ ...)> > http://blog.163.com> > _______________________________________________> > python-chinese > > Post: send python-chinese在lists.python.cn> > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn> > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > -- > > ÂíºêÁÁ > > > > > > ------------------------------------------------------------------------------> > > > > > _______________________________________________> > python-chinese> > Post: send python-chinese在lists.python.cn> > Subscribe: send subscribe to python-chinese-request在lists.python.cn> > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn> > Detail Info: http://python.cn/mailman/listinfo/python-chinese> > -- > EffectCrash <lzj_mailist在163.com>> > 
_________________________________________________________________
ʹÓÃÏÂÒ»´úµÄ MSN Messenger¡£
http://imagine-msn.com/messenger/launch80/default.aspx?locale=zh-cn&source;=wlmailtagline
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20070704/9b044158/attachment-0001.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年07月04日 星期三 15:34

Li Qingfeng liqfemail在gmail.com
星期三 七月 4 15:34:28 HKT 2007

PyInstaller¿ÉÒÔ°ìµ½£¬¸úpy2exe²î²»¶àµÄ¶«Î÷¡£

ÔÚ07-7-4£¬python.py <python.py在163.com> дµÀ£º
>
> ÇëÎÊÈçºÎÓÃpy2exeÉú³ÉÒ»¸öµ¥¶ÀµÄÎļþ£¿ÎÒÏÖÔÚÉú³ÉÊÇÒ»¸ödistÎļþ¼Ð£¬ÀïºÜ¶à¶«Î÷¡£
>
> ÊÇ·ñÄÜÉú³ÉÒ»¸öµ¥¶ÀµÄexeÎļþ£¿
>
>
>
> ------------------------------
> 150 Íò ÈË Í¬ ʱ ÔÚ Íæ µÄ Íø ÓΣ¬Äã ²» ÊÔ ÊÔ Â𠣿 <http://event.mail.163.com/chanel/xyq.htm?from=163_NO1>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20070704/c0deb248/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年07月04日 星期三 18:34

追风逐月 chinesexu在gmail.com
星期三 七月 4 18:34:00 HKT 2007

options = {
"bundle_files": 3, # create singlefile exe

setup.pyÖмÓÉÏÕâ¸ö

On 7/4/07, Li Qingfeng <liqfemail在gmail.com> wrote:
>
> PyInstaller¿ÉÒÔ°ìµ½£¬¸úpy2exe²î²»¶àµÄ¶«Î÷¡£
>
> ÔÚ07-7-4£¬python.py <python.py在163.com> дµÀ£º
> >
> > ÇëÎÊÈçºÎÓÃpy2exeÉú³ÉÒ»¸öµ¥¶ÀµÄÎļþ£¿ÎÒÏÖÔÚÉú³ÉÊÇÒ»¸ödistÎļþ¼Ð£¬ÀïºÜ¶à¶«Î÷¡£
> >
> > ÊÇ·ñÄÜÉú³ÉÒ»¸öµ¥¶ÀµÄexeÎļþ£¿
> >
> >
> >
> > ------------------------------
> >  150 Íò ÈË Í¬ ʱ ÔÚ Íæ µÄ Íø ÓΣ¬Äã ²» ÊÔ ÊÔ Â𠣿 <http://event.mail.163.com/chanel/xyq.htm?from=163_NO1>
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese在lists.python.cn
> > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >
>
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>



-- 
python c# and opensource
blog:http://www.chyni.cn
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20070704/5934d7f1/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年07月04日 星期三 21:15

Huang You Gong hygool在gmail.com
星期三 七月 4 21:15:04 HKT 2007

On 7/4/07, python.py <python.py at 163.com> wrote:
>
> 请问如何用py2exe生成一个单独的文件?我现在生成是一个dist文件夹,里很多东西。
>
> 是否能生成一个单独的exe文件?
>

可以在这里下载到PyInstaller:
http://pyinstaller.hpcf.upr.edu/source/1.3/pyinstaller_1.3.zip

简单介绍一下使用步骤:
your python file path: c:\myapp\main.py
pyinstaller path: c:\pyinstaller_1.3\

执行以下两个命令:
python c:\pyinstaller_1.3\makespec.py --onefile c:\myapp\main.py
python c:\pyinstaller_1.3\build.py c:\myapp\main.spec

你就可以看到main.exe了

-- 
Regards,
Huang You Gong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://python.cn/pipermail/python-chinese/attachments/20070704/11c0b053/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号