Vuyisile Ndlovu, @terrameijar
Commandline applications are great because they are fast, easy on resources and allow you to automate repetitive tasks in the terminal. In this talk, I will show you two ways to bring your commandline applications out of the terminal and onto your desktop.
Vuyisile Ndlovu, PyConZW 2017the standard Python interface to the Tk GUI toolkit and is Python's de facto standard GUI.Vuyisile Ndlovu, PyConZW 2017
All GUI toolkits allow us to use standard windows such as these:
Vuyisile Ndlovu, PyConZW 2017File/Directory Selection
Question Boxes
Wouldn't it be great if we could "borrow" some of the GUI features and add them to our scripts without turning them into full-featured GUI programs?
Vuyisile Ndlovu, PyConZW 2017a utility used to add GUI forms to scripts and receive feedback from the user.Vuyisile Ndlovu, PyConZW 2017
#!/bin/sh
zenity --question \
--text="Are you sure you wish to proceed?"
#! /usr/bin/env python
import subprocess as s
s.call(["zenity","--question","--text=Are you sure?"])
#! /usr/bin/env python
from PyZenity import Question
cancel = Question('Should I cancel the operation?')
notify-send is a program used to send notifications to the user via a notification daemon from the commandline. These notifications can be used to inform the user about an event or display information without getting in the user's way.
Vuyisile Ndlovu, PyConZW 2017
notify-send [OPTION] [TITLE] [BODY]
notify-send --icon weather-overcast \
"Weather" "Overcast"
import subprocess as s
s.call(["notify-send", "--icon", "weather-overcast", \
"Weather", "Overcast"])