File: main.py

package info (click to toggle)
python-plyer 2.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,724 kB
  • sloc: python: 13,395; sh: 217; makefile: 177
file content (34 lines) | stat: -rw-r--r-- 660 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout


Builder.load_string('''
#:import screenshot plyer.screenshot
<ScreenshotDemo>:
    orientation: 'vertical'
    padding: '50dp'
    spacing: '20dp'
    Label:
        size_hint_y: None
        height: sp(40)
        text: 'Screenshot Location: ' + str(screenshot.file_path)

    Button:
        text: 'Capture Screenshot'
        on_release: screenshot.capture()
''')


class ScreenshotDemo(BoxLayout):
    '''Root Widget.'''


class ScreenshotApp(App):

    def build(self):
        return ScreenshotDemo()


if __name__ == "__main__":
    ScreenshotApp().run()