Python-2.5.2-idlelib patch 


Python 2.5.2 (r252:60911, Feb 23 2008, 21:20:32)
[GCC 4.2.3] on linux2
Type "copyright", "credits" or "license()" for more information.

****************************************************************
Personal firewall software may warn about the connection IDLE
makes to its subprocess using this computer's internal loopback
interface. This connection is not visible on any external
interface and no data is sent to or received from the Internet.
****************************************************************

IDLE 1.2.2
>>> import os
>>> os. <--- pressing tab should give you the available
options for that module/library.
The error in the console is as follows:

Exception in Tkinter callback

Traceback (most recent call last):
File "/usr/lib/python2.5/lib-tk/Tkinter.py", line 1403, in __call__
return self.func(*args)
File "/usr/lib/python2.5/idlelib/AutoCompleteWindow.py", line 217, in
winconfig_event
x, y, cx, cy = self.widget.bbox(self.startindex)
File "/usr/lib/python2.5/lib-tk/Tkinter.py", line 2833, in bbox
self.tk.call((self._w, 'bbox') + args)) or None
File "/usr/lib/python2.5/lib-tk/Tkinter.py", line 1030, in _getints
return tuple(map(getint, self.tk.splitlist(string)))
ValueError: invalid literal for int() with base 10: '(63,'
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.5/lib-tk/Tkinter.py", line 1403, in __call__
return self.func(*args)
File "/usr/lib/python2.5/idlelib/AutoCompleteWindow.py", line 217, in
winconfig_event
x, y, cx, cy = self.widget.bbox(self.startindex)
File "/usr/lib/python2.5/lib-tk/Tkinter.py", line 2833, in bbox
self.tk.call((self._w, 'bbox') + args)) or None
File "/usr/lib/python2.5/lib-tk/Tkinter.py", line 1030, in _getints
return tuple(map(getint, self.tk.splitlist(string)))
ValueError: invalid literal for int() with base 10: '(63,'
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.5/lib-tk/Tkinter.py", line 1403, in __call__
return self.func(*args)
File "/usr/lib/python2.5/idlelib/AutoCompleteWindow.py", line 217, in
winconfig_event
x, y, cx, cy = self.widget.bbox(self.startindex)
File "/usr/lib/python2.5/lib-tk/Tkinter.py", line 2833, in bbox
self.tk.call((self._w, 'bbox') + args)) or None
File "/usr/lib/python2.5/lib-tk/Tkinter.py", line 1030, in _getints
return tuple(map(getint, self.tk.splitlist(string)))
ValueError: invalid literal for int() with base 10: '(63,'

Python-2.5.2-idlelib patch

--- Lib/idlelib/WidgetRedirector.py.orig 2008-04-23 23:39:57.000000000 -0700
+++ Lib/idlelib/WidgetRedirector.py 2008-04-23 23:46:55.000000000 -0700
@@ -53,7 +53,13 @@
if m:
return m(*args)
else:
- return self.tk.call((self.orig, cmd) + args)
+ #return self.tk.call((self.orig, cmd) + args)
+ r = self.tk.call((self.orig, cmd) + args)
+ if isinstance(r, tuple):
+ # convert to string ourselves so we get a Tcl list
+ # that can be converted back into a tuple
+ r = ' '.join(map(str, r))
+ return r
except TclError:
return ""

[ add comment ] permalink related link ( 2.9 / 28 )
Arch linux系统Broadcom bcm43系列无线网卡轻松安装 

linux kernel 2.6.24及其后的版本已包含了bcm43xx driver.
安装方法如下:
1、sudo pacman -S b43-fwcutter
2、wget http://downloads.openwrt.org/sources/br ... .0.tar.bz2
3、tar jxvf broadcom-wl-4.80.53.0.tar.bz2
4、sudo mkdir /lib/firmware
5、b43-fwcutter -w "/lib/firmware/" wl_apsta.o
6、编辑/etc/rc.conf添加b43到modules部分

附:无线网卡的管理推荐用netcfg2。

参考内容:
ArchWiki::Wireless Setup http://wiki.archlinux.org/index.php/Wireless_Setup#b43
ArchWiki::Network Profiles http://wiki.archlinux.org/index.php/Network_Profiles
[ add comment ] permalink related link ( 2.9 / 30 )
ARCHLINUX 2008.04-rc硬盘安装 

