我的图标文件myicon.ico与setup.py位于同一目录中.当我运行py2exe时,myproject.exe没有图标.我寻找解决方案,但找不到.
setup.py代码是:
from distutils.core import setup
import py2exe
setup(
windows=[{
"script": "myproject.py",
"icon_resources": [(0, "favicon.ico")],
}]
)
Run Code Online (Sandbox Code Playgroud)
操作系统:Win8.1 64位
我必须将用户键入的用户名和密码保存到文本文件中,但它会在用户键入之前创建文本文件并保存文本。(因此创建了空文本文件)。
我想我必须对程序做一些事情,但是虽然我搜索了解决方案,但我找不到。
我的代码:
[Code]
var
Page: TInputQueryWizardPage;
username: String;
password: String;
procedure InitializeWizard;
begin
{ Create the page }
Page := CreateInputQueryPage(wpWelcome,
'Username & Password', 'Username like : e201600',
'Please enter your username and password.');
{ Add items (False means it's not a password edit) }
Page.Add('Username:', False);
Page.Add('Password:', True);
{ Set initial values (optional) }
Page.Values[0] := ExpandConstant('hello5');
Page.Values[1] := ExpandConstant('');
{ Read values into variables }
username := Page.Values[0];
password := Page.Values[1];
SaveStringToFile('c:\filename.txt', username+#13#10+password+#13#10, False);
end;
Run Code Online (Sandbox Code Playgroud)