小编Shi*_*vam的帖子

如何在kivy中使用进度条显示安装进度?

我设计了一个简单的 GUI,我还没有开发太多,但是一旦我完成,我需要 GUI 来显示应用程序的进度,它在做什么假设在我的 exe 中它有很多步骤,例如读取 csv、搜索输入等这些步骤将显示在屏幕上,甚至会显示绿色或蓝色的进度条,以显示剩余或已完成的进度。Kivy python 中可能吗?这是我在 Kivy GUI 中的代码:

from kivy.lang import Builder
from kivy.uix.floatlayout import FloatLayout
from kivy.properties import StringProperty
from kivy.uix.spinner import Spinner
from kivy.app import App


Builder.load_string('''
<MainScreen>:
    GridLayout:      
        orientation: 'vertical'
        cols: 1
        canvas.before:
            Color:
                rgba: 1, 1, 1, 1  
            Rectangle:
                pos: self.pos
                size: self.size
        GridLayout:      
            orientation: 'vertical'
            cols: 2
            Spinner:
                id: first
                text: ' First Number'
                values: ['1','2','3','4','5','6','7','8','9'] 
            Spinner:
                id: second
                text: ' Second Number'
                values: ['1','2','3','4','5','6','7','8','9']       
        Label:
            id: result
            text: ' Result' …
Run Code Online (Sandbox Code Playgroud)

python user-interface spinner kivy progress-bar

8
推荐指数
0
解决办法
2822
查看次数

我可以在数组中打印没有重复的值

a = [5,7,3,1,2]
for i in a:
    for j in a:
        if(i==j):
            continue
        else:
            print(i,j)
    print("")
Run Code Online (Sandbox Code Playgroud)

输出:

5 7
5 3
5 1
5 2

7 5
7 3
7 1
7 2

3 5
3 7
3 1
3 2

1 5
1 7
1 3
1 2

2 5
2 7
2 3
2 1
Run Code Online (Sandbox Code Playgroud)

我的代码只显示所有值,但会跳过匹配的值,但是如果我想要显示已打印的值,如果打印了值(5,7),则不应再次打印为(7,5).一旦打印了值5 7以便下一次迭代,它就不应该显示7 5,这应该发生在数组中的所有值.请有人帮助我.谢谢.如果有重复的问题,请指导我这个问题.

python arrays for-loop repeat

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