用脚本下载pygtk官方example

#/usr/bin/bash
wget http://pygtk.org/pygtk2tutorial/examples/
ARRAY=($(cat index.html | awk '{print $5}' | grep href |  sed -r 's/.*"(.+)".*/\1/' | sed '1,2d'))
for i in ${ARRAY[*]}
do
        wget http://pygtk.org/pygtk2tutorial/examples/${i}
done



今天快下班了,用wget一个一个下载pygtk 官方的例子,好累啊。想着是不是写一个脚本替代下我的双手,简单分析发现,果然可以。

然后就写了上面的脚本,可以一键下载所有例子,太给力了

GTK is essentially an object oriented application programmers interface (API). Although written completely in C, it is implemented using the idea of classes and callback functions (pointers to functions). There is also a third component called GLib which contains a few replacements for some standard calls, as well as some additional functions for handling linked lists, etc. The replacement functions are used to increase GTK’s portability, as some of the functions implemented here are not available or are nonstandard on other unixes such as g_strerror(). Some also contain enhancements to the libc versions, such as g_malloc that has enhanced debugging utilities. In version 2.0, GLib has picked up the type system which forms the foundation for GTK’s class hierarchy, the signal system which is used throughout GTK, a thread API which abstracts the different native thread APIs of the various platforms and a facility for loading modules. As the last component, GTK uses the Pango library for internationalized text output. This tutorial describes the Python interface to GTK+ and is based on the GTK+ 2.0 Tutorial written by Tony Gale and Ian Main. This tutorial attempts to document as much as possible of PyGTK, but is by no means complete. This tutorial assumes some understanding of Python, and how to create and run Python programs. If you are not familiar with Python, please read the Python Tutorial [http://www.python.org/doc/current/tut/tut.html] first. This tutorial does not assume an understanding of GTK; if you are learning PyGTK to learn GTK, please comment on how you found this tutorial, and what you had trouble with. This tutorial does not describe how to compile or install Python, GTK+ or PyGTK. This tutorial is based on: • GTK+ 2.0 through GTK+ 2.4 • Python 2.2 • PyGTK 2.0 through PyGTK 2.4
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值