Gui in Python

Total Page:16

File Type:pdf, Size:1020Kb

Gui in Python GUI IN PYTHON By : Sangeeta M Chauhan , Gwalior www.pythonclassroomdiary.wordpress.com © Sangeeta M Chauhan, Gwalior Best Python GUI Frameworks which supports multiple platforms (Windows, Linux and Mac). These all GUI frameworks are easy to use and popular, some of them are open-source. • Kivy :OpenGL ES 2, supports multiple platforms namely Windows, MacOSX, Linux, Android iOS and Raspberry Pi. Open source • PyQT : Cross-platform ,Supports Unix/Linux, Windows, Mac OS X and Sharp Zaurus. It is available in both, commercial as well as GPL license. Although some features may not be available in the free version, but you can use it under the free license with open source. • WxPython open source wrapper for cross-platform GUI library WxWidgets (earlier known as WxWindows) and implemented as a Python extension module. With WxPython you as a developer can create native applications for Windows, Mac OS and Unix. If you’re just beginning to develop applications in WxPython, here is a good simple tutorial you can go through. www.pythonclassroomdiary.wordpress.com © Sangeeta M Chauhan, Gwalior • PyGUI cross-platform framework for Unix, Macintosh and Windows. lightweight,. • PySide free and cross-platform GUI toolkit Qt initiated and sponsored by Nokia, ,currently supports Linux/X11, Mac OS X, Maemo and Windows and, support for Android is in the plans for the near future. PySide provides tools to works with multimedia, XML documents, network, databases and GUI. A key feature of PySide is its API compatibility with PyQt4, so if you wish to migrate to PySide then the process will be hassle- free. • Tkinter bundled with Python, Python’s standard GUI framework. Popular for its simplicity and GUI. Open source and available under the Python License. www.pythonclassroomdiary.wordpress.com © Sangeeta M Chauhan, Gwalior To create a tkinter application: 1. Import module – tkinter 2. Create the main window (container) 3. Add any number of widgets to the main window 4. Apply the event Trigger on the widgets. www.pythonclassroomdiary.wordpress.com © Sangeeta M Chauhan, Gwalior There are two main methods to be used while creating application using tkinter •Tk (screenName=None, baseName=None, className=’Tk’, useTk=1): This creates a toplevel widget of Tk which usually is the main window of an application. Each instance has its own associated Tcl interpreter. • Mainloop() : used when you are ready for the application to run. mainloop() is an infinite loop used to run the application, wait for an event to occur and process the event till the window is not closed. www.pythonclassroomdiary.wordpress.com © Sangeeta M Chauhan, Gwalior To create window www.pythonclassroomdiary.wordpress.com © Sangeeta M Chauhan, Gwalior Tkinter Widgets (Controls ) Sr.No. Operator & Description 1 Button The Button widget is used to display buttons in your application. 2 Canvas The Canvas widget is used to draw shapes, such as lines, ovals, polygons and rectangles, in your application. 3 Checkbutton The Checkbutton widget is used to display a number of options as checkboxes. The user can select multiple options at a time. 4 Entry The Entry widget is used to display a single-line text field for accepting values from a user. 5 Frame The Frame widget is used as a container widget to organize other widgets. 6 Label The Label widget is used to provide a single-line caption for other widgets. It can also contain images. 7 Listbox The Listbox widget is used to provide a list of options to a user. www.pythonclassroomdiary.wordpress.com © Sangeeta M Chauhan, Gwalior Sr.No. Operator & Description 8 Menubutton The Menubutton widget is used to display menus in your application. 9 Menu The Menu widget is used to provide various commands to a user. These commands are contained inside Menubutton. 10 Message The Message widget is used to display multiline text fields for accepting values from a user. 11 Radiobutton The Radiobutton widget is used to display a number of options as radio buttons. The user can select only one option at a time. 12 Scale The Scale widget is used to provide a slider widget. 13 Scrollbar The Scrollbar widget is used to add scrolling capability to various widgets, such as list boxes. 14 Text The Text widget is used to display text in multiple lines. 15 Toplevel The Toplevel widget is used to provide a separate window container. 16 Spinbox The Spinbox widget is a variant of the standard Tkinter Entry widget, which can be used to select from a fixed number of values. 17 PanedWindow A PanedWindow is a container widget that may contain any number of panes, arranged horizontally or vertically. 18 LabelFrame A labelframe is a simple container widget. Its primary purpose is to act as a spacer or container for complex window layouts. 19 tkMessageBox This module is used to display message boxes in your applications. www.pythonclassroomdiary.wordpress.com © Sangeeta M Chauhan, Gwalior Before learining how to handle widgets lets understand 3 important manager classes • pack() method:It organizes the widgets in blocks before placing in the parent widget. • grid() method:It organizes the widgets in grid (table-like structure) before placing in the parent widget. • place() method:It organizes the widgets by placing them on specific positions directed by the programmer. www.pythonclassroomdiary.wordpress.com © Sangeeta M Chauhan, Gwalior Button:To add a button in your application, this widget is used. The general syntax is: w=Button(master, option=value) • Master: parameter used to represent the parent window. • Options: There are number of options which are used to change the format of the Buttons. Number of options can be passed as parameters separated by commas. Some of them are listed below. – activebackground: to set the background color when button is under the cursor. – activeforeground: to set the foreground color when button is under the cursor. – bg: to set he normal background color. – command: to call a function. – font: to set the font on the button label. – image: to set the image on the button. – width: to set the width of the button. – height: to set the height of the button. www.pythonclassroomdiary.wordpress.com © Sangeeta M Chauhan, Gwalior Lets create a Button in window Button is created www.pythonclassroomdiary.wordpress.com © Sangeeta M Chauhan, Gwalior PACK() Geometry Manager The Pack geometry manager packs widgets in rows or columns. We can use options like fill, expand, and side to control this geometry manager. expand − When set to true, widget expands to fill any space not otherwise used in widget's parent. fill − Determines whether widget fills any extra space allocated to it by the packer, or keeps its own minimal dimensions: NONE (default), X (fill only horizontally), Y (fill only vertically), or BOTH (fill both horizontally and vertically). side − Determines which side of the parent widget packs against: TOP (default), BOTTOM, LEFT, or RIGHT. www.pythonclassroomdiary.wordpress.com © Sangeeta M Chauhan, Gwalior PACK with Button This examples creates 4 Buttons (without functionality) with text in different colours www.pythonclassroomdiary.wordpress.com © Sangeeta M Chauhan, Gwalior Pack() with expand option Button 1 is expandedd with frame www.pythonclassroomdiary.wordpress.com © Sangeeta M Chauhan, Gwalior To change position of Button use grid function Positioning of Buttons in grid Message box will be displayed on click of “OK Button www.pythonclassroomdiary.wordpress.com © Sangeeta M Chauhan, Gwalior List of some basic controls (Widgets) of tkinter w = Entry (parent, options) – For Text Field single line w = Text (parent, option, ... )- For Text Field Multi line w = Label (parent, option, ... )- For Label w = Button (parent, option, ... )- For Button w = Message (parent , option, ... ) - For message Box w = Checkbutton (parent, option, ... )- For CheckBox w = Radiobutton (parent, option, ... )-For RadioButton w = Listbox (parent , option, ... )- For List Box www.pythonclassroomdiary.wordpress.com © Sangeeta M Chauhan, Gwalior Some Common Options used with tkinter Widgets OPTION VALUE EFFECT foreground (fg) Colour Changes the foreground colour. (Colour may be specified using pre-defined keywords or using RGB values) background (bg) Colour Changes the background colour. (Colour may be specified using pre-defined keywords or using RGB values) bd (border width) integer Specifies the width of the widget border command Callbacktype Specifies which method is to be executed when the widget is selected. font Font type Specifies the font used by the widget. Often represented in a tuple (family, size, weight) padx, pady Integer Specifies the width between the current widget and the neighbor widgets. relief Relief type: Specifies the relief of the widget. •GROOVE •SUNKEN •RIDGE •FLAT text string Specifies the text appearing on the widget at run time www.pythonclassroomdiary.wordpress.com © Sangeeta M Chauhan, Gwalior Lets implement some of the widgets through examples A function is defined to display a message when Button is clicked Defining action : Button will call Function ‘WelcomeMsg()” and pass E1 object(TextField) www.pythonclassroomdiary.wordpress.com © Sangeeta M Chauhan, Gwalior OUTPUT OF PREVIOUS PROGRAM When User Clicks on Button it will display a Message Box www.pythonclassroomdiary.wordpress.com © Sangeeta M Chauhan, Gwalior Lets create a List Box containing Python Topics output www.pythonclassroomdiary.wordpress.com © Sangeeta M Chauhan, Gwalior This example shows how to create Option Button and Radio Button These functions are showing which Checkbox or Radio Button is Selected ………..Continued to next page www.pythonclassroomdiary.wordpress.com © Sangeeta M Chauhan, Gwalior ………..Continued from previous page Variables are created to store values for checkboxes and radiobuttons Functions are called when widgets(controls) are selected Label is created to display message using functions sel(),selchk1(),selchk2()….. www.pythonclassroomdiary.wordpress.com © Sangeeta M Chauhan, Gwalior Output Message displayed when radio button or checkbox is selected www.pythonclassroomdiary.wordpress.com © Sangeeta M Chauhan, Gwalior In the same way you can use other control To View More Programs using tkinter follow the link: 1.
Recommended publications
  • Python Qt Tutorial Documentation Release 0.0
    Python Qt tutorial Documentation Release 0.0 Thomas P. Robitaille Jun 11, 2018 Contents 1 Installing 3 2 Part 1 - Hello, World! 5 3 Part 2 - Buttons and events 7 4 Part 3 - Laying out widgets 9 5 Part 4 - Dynamically updating widgets 13 i ii Python Qt tutorial Documentation, Release 0.0 This is a short tutorial on using Qt from Python. There are two main versions of Qt in use (Qt4 and Qt5) and several Python libraries to use Qt from Python (PyQt and PySide), but rather than picking one of these, this tutorial makes use of the QtPy package which provides a way to use whatever Python Qt package is available. This is not meant to be a completely exhaustive tutorial but just a place to start if you’ve never done Qt development before, and it will be expanded over time. Contents 1 Python Qt tutorial Documentation, Release 0.0 2 Contents CHAPTER 1 Installing 1.1 conda If you use conda to manage your Python environment (for example as part of Anaconda or Miniconda), you can easily install Qt, PyQt5, and QtPy (a common interface to all Python Qt bindings) using: conda install pyqt qtpy 1.2 pip If you don’t make use of conda, an easy way to install Qt, PyQt5, and QtPy is to do: pip install pyqt5 qtpy 3 Python Qt tutorial Documentation, Release 0.0 4 Chapter 1. Installing CHAPTER 2 Part 1 - Hello, World! To start off, we need to create a QApplication object, which represents the overall application: from qtpy.QtWidgets import QApplication app= QApplication([]) You will always need to ensure that a QApplication object exists, otherwise your Python script will terminate with an error if you try and use any other Qt objects.
    [Show full text]
  • Linux on the Road
    Linux on the Road Linux with Laptops, Notebooks, PDAs, Mobile Phones and Other Portable Devices Werner Heuser <wehe[AT]tuxmobil.org> Linux Mobile Edition Edition Version 3.22 TuxMobil Berlin Copyright © 2000-2011 Werner Heuser 2011-12-12 Revision History Revision 3.22 2011-12-12 Revised by: wh The address of the opensuse-mobile mailing list has been added, a section power management for graphics cards has been added, a short description of Intel's LinuxPowerTop project has been added, all references to Suspend2 have been changed to TuxOnIce, links to OpenSync and Funambol syncronization packages have been added, some notes about SSDs have been added, many URLs have been checked and some minor improvements have been made. Revision 3.21 2005-11-14 Revised by: wh Some more typos have been fixed. Revision 3.20 2005-11-14 Revised by: wh Some typos have been fixed. Revision 3.19 2005-11-14 Revised by: wh A link to keytouch has been added, minor changes have been made. Revision 3.18 2005-10-10 Revised by: wh Some URLs have been updated, spelling has been corrected, minor changes have been made. Revision 3.17.1 2005-09-28 Revised by: sh A technical and a language review have been performed by Sebastian Henschel. Numerous bugs have been fixed and many URLs have been updated. Revision 3.17 2005-08-28 Revised by: wh Some more tools added to external monitor/projector section, link to Zaurus Development with Damn Small Linux added to cross-compile section, some additions about acoustic management for hard disks added, references to X.org added to X11 sections, link to laptop-mode-tools added, some URLs updated, spelling cleaned, minor changes.
    [Show full text]
  • Testing Pyside/Pyqt Code Using the Pytest Framework and Pytest-Qt
    Testing PySide/PyQt Code Using the pytest framework and pytest-qt Florian Bruhin “The Compiler” Bruhin Software 06. November 2019 Qt World Summit, Berlin About me • 2011: Started using Python • 2013: Started using PyQt and developing qutebrowser • 2015: Switched to pytest, ended up as a maintainer • 2017: qutebrowser v1.0.0, QtWebEngine by default • 2019: 40% employed, 60% open-source and freelancing (Bruhin Software) Giving trainings and talks at various conferences and companies! Relevant Python features Decorators registered_functions: List[Callable] = [] def register(f: Callable) -> Callable: registered_functions.append(f) return f @register def func() -> None: .... Relevant Python features Context Managers def write_file() -> None: with open("test.txt", "w") as f: f.write("Hello World") Defining your own: Object with special __enter__ and __exit__ methods. Relevant Python features Generators/yield def gen_values() -> Iterable[int] for i in range(4): yield i print(gen_values()) # <generator object gen_values at 0x...> print(list(gen_values())) # [0, 1, 2, 3] PyQt • Started in 1998 (!) by Riverbank Computing • GPL/commercial • Qt4 $ PyQt4 Qt5 $ PyQt5 PySide / Qt for Python • Started in 2009 by Nokia • Unmaintained for a long time • Since 2016: Officially maintained by the Qt Company again • LGPL/commercial • Qt4 $ PySide Qt5 $ PySide2 (Qt for Python) Qt and Python import sys from PySide2.QtWidgets import QApplication, QWidget, QPushButton if __name__ == "__main__": app = QApplication(sys.argv) window = QWidget() button = QPushButton("Don't
    [Show full text]
  • Grants.Gov Workspace
    Grants.gov Workspace Must have Adobe Reader or Pro Register Must be registered in Grants.gov 2 1. Go to www.grants.gov 2. Click on “Register” in the upper right corner 3 3. Click on “Get Registered Now” link near bottom of the page. On the following page, fill in requested information and select “Continue”. 4. Click “Send Temporary Code” on the next screen. The email you have registered on the earlier screen will receive a six digit code from the Grants.gov Registration Team. Retrieve from your email, enter where indicated, and select Continue. 5. Affiliate with our Institution by Selecting “Add Organization Applicant Profile”, enter UMKU DUNS number (010989619), a profile name (your choice), and your title. Save. 5 The Institutions authorized official will receive notification of your request automatically and will process your permissions. You can now apply for grants! 1 Initiate Workspace Application Once you’re registered, on the Grants.gov home page you can now select Login, which is in the upper right corner next to Register. There are couple of ways you can get to the correct application forms. Within the guidelines for the funding opportunity announcement (FOA), you can click on “Go to Grants.gov” to download an application package. You can search for the FOA from “Search Grants” tab in Grants.gov. o Once you find it, click on the Opp Number o Then click on “Package” o Then click on “Apply” o To receive updates on this funding opportunity, Select Subscribe to Opportunity in the top right of this page.
    [Show full text]
  • Simple Plotter Documentation Release 0.0.0
    simple_plotter Documentation Release 0.0.0 Thies Hecker Mar 30, 2020 Contents: 1 Getting started 3 1.1 Desktop..................................................3 1.2 Android..................................................3 1.3 Configuration options..........................................4 1.4 Requirements...............................................4 1.5 Source code...............................................4 2 User guide 7 2.1 Overview.................................................7 2.2 Defining an equation...........................................7 2.3 Creating a plot..............................................8 2.4 Adjust the plot appearance........................................8 2.5 Constants.................................................9 2.6 Plotting curve sets............................................ 10 2.7 Plot labels................................................ 11 2.8 Load, save and export.......................................... 12 2.9 Advanced usage............................................. 12 3 Licenses 17 3.1 simple-plotter............................................... 17 3.2 simple-plotter-qt............................................. 18 3.3 simple-plotter4a............................................. 18 3.4 simple-plotter4a binary releases (Android)............................... 18 4 Contributing 43 4.1 Concept.................................................. 43 4.2 Package versions............................................. 43 4.3 Building conda packages........................................
    [Show full text]
  • Gui Programming Using Tkinter
    1 GUI PROGRAMMING USING TKINTER Cuauhtémoc Carbajal ITESM CEM April 17, 2013 2 Agenda • Introduction • Tkinter and Python Programming • Tkinter Examples 3 INTRODUCTION 4 Introduction • In this lecture, we will give you a brief introduction to the subject of graphical user interface (GUI) programming. • We cannot show you everything about GUI application development in just one lecture, but we will give you a very solid introduction to it. • The primary GUI toolkit we will be using is Tk, Python’s default GUI. We’ll access Tk from its Python interface called Tkinter (short for “Tk interface”). • Tk is not the latest and greatest, nor does it have the most robust set of GUI building blocks, but it is fairly simple to use, and with it, you can build GUIs that run on most platforms. • Once you have completed this lecture, you will have the skills to build more complex applications and/or move to a more advanced toolkit. Python has bindings or adapters to most of the current major toolkits, including commercial systems. 5 What Are Tcl, Tk, and Tkinter? • Tkinter is Python’s default GUI library. It is based on the Tk toolkit, originally designed for the Tool Command Language (Tcl). Due to Tk’s popularity, it has been ported to a variety of other scripting languages, including Perl (Perl/Tk), Ruby (Ruby/Tk), and Python (Tkinter). • The combination of Tk’s GUI development portability and flexibility along with the simplicity of a scripting language integrated with the power of systems language gives you the tools to rapidly design and implement a wide variety of commercial-quality GUI applications.
    [Show full text]
  • Graphical User Interface (Gui) Lab
    GRAPHICAL USER INTERFACE (GUI) LAB This lab will guide you through the complex process of graphical user interface (GUI) creation. GUI’s are interfaces computer users invoke to make computer programs easier to use. They provide a graphical means to perform simple and complex operations or procedures. Computer programmers make most of their applications as GUIs so users are not required to learn computer programming languages. We each use GUIs on a daily basis. Any computer program that implements buttons or menus to perform tasks is GUI based. Some examples include; Microsoft Word, ArcMap, ENVI, S-Plus, etc. GUIs in IDL In IDL there are two ways to create GUIs; manual script generation (writing code line by line as we have done in the previous labs) or semi-automatic script generation (this process uses a GUI already built into IDL to generate GUIs (this will make more sense later in the lab)). Before we create a functional GUI we need to understand basic GUI architecture. GUIs are comprised of numerous widgets that interact to accomplish a task. Common widgets used in IDL include the base widget (widget_base), button widgets (widget_button), text widgets (widget_text), and label widgets (widget_label). MANUAL GUI CREATION Let’s create a simple GUI (manually) to display a few basic concepts. First we must create the base widget (the matrix within which all other widgets in the GUI are contained). 1. Use the widget_base function to create a base widget by typing the following code in the IDL editor window. ; creates a widget_base called base Pro simp_widg base = widget_base(XSIZE = 175, YSIZE =50, TITLE='A Simple Example') ;realize the widget widget_control, base, /REALIZE end The XSIZE and YSIZE keywords specify the horizontal and vertical size (in pixels) of the base widget, while the TITLE keyword creates a title for the widget.
    [Show full text]
  • How to Use the Graphical User Interface TCS Technical Bulletin
    How to Use the Graphical User Interface TCS Technical Bulletin A. Create/Edit the Graphical Interface (Build Mode) Accessing the site using the Graphical Interface requires that you first build a layout (one or more layers/tabs depending on your site). This is done using the setup wizard to upload images/backgrounds and place controllers in appropriate locations on those images/backgrounds. When finished and saved, the User accesses the site using the Graphical Interface. 1. Click the “+” button to add a layer/tab for the site. (Skip to step 7 to edit an existing layer.) 2. Name the layer/tab by clicking in the field and entering the desired name. 3. Click the Choose File button to select the desired background image from your computer’s drive and click the Save button. 4. The Place View will open showing you the layer/tab title, a Save Positions button, the background image, and a bin of available controllers along the right-hand edge of the Graphical Interface which can be placed onto the layer/ tab. 5. Drag/drop controller icons from the icon bin to the desired location on the background image. Moving your mouse over each icon will show that controller’s name. The arrows at the top and bottom of scroll bar or the scroll bar itself allow you to scroll through the available controllers. NOTE: If you have placed controller icons too close to the icon bin and you would like to move them, you may need to scroll the available controllers up or down to clear the area around an icon to allow it to be dragged/dropped again.
    [Show full text]
  • Widget Toolkit – Getting Started
    APPLICATION NOTE Atmel AVR1614: Widget Toolkit – Getting Started Atmel Microcontrollers Prerequisites • Required knowledge • Basic knowledge of microcontrollers and the C programming language • Software prerequisites • Atmel® Studio 6 • Atmel Software Framework 3.3.0 or later • Hardware prerequisites • mXT143E Xplained evaluation board • Xplained series MCU evaluation board • Programmer/debugger: • Atmel AVR® JTAGICE 3 • Atmel AVR Dragon™ • Atmel AVR JTAGICE mkll • Atmel AVR ONE! • Estimated completion time • 2 hours Introduction The aim of this document is to introduce the Window system and Widget toolkit (WTK) which is distributed with the Atmel Software Framework. This application note is organized as a training which will go through: • The basics of setting up graphical widgets on a screen to make a graphical user interface (GUI) • How to get feedback when a user has interacted with a widget • How to draw custom graphical elements on the screen 8300B−AVR−07/2012 Table of Contents 1. Introduction to the Window system and widget toolkit ......................... 3 1.1 Overview ........................................................................................................... 3 1.2 The Window system .......................................................................................... 4 1.3 Event handling .................................................................................................. 5 1.3.2 The draw event ................................................................................... 6 1.4 The Widget
    [Show full text]
  • Abstract Window Toolkit Overview
    In this chapter: • Components • Peers 1 • Layouts • Containers • And the Rest • Summary Abstract Window Toolkit Overview For years, programmers have had to go through the hassles of porting software from BSD-based UNIX to System V Release 4–based UNIX, from OpenWindows to Motif, from PC to UNIX to Macintosh (or some combination thereof), and between various other alternatives, too numerous to mention. Getting an applica- tion to work was only part of the problem; you also had to port it to all the plat- forms you supported, which often took more time than the development effort itself. In the UNIX world, standards like POSIX and X made it easier to move appli- cations between different UNIX platforms. But they only solved part of the prob- lem and didn’t provide any help with the PC world. Portability became even more important as the Internet grew. The goal was clear: wouldn’t it be great if you could just move applications between different operating environments without worr yingabout the software breaking because of a different operating system, win- dowing environment, or internal data representation? In the spring of 1995, Sun Microsystems announced Java, which claimed to solve this dilemma. What started out as a dancing penguin (or Star Trek communicator) named Duke on remote controls for interactive television has become a new paradigm for programming on the Internet. With Java, you can create a program on one platform and deliver the compilation output (byte-codes/class files) to ever yother supported environment without recompiling or worrying about the local windowing environment, word size, or byte order.
    [Show full text]
  • Kivy Documentation Release 1.9.2-Dev0
    Kivy Documentation Release 1.9.2-dev0 www.kivy.org CONTENTS I User’s Guide3 1 Installation 5 2 Philosophy 25 3 Contributing 27 4 FAQ 39 5 Contact Us 43 II Programming Guide 45 6 Kivy Basics 47 7 Controlling the environment 53 8 Configure Kivy 57 9 Architectural Overview 59 10 Events and Properties 63 11 Input management 71 12 Widgets 77 13 Graphics 97 14 Kv language 99 15 Integrating with other Frameworks 109 16 Best Practices 113 17 Advanced Graphics 115 18 Packaging your application 117 III Tutorials 137 19 Pong Game Tutorial 139 i 20 A Simple Paint App 151 IV API Reference 161 21 Kivy framework 163 22 Adapters 249 23 Core Abstraction 257 24 Kivy module for binary dependencies. 283 25 Effects 285 26 Extension Support 289 27 Garden 293 28 Graphics 295 29 Input management 363 30 Kivy Language 381 31 External libraries 401 32 Modules 403 33 Network support 413 34 Storage 417 35 NO DOCUMENTATION (package kivy.tools) 423 36 Widgets 427 V Appendix 621 37 License 623 Python Module Index 625 ii Welcome to Kivy’s documentation. Kivy is an open source software library for the rapid development of applications equipped with novel user interfaces, such as multi-touch apps. We recommend that you get started with Getting Started. Then head over to the Programming Guide. We also have Create an application if you are impatient. You are probably wondering why you should be interested in using Kivy. There is a document outlining our Philosophy that we encourage you to read, and a detailed Architectural Overview.
    [Show full text]
  • Asyncprotect T1 Extunderscore Gui Documentation
    async_gui Documentation Release 0.1.1 Roman Haritonov Aug 21, 2017 Contents 1 Usage 1 1.1 Installation................................................1 1.2 First steps.................................................1 1.3 Tasks in threads.............................................2 1.4 Tasks in processes............................................3 1.5 Tasks in greenlets.............................................3 1.6 Returning result.............................................3 2 Supported GUI toolkits 5 3 API 7 3.1 engine..................................................7 3.2 tasks...................................................8 3.3 gevent_tasks...............................................9 4 Indices and tables 11 Python Module Index 13 i ii CHAPTER 1 Usage Installation Install with pip or easy_install: $ pip install --upgrade async_gui or download latest version from GitHub: $ git clone https://github.com/reclosedev/async_gui.git $ cd async_gui $ python setup.py install To run tests: $ python setup.py test First steps First create Engine instance corresponding to your GUI toolkit (see Supported GUI toolkits): from async_gui.tasks import Task from async_gui.toolkits.pyqt import PyQtEngine engine= PyQtEngine() It contains decorator @engine.async which allows you to write asynchronous code in serial way without callbacks. Example button click handler: @engine.async def on_button_click(self, *args): self.status_label.setText("Downloading image...") 1 async_gui Documentation, Release 0.1.1 # Run single task in separate thread
    [Show full text]