py2exe问题 [英] py2exe question

查看:62
本文介绍了py2exe问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

py2exe说控制台应用程序应该有--console选项

和Windows应用程序应该有--windows选项。


什么py2exe是一个使用控制台和

windows gui的python程序的方法吗?

TIA


Al

The py2exe says that a console app should have the --console option
and a windows app should have the --windows option.

What is the way to py2exe a python program that uses both console and
windows gui?

TIA

Al

推荐答案

ac*****@easystreet.com 写道:
ac*****@easystreet.com wrote:
py2exe说控制台应用程序应该有--console选项
和Windows应用程序应该有--windows选项。 />
py2exe使用控制台和
windows gui的python程序的方法是什么?
The py2exe says that a console app should have the --console option
and a windows app should have the --windows option.

What is the way to py2exe a python program that uses both console and
windows gui?




Haven没试过,但是逻辑上它应该是一个控制台 - 这并不限制

你可以导入的其他模块,它只使用与python一起运行的.py

脚本.exe而不是.pyw运行pythonw.exe,即一个

DOS框&qu OT;程序运行时会出现控制台。

Alex



Haven''t tried, but logically it should be a console -- this doesn''t restrict
what OTHER modules you can import, it just uses the equivalent of a .py
script run with python.exe rather than a .pyw run with pythonw.exe, i.e. a
"DOS box" console does appear when the program is run.
Alex


Alex Martelli写道:
Alex Martelli wrote:

ac*****@easystreet.com 写道:

ac*****@easystreet.com wrote:
py2exe说控制台应用程序应该有--console选项
和windows应用程序应该有--windows选项。

py2exe是什么方法python程序使用两个控制台和
windows gui?
Haven没试过,但逻辑上它应该是一个控制台 - 这并不限制
The py2exe says that a console app should have the --console option
and a windows app should have the --windows option.

What is the way to py2exe a python program that uses both console and
windows gui?
Haven''t tried, but logically it should be a console -- this doesn''t restrict


你可以导入的其他模块,它只使用与python.exe一起运行的.py
脚本,而不是使用pythonw.exe运行.pyw,即
DOS box。程序运行时会出现控制台。


what OTHER modules you can import, it just uses the equivalent of a .py
script run with python.exe rather than a .pyw run with pythonw.exe, i.e. a
"DOS box" console does appear when the program is run.




从逻辑上讲,你不需要这些开关。在py2exe之外a * .py

得到一个控制台,可以打开gui窗口,* .pyw是一个纯粹的gui

程序。为什么交换机正在运行? IDK?以为我会问。


我在安装一台机器上运行的py2exe可执行文件时遇到了一些麻烦。

只是想知道这有没有什么可以用它做b $ b。

Al



Logically, you don''t need these switches. Outside of py2exe a *.py
gets a console and can open gui windows, a *.pyw is a pure gui
program. Why the switches atall? IDK? Thought I''d ask.

I''m having a little trouble getting a py2exe executable to run on
a machine wo python installed. Just wondered if this has anything to
do with it.
Al


ac ***** @ easystreet.com 写道:
ac*****@easystreet.com wrote:
Alex Martelli写道:
Alex Martelli wrote:

ac*****@easystreet.com 写道:

ac*****@easystreet.com wrote:
> py2exe说控制台应用程序应该有--console选项
> Windows应用程序应该有--windows选项。
>
>什么是py2exe使用控制台和
的python程序的方法> windows gui?
> Haven没试过,但从逻辑上说它应该是一个控制台 - 这不是
>限制你可以导入的其他模块,它只使用与python.exe运行的.py
脚本,而不是运行pythonw.exe的.pyw,即
DOS框。程序运行时会出现控制台。
> The py2exe says that a console app should have the --console option
> and a windows app should have the --windows option.
>
> What is the way to py2exe a python program that uses both console and
> windows gui?
> Haven''t tried, but logically it should be a console -- this doesn''t
> restrict what OTHER modules you can import, it just uses the equivalent of a .py
script run with python.exe rather than a .pyw run with pythonw.exe, i.e.
a "DOS box" console does appear when the program is run.



逻辑上,你不需要这些开关。在py2exe之外a * .py



Logically, you don''t need these switches. Outside of py2exe a *.py




逻辑上,也许不是,但如果你选择运行Windows,

你怎么避免他们?一个EXE需要让操作系统知道,通过交换机,如果它想要一个控制台,那就是
- 这就是它的全部。

获得一个控制台并且可以打开gui窗口,* .pyw是一个纯粹的gui


不是真的:你可以运行.py或.pyw主文(和其他的

扩展名)使用pyhon.exe或pythonw.exe。您选择运行哪个EXE

作为您的口译员要么获得

a控制台还是没有 - 因为Windows关联一个控制台(或
$ EX $ b缺乏这个EXE。默认情况下,大多数Python安装程序设置

两个扩展名.py和.pyw的注册表关联以及

两个解释器可执行文件 - 这可能是''s

让你感到困惑。但是,这只是一个默认值,决定了当你用一个扩展名将文件双重化时,Windows GUI shell将要做什么? - 你可以仍然完美运行

例如来自控制台的带有python.exe的.pyw主文(例如,你可以在控制台窗口看到
可以看到错误信息,警告等)。

程序。为什么交换机正在运行? IDK?以为我会问。


这些开关可让你明确控制发生的事情,就像

你可以通过选择
$ b中的一个来明确控制它$ b两个解释器(python.exe或pythonw.exe)的命令

提示符。我不知道'idk''问题是什么意思。

我在安装一台py2exe可执行文件时遇到一些麻烦
安装了一台机器。只是想知道这有什么用呢。



Logically, maybe not, but if you have chosen to run Windows instead,
how do you avoid them? An EXE needs to let the OS know, via switches,
if it wants a console or not -- that''s all there is to it.
gets a console and can open gui windows, a *.pyw is a pure gui
Not really: you can run either a .py or .pyw mainscript (and other
extensions yet) with either pyhon.exe or pythonw.exe. Which EXE
you choose to run as your interpreter is the one that either gets
a console or doesn''t -- because Windows associates a console (or
lack thereof) with an EXE. By default most Python installers set
registry associations of the two extensions .py and .pyw with the
two interpreter executables in question -- that may be what''s
confusing you. But that''s just a default that determines what
the Windows GUI shell is going to do when you doubleclic a file
with such an extension, etc -- you can still perfectly well run
e.g. a .pyw mainscript with python.exe from a console (e.g. so you
can see error messages, warnings etc in the console window).
program. Why the switches atall? IDK? Thought I''d ask.
The switches let you control what goes on explicitly, just as
you can control it explicitly by choosing one or the other of
the two interpreters (python.exe or pythonw.exe) at a command
prompt. I don''t know what you mean by the ''idk'' question.
I''m having a little trouble getting a py2exe executable to run on
a machine wo python installed. Just wondered if this has anything to
do with it.




我没看到连接。

Alex



I don''t see the connection.
Alex


这篇关于py2exe问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