解读用python写自己的linux播放器(1)
接下来三行设置三种功能,treeview.set_search_column(0),当在界面中按“Control+F”时可以搜索第0列中的内容,tvcolumn.set_sort_column_id(0),当点击此列标题的时候所有的行按大小顺序重新排列。参数0是
列在Model里的序号。接下来treeview.set_reorderable方法使得可以用鼠标拖动行进行重新排列,比如,把第二行拖到第一行前,或者拖到第一行内,让第二行变成第一行的子节点(只有TreeStore可以做到这一点)。
下面就来改改这个程序,让它变成一个文件浏览器。
#
!/usr/bin/python
import
gtk
import
os
from
mainw
import
MainWindow
class
BasicTreeview(MainWindow):
def
get_widget(self):
dirname
=
u
"
E:\\lame-3.97
" #Fix Me:You should replace it with any valid dirname in your system.
dir_iter_dic
=
{dirname:None}
treestore
=
gtk.TreeStore(str,str,str)
for
dirpath, dirnames, filenames
in
os.walk(dirname):
for
directory
in
dirnames:
abspath
=
os.path.join(dirpath,directory)
iterator
=
treestore.append(dir_iter_dic[dirpath],
[directory,abspath,gtk.STOCK_DIRECTORY])
dir_iter_dic[abspath]
=
iterator
&n
相关文档:
环境说明:本机只有一张网卡,使用静态IP上网
命令:apt-get install shorewall ubuntu会自动的给你安装好,但是shorewall没有配置
也没有启动
「1」首先cp /usr/share/doc/shorewall/examples/one-interface/* /etc/shorewall
「2」修改/etc/shorewall/shor ......
前言:这一章我们讨论一下Linux下的信号处理函数。
Linux下的信号处理函数:
信号的产生
信号的处理
其它信号函数
一个实例
1.信号的产生
Linux下的信号可以类比于DOS下的INT或者是Windows下的事件。在有一个信号发生时候相信 ......
linux目录架构
/ 根目录
/bin 常用的命令
binary file 的目錄
/boot 存放系统启动时必须读取的档案,包括核心
(kernel) 在内
/boot/grub/menu.lst GRUB设置
/boot/vmlinuz 内核
......
当内存出现不够用的时候,oom-killer会kill掉一些进程
这个信息可以在/var/log/messger里查到
当这种情况出现的时候,可以将系统里一些nattach为0的shm清理掉
关于高低端内存的问题可以看如下
Since this problem seems to popup on different lists, this message has
been cross-posted to the general Red Hat disc ......
Linux 系统下如何分区才最合理
以下摘自《Gentoo Linux x86手册》
http://www.gentoo.org/doc/zh_cn/handbook/handbook-x86.xml
分区的数目主要根据你的系统环境来决定。
例如,如果你有很多用户,你可能更希望把你的/home目录独立出来,因为这样做可以增加安全性,备份起来也更容易。如果你安装Gentoo用来做邮件服务器 ......