Chinaunix首页 | 论坛 | 博客
  • 博客访问: 341664
  • 博文数量: 79
  • 博客积分: 3053
  • 博客等级: 中校
  • 技术积分: 861
  • 用 户 组: 普通用户
  • 注册时间: 2006-02-27 20:43
文章分类

全部博文(79)

文章存档

2012年(3)

2011年(21)

2010年(15)

2009年(40)

分类: Python/Ruby

2009-06-12 16:43:34



def sigwinch_passthrough(sig,data):  
    """窗口改动后,自动返回当前窗口值,以便跟远程窗口同步,目前有问题"""  
    s=struct.pack("HHHH",0,0,0,0)  
    a=struct.pack('hhhh',fcntl.ioctl(sys.stdout.fileno(),termios.TIOCGWINSZ,s))  
  
    #global columns,lines  
    """ self.lines=a[0] 
    self.columns=a[1] 
    print "resize windows size(%s,%s)"%(self.lines,self.columns) 
    """  
    print a[0],a[1]  # 打印横座标与纵座标
阅读(640) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~