Coder Social home page Coder Social logo

b-xiang / traitsui Goto Github PK

View Code? Open in Web Editor NEW

This project forked from enthought/traitsui

0.0 1.0 0.0 47.54 MB

TraitsUI: Traits-capable windowing framework

Home Page: http://docs.enthought.com/traitsui

License: Other

Python 99.93% Shell 0.03% Batchfile 0.04%

traitsui's Introduction

TraitsUI: Traits-capable windowing framework

image

image

The TraitsUI project contains a toolkit-independent GUI abstraction layer, which is used to support the "visualization" features of the Traits package. Thus, you can write model in terms of the Traits API and specify a GUI in terms of the primitives supplied by TraitsUI (views, items, editors, etc.), and let TraitsUI and your selected toolkit and back-end take care of the details of displaying them.

Example

Given a Traits model like the following:

from traits.api import HasTraits, Str, Range, Enum

class Person(HasTraits):
    name = Str('Jane Doe')
    age = Range(low=0)
    gender = Enum('female', 'male')

person = Person(age=30)

we can use TraitsUI to specify a and display a GUI view:

from traitsui.api import Item, RangeEditor, View

person_view = View(
    Item('name'),
    Item('gender'),
    Item('age', editor=RangeEditor(mode='spinner', low=0, high=150)),
    buttons=['OK', 'Cancel'],
    resizable=True,
)

person.configure_traits(view=person_view)

which creates a GUI which looks like this:

image

Installation

If you want to run traitsui, you must also install:

You will also need one of the following backends:

  • PyQt
  • wxPython
  • PySide
  • PyQt5

Backends have additional dependencies and there are optional dependencies on NumPy and Pandas for some editors.

TraitsUI along with all dependencies can be installed in a straightforward way using the Enthought Deployment Manager, pip or other .

Running the Test Suite

To run the test suite, you will need to install Git and EDM as well as have a Python environment which has install Click available. You can then follow the instructions in etstool.py. In particular:

> python etstool.py test_all

will run tests in all supported environments automatically.

traitsui's People

Contributors

corranwebster avatar kitchoi avatar itziakos avatar rkern avatar aaronayres35 avatar pberkes avatar mdickinson avatar ievacerny avatar warrenweckesser avatar cfarrow avatar pradyunsg avatar jonathanrocher avatar achabotl avatar burnpanck avatar senganal avatar prabhuramachandran avatar notmatthancock avatar jwiggins avatar stefanoborini avatar robind42 avatar agrawalprash avatar epatters avatar shoeb-github avatar punchagan avatar bergtholdt avatar sandhya-sago avatar pankajp avatar tonysyu avatar timdiller avatar pbrod avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.