小编the*_*ost的帖子

更改生成的.exe,py2exe的图标

我一直在谷歌搜索,但没有一个结果对我有用.

这是我的安装文件

setup(
windows = [
    {
        "script": "start.py",
        "icon_resources": [(1, "myicon.ico")]
    }
],
)
Run Code Online (Sandbox Code Playgroud)

实际.exe文件的图标应为"myicon.ico".但是,这不会发生,并且是默认图标."myicon.ico"是32 x 32.

我正在使用Windows 7.

python compiler-construction py2exe

11
推荐指数
1
解决办法
1万
查看次数

检查按键是否按下,wxpython?

您好我想知道是否有办法检查某个键是否被按下.

这是一个例子

self.button2.Bind(wx.EVT_LEFT_DOWN, self.clickedbutton)
def clickedbutton(self, e):
    if (Control is held down while the button has been clicked):
        print "it works"
Run Code Online (Sandbox Code Playgroud)

谢谢

wxpython

3
推荐指数
1
解决办法
2405
查看次数

如何在python中将变量转换为字符串

我有类似的问题,但我不知道这个术语是什么

cat=5
dog=3
fish=7
animals=[cat,dog,fish]
for animal in animals:
    print animal_name+str(animal)  #by animal name, i mean the variable thats being used
Run Code Online (Sandbox Code Playgroud)

它会打印出来,

cat5
dog3
fish7
Run Code Online (Sandbox Code Playgroud)

所以我想知道是否有一个实际的方法或函数可以用来检索正在使用的变量并将其转换为字符串.希望这可以在不为每只动物实际创建字符串的情况下完成.

编辑:

没有字典有没有办法做到这一点?

python string variables

3
推荐指数
2
解决办法
4万
查看次数

以某个角度移动,jquery,animate()?

有没有办法在使用时指定角度

$(this).animate({'left': '+=30px'}, 1000);
Run Code Online (Sandbox Code Playgroud)

我想要

$(this).animate({'48': '+=30px'}, 1000);
Run Code Online (Sandbox Code Playgroud)

48是角度

html javascript css jquery

2
推荐指数
1
解决办法
4146
查看次数

如何在jQuery中使用.css函数

我使用jquery有点新,下面应该显示一个按钮,当有人点击按钮时,该按钮的字体大小应该改变.

不幸的是,由于我不确定的原因,该按钮不会改变其字体大小.

编辑:此示例与之前的调整相同,它可以工作,但只有鼠标离开按钮区域或双击按钮时才会更改字体.

只需单击一次即可更改字体.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
  $(".button0").click(function() {
    $('.button0').css('font-size', '43px');
  });
});
</script>
<style type="text/css">
.button0{
position:fixed;
left:48px;
top:55px;
font-family:Arial;
font-size:8px;
font-weight:normal;
}
</style>
<body>
<div name="button0"><input class="button0" type="button" style="width: 148px;height: 72px;" value="Button"/></div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

html javascript css jquery

0
推荐指数
1
解决办法
755
查看次数

使用CSS对中按钮

我试图将这些按钮放在中心,但大多数在线的东西都不起作用.<center>不起作用,text-align:center不起作用.

按钮应以完全相同的方式显示,除了居中于中间.如果您尝试这样做,它将无法正常工作.我猜,一定有问题.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>website</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
});
</script>
<style type="text/css">
.button0 {
position:fixed;
left:88px;
top:58px;
font-family:MS Shell Dlg 2;
font-size:8px;
font-weight:NORMAL;
}
.button1 {
position:fixed;
left:6px;
top:191px;
font-family:MS Shell Dlg 2;
font-size:8px;
font-weight:NORMAL;
text-align: center;
margin-left:auto;
margin-right:auto;
}
.button2 {
position:fixed;
left:358px;
top:216px;
font-family:MS Shell Dlg 2;
font-size:8px;
font-weight:NORMAL;
}
</style>
<body>
<center>
<div class="button0"><input type="button" style="width: 268px;height: 145px;" value="Button"/></div>
<div class="button1"><input …
Run Code Online (Sandbox Code Playgroud)

html css layout

0
推荐指数
1
解决办法
2万
查看次数