Very Simple Graphical library for Python shell script
Project description
#!/usr/bin/env python
"""
Example of VSGUI to describe what it does....
@author Hsin-Yi Chen (hychen) <ossug.hychen@gmail.com>
How to use
user@host$ python READEME.txt
"""
import sys
import time
import random
from vsgui import *
anwsers = ["loves you", "don't love you"]
notice("Hey! Example of VSGUI is running!")
if not input_yesno("Do you want to start this example to see how it work?",
y="Sure", n="No! I don't want"):
warning("OK! but please read the codes if you have time.")
username = input_text("Your name:")
if not check_passwd(username, text="(passwd is %s)" % username):
error("Die!")
sys.exit()
usersex = input_ab("What is your sex?", 'male', 'famel')
liked_sex = input_radiolist(['sex'], ['','male', '','famel', '', 'unknow'], text="What is your lover's sex?")
def get_anwser():
update = progress('Starting to ask Mazo-Po', auto_close=True)
update('20', "sending your questions to sky")
time.sleep(1)
update('40', "Mazo-Po hear questions")
time.sleep(1)
update('60', "Mazo-Po is asking A-pi-PO")
time.sleep(1)
update('80', "A-pi-Po is thinking")
anwser = random.choice(anwsers)
time.sleep(1)
update('100', "A-pi-Po get a anwser")
return anwser
accept = False
while not accept:
anwser = get_anwser()
msg = ['Your are %s, a %s' % (username, usersex),
'your lover is a %s' % liked_sex,
'and he/her %s' % anwser]
msg.append("Do you accept this?")
accept = input_yesno(','.join(msg), y='Yes', n='Fuck!')
# save result
# @TODO write example for saving file
"""
Example of VSGUI to describe what it does....
@author Hsin-Yi Chen (hychen) <ossug.hychen@gmail.com>
How to use
user@host$ python READEME.txt
"""
import sys
import time
import random
from vsgui import *
anwsers = ["loves you", "don't love you"]
notice("Hey! Example of VSGUI is running!")
if not input_yesno("Do you want to start this example to see how it work?",
y="Sure", n="No! I don't want"):
warning("OK! but please read the codes if you have time.")
username = input_text("Your name:")
if not check_passwd(username, text="(passwd is %s)" % username):
error("Die!")
sys.exit()
usersex = input_ab("What is your sex?", 'male', 'famel')
liked_sex = input_radiolist(['sex'], ['','male', '','famel', '', 'unknow'], text="What is your lover's sex?")
def get_anwser():
update = progress('Starting to ask Mazo-Po', auto_close=True)
update('20', "sending your questions to sky")
time.sleep(1)
update('40', "Mazo-Po hear questions")
time.sleep(1)
update('60', "Mazo-Po is asking A-pi-PO")
time.sleep(1)
update('80', "A-pi-Po is thinking")
anwser = random.choice(anwsers)
time.sleep(1)
update('100', "A-pi-Po get a anwser")
return anwser
accept = False
while not accept:
anwser = get_anwser()
msg = ['Your are %s, a %s' % (username, usersex),
'your lover is a %s' % liked_sex,
'and he/her %s' % anwser]
msg.append("Do you accept this?")
accept = input_yesno(','.join(msg), y='Yes', n='Fuck!')
# save result
# @TODO write example for saving file
Project details
Release history Release notifications | RSS feed
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.1.tar.gz
(3.8 kB
view details)
File details
Details for the file vsgui-0.1.tar.gz.
File metadata
- Download URL: vsgui-0.1.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52b536b6385b64112562d501503d58b8440ebfc60d53c21d3bdfe7208f86e32b
|
|
| MD5 |
f6d2e34348e842535c59084e572c4b97
|
|
| BLAKE2b-256 |
96b4609ddf8a407932e3fcbe2168acb8a2b64a7708494b528d8b4011e12e111f
|