小编for*_*ser的帖子

透明背景在Tkinter窗口里

有没有办法使用Tkinter在Python 3.x中创建"加载屏幕"?我的意思是像Adobe Photoshop的加载屏幕,具有透明度等.我设法摆脱框架边框已经使用:

root.overrideredirect(1)
Run Code Online (Sandbox Code Playgroud)

但如果我这样做:

root.image = PhotoImage(file=pyloc+'\startup.gif')
label = Label(image=root.image)
label.pack()
Run Code Online (Sandbox Code Playgroud)

图像显示正常,但灰色窗口背景而不是透明度.

有没有办法为窗口添加透明度,但仍能正确显示图像?

python transparency tkinter

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

带浮动的Python Tkinter Spinbox

有没有办法使用Python 3.x中的tkinter Spinbox Widget获取浮点值(如1.91,1.92等)?

提前致谢

python tkinter

4
推荐指数
1
解决办法
2076
查看次数

Java SWT - 从其他类创建一个新窗口

今天我想用Eclipse创建一个简单的Java SWT GUI应用程序,但为了更清晰,我想让每个子窗口都在不同的类中.由于我是Java编程的新手,有没有办法让一个不同的类只通过调用一个方法来做它的事情?我在互联网上到处看,但找不到我想要的东西......

这是我到目前为止所拥有的

Button foo = new Button(shell, SWT.PUSH);
foo.setText("Edit");
foo.addListener(SWT.Selection, new Listener() {
    public void handleEvent(Event e) {
        switch (e.type) {
            case SWT.Selection:
                // Call the other Class file here
                break;
        }
    }
});
Run Code Online (Sandbox Code Playgroud)

java swt jface

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

Python 3.x从URL获取JSON

程序员大家好,

今天我想用Python 3.3从这个网站上获取一些JSON数据:http://ladv.de/api/-apikey-redacted-/ausDetail?id = 884&wettbewerbe = true&all = true

官方API告诉我,调用此URL会返回一些JSON数据.但是,如果我使用以下代码来获取它(我也在stackoverflow上找到它),它会抛出一个错误:

import urllib.request
import json

request = 'http://ladv.de/api/mmetzger/ausDetail?id=884&wettbewerbe=true&all=true'
response = urllib.request.urlopen(request)
obj = json.load(response)
str_response = response.readall().decode('utf-8')
obj = json.loads(str_response)
print(obj)
Run Code Online (Sandbox Code Playgroud)

打印出来

Traceback (most recent call last):
  File "D:/ladvclient/testscrape.py", line 5, in <module>
    response = urllib.request.urlopen(request)
  File "C:\Python33\lib\urllib\request.py", line 156, in urlopen
    return opener.open(url, data, timeout)
  File "C:\Python33\lib\urllib\request.py", line 475, in open
    response = meth(req, response)
  File "C:\Python33\lib\urllib\request.py", line 587, in http_response
    'http', request, response, code, msg, hdrs) …
Run Code Online (Sandbox Code Playgroud)

python url json get python-3.x

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

标签 统计

python ×3

tkinter ×2

get ×1

java ×1

jface ×1

json ×1

python-3.x ×1

swt ×1

transparency ×1

url ×1