自2007.08版装机后,一直一来都是升级更新,ARCHLINUX的升级更新也相当稳定,但电脑用的时间长了,文件堆放的也越来越杂乱,许多不错的软件,因暂时需要而安装,安装后又不经常使用,长期沉睡在硬盘上,久而久之硬盘慢慢变小,追求完美的我又能怎样容忍它这样下去呢!
ARCHLINUX 2008.04-rc版ISO放出时,就第一时间下载了它。说真的2008.04-rc的安装版硬盘不太友好,很多朋友都在INIT BOOT时因不能挂截CDROM而失败。但我们不能因为失败而止步不前,失败则是成功的开始。现在我们来用另类方法安装它吧。

思路如下:用2008.03的ISO来安装2008.04-rc,因为只是需要2008.03 ISO的引导文件,所以可以下载2008.03-03的FTP安装ISO文件,才30M左右,几分钟就下载完成。2008.04-rc是已下好的。

开始安装:
1、用7ZIP,RAR或其它解ISO的工具解压2008.03ISO中的isolinux文件夹下的vmlinuz和initrd.img 到本地硬盘上。如本机的D:\arch\文件夹下,本机的D盘为(hd0,4)

2、假设你想我一样现用的已是双系统啦(如果你没有GRUB引导管理器请参阅相关GRUB FOR DOS相关文章,网上大把大把的),在GRUB引导界面时按C键进入GRUB命令行,键入:

kernel (hd0,4)/arch/vmlinuz
initrd (hd0,4)/arch/initrd.img
boot


3、现在已正常引导并通过,出现安装界面,这里选CDROM作来安装源。(?这不是FTP的ISO吗?为什么要选CDROM作为安装源呢?你不是下载了2008.04-RC的ISO吗,你要重新下载一遍BASE软件包吗,如果你带宽高,时间多,有而心等,随便你啦。)
在选了CDROM作为安装源后,先不要按回车进行下一步。现在按ALT+F2进入另一个终端,用MOUNT挂截ISO。

本人对比过2008.03的ISO和2008.04的ISO文件组织可不一样的,那么我们以现在需要的方式挂截ISO,
2008.03的ISO的源文件是直接MOUNT到/src下面的,若你用2008.04-RC的ISO,它的源文件是在/addons/core-pkgs/目录下的。所以这里我们分两步走,第一步mount 2008.04-rc的iso到一个非/src的文件夹下,如/mnt/iso/,然后再ln /mnt/iso/addons/core-pkgs/ 到 /src/core文件夹下即可。命令如下:

mkdir /mnt/iso/
mkdir /src/core/
mount -t iso9660 -o loop /dev/hda5/arch/arch-core-rc4.iso /mnt/iso/
ln -s /mnt/iso/addons/core-pkgs/ /src/core/

然后按ALT+F1回到安装界面,开始下一步吧。

4、下一步安装,这里就不再多讲啦,网上搜搜一大把,先可以参考本BLOG的Archlinux 2007.08-2 (Don't Panic) 轻松安装
[ add comment ] permalink ( 3 / 29 )
Check to see if a script was run as root 

If you need to make sure a script is run as root, add the following to the start of the script:

if [[ $UID -ne 0 ]]; then
echo "$0 must be run as root"
exit 1
fi

[ add comment ] permalink related link ( 3.2 / 34 )
OpenTTD 0.6.0新功能介绍之驾车经路站 

OpenTTD 0.6.0 New features:drive through road stops
OpenTTD 0.6.0 新功能之驾车经路站即公路两傍的车站和货场
---------------------------------
OpenTTD5.x版中公路建设中的货场和车站都只有4种类型,这4种类型在建造时都要占用公路旁的一块空地,当城镇在高迅发展时,公路两旁的建筑容易连在一起发展,旧版的路侧车站和货场易隔断城镇建筑的连续发展,而且极期不美化,新版新增的两种车站和货场都在建在公路线上,省了建筑用地,且造价一样。有点类似现在的公交站,和公路临时货点。:)
附图为一个水陆两运截图,用的就是新型的车站和货场。

[ add comment ] permalink related link ( 3 / 47 )

| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Next> Last>>