Sometimes you can write your own gadgets and prefer non-graphic interfaces. However, some applications still bring up a reminder to let you know.
Zenity is a very handsome thing. For its usage, refer to its -- help. I will not repeat it here. Here is my example:
This is a small stuff used to query user information in the blog Park.
MyCodeThe shell command called using Python has a graphical interface. In fact, pygtk is more handsome and learning ...... (The source code package failed to be uploaded, so I had to stick it here)
# ! /Usr/bin/Python
# -*-Coding: UTF-8 -*-
# Filenam: get_cnblogs.py
# Author z_zz
Import OS
Import Sys
Import Re
From Urllib Import Urlopen
String = Urlopen ( " Http://www.cnblogs.com/AllBloggers.aspx " ). Read ()
Usr_name = ' Amboyna '
URL = " Http://www.cnblogs.com "
Usr_length=Len (usr_name)
I=String. Count (usr_name)
R=String. Find (usr_name)
Usr_string=String [R- 60: R+ 50]
Name_s = Usr_string.find (usr_name + " /\ " > " ) + Len (usr_name) + 3
Name_e = Usr_string.find ( " </A> & nbsp; " )
Name = Usr_string [name_s: name_e]
small_s = usr_string.find ( ' ' )
small_e = usr_string.find ( ' . & nbsp; ' )
NO = usr_string [small_s + 7 : small_e]
Http_s=Usr_string.find (URL)
HTTP=Usr_string [http_s: http_s+Len (URL)+Usr_length+ 1]
# --------------------------------------------------
# Print '\ N'
# Print '----------------------------------'
# Print 'id: \ t', usr_name
# Print 'name: \ t', name
# Print 'No.: \ t', no
# Print 'url: \ t', HTTP
# Print '---------------------------------- \ N'
# --------------------------------------------------
Str = " Your blog information: \ n ============================================ =====\ n "
Str + = " ID: \ t " + Usr_name
Str + = " \ Nname: \ t " + Name
Str + = " \ N no.: \ t " + No
Str + = " \ N URL: \ t " + HTTP
Str + = " \ N ============================================ =====\ n "
Str + = " \ N \ t \ tby amboyna \ n "
Print Str
OS. System ( ' Zenity -- info -- Title = \ ' Www. cnblogs. com \ ' -- Text = \ '' + STR + ' \ '' )