Skip to main content

Very Simple Graphical library for Python shell script

Project description

VSGUI - Very Simple Graphic Interface Library for Python
========================================================

Description
-----------

It proides a simple functions to comuunicate with `zenity` which
is a program that will display GTK+ dialogs, and return
(either in the return code, or on standard output) the users input.
This allows you to present information, and ask for information from
the user, from all manner of shell scripts.

Note: this moduels requires `ucltip` (http://pypi.python.org/pypi/ucltip)
module, please install it.

How To Use
----------

The source code includes some examples, so you can take a qucik look before you
start coding, and thre are two part of this library as below

1. High Level API functions
---------------------------

Before start, you need to import api funcitons:

::
from vsgui.api import *

Dialogs

::
from vsgui.api import *

# information dialog
info(msg)

# warring dialog
warning(msg):

# error dialog
error(msg):

# error dialog and terminate script
die(msg):

# notice dialog
notice(msg):

Input Text

::
# input text
input_text(text, initial=None)

# input password
input_passwd(text)

Questions

::

# ask user the anwser is yes or no
input_yesno(text, y=None, n=None):

# ask user select a or b
input_ab(text, a, b):

# ask user passowrd, and check it
check_passwd(wanted, count=3, text='', errmsg='wrong password, try again!')

Progress
-------

::
# launch a progress bar and create a update function
update = progress('downloading files')

# update progress bar message ot 'md5sum checking' and progessive number to 90
update(90, 'md5sum checking')


2. Zenity Class
---------------

if api functions is not enough, you can use Zenity class direcly to get
more powerful feature.

::
from vsgui.zenity import Zenity
z = Zenity()

# same as executing 'zenity --file-selection --filename=a.txt'
z.file_selection(filename='a.txt')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vsgui-0.2rc1.tar.gz (4.0 kB view details)

Uploaded Source

File details

Details for the file vsgui-0.2rc1.tar.gz.

File metadata

  • Download URL: vsgui-0.2rc1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for vsgui-0.2rc1.tar.gz
Algorithm Hash digest
SHA256 1da41730c9d717ca2b7f0e004c95f38c5f3de190e6ed9c738549d6bdc91d53bd
MD5 306f0c46f97e8564212e6a2e1ce1ceb8
BLAKE2b-256 6b2aaba0bcb10a4552a5c87f38aec259ab226b2a317a5a6f7b39815614e934d6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page