2007年10月26日 星期五 11:59
hi all 我今天实验了一下difflib,发现它并不尽如人意. 我希望的结果是diff结果中将两段文本的差异之处记录下来(根据行号),并能根据这些差异和某一段文本组合出另一段文本. 我想这也是linux常见的diff工具的思路 但difflib 的 ndiff 函数和Differ的成员函数compare的比较结果,都是把差异部分和无差异的部分全部记录下来. 根据还原函数 restore的参数看, 它并不需要某个原始文本, 只要填写参数为第一个或第二个就可以把指定的原始内容还原出来. 请问有可能不使用diff这样的命令行工具, 而通过某个库调用获得只记录差异的diff结果吗? -- with kind regards
2007年10月26日 星期五 20:13
你安的不会和你的python版本不匹配吧。 我是安装好后就可以直接用的。 2007/10/27, wch <wch在cic.tsinghua.edu.cn>: > > > windows如何安装wxpython 我在安装完了以后 import找不到moudle > >>> sys.path > ['C:\\Python24\\Lib\\idlelib', > 'C:\\WINDOWS\\system32\\python24.zip', 'C:\\Python24', > 'C:\\Python24\\DLLs', 'C:\\Python24\\lib', 'C:\\Python24\\lib\\plat-win', > 'C:\\Python24\\lib\\lib-tk', > 'C:\\Python24\\lib\\site-packages', > 'E:\\wch\\note\\Python\\doc\\diveintopython-htmlflat-5.4_zh-ch\\py', > 'D:\\development\\ulipad.3.7\\ulipad', > 'D:\\development\\ulipad.3.7\\ulipad\\modules', > 'C:\\Python24\\Lib\\site-packages\\wx-2.8-msw-unicode\\wx\\lib', > 'C:\\Python24\\Lib\\site-packages\\wx-2.8-msw-unicode\\wxPython\\lib', > 'C:\\Python24\\Lib\\site-packages\\wx-2.8-msw-unicode\\wx', > 'C:\\Python24\\Lib\\site-packages\\wx-2.8-msw-unicode\\wx', > 'C:\\Python24\\Lib\\site-packages\\wx-2.8-msw-unicode\\wxPython', > 'C:\\Python24\\Lib\\site-packages', > 'C:\\Python24\\Lib\\site-packages\\wxaddons'] > > > > >>> import UliPad > > Traceback (most recent call last): > File "", line 1, in -toplevel- > import UliPad > File "D:\development\ulipad.3.7\ulipad\UliPad.py", line > 30, in -toplevel- > import wx > ImportError: No module named wx > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to > python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to > python-chinese-request在lists.python.cn > Detail Info: > http://python.cn/mailman/listinfo/python-chinese > -- Blog http://vicalloy.spaces.live.com/ My googlepage http://vicalloy.googlepages.com/ OldPhoto http://www.lzpian.com/
2007年10月27日 星期六 07:20
windowsÈçºÎ°²×°wxpython ÎÒÔÚ°²×°ÍêÁËÒÔºó importÕÒ²»µ½moudle >>> sys.path ['C:\\Python24\\Lib\\idlelib', 'C:\\WINDOWS\\system32\\python24.zip', 'C:\\Python24', 'C:\\Python24\\DLLs', 'C:\\Python24\\lib', 'C:\\Python24\\lib\\plat-win', 'C:\\Python24\\lib\\lib-tk', 'C:\\Python24\\lib\\site-packages', 'E:\\wch\\note\\Python\\doc\\diveintopython-htmlflat-5.4_zh-ch\\py', 'D:\\development\\ulipad.3.7\\ulipad', 'D:\\development\\ulipad.3.7\\ulipad\\modules', 'C:\\Python24\\Lib\\site-packages\\wx-2.8-msw-unicode\\wx\\lib', 'C:\\Python24\\Lib\\site-packages\\wx-2.8-msw-unicode\\wxPython\\lib', 'C:\\Python24\\Lib\\site-packages\\wx-2.8-msw-unicode\\wx', 'C:\\Python24\\Lib\\site-packages\\wx-2.8-msw-unicode\\wx', 'C:\\Python24\\Lib\\site-packages\\wx-2.8-msw-unicode\\wxPython', 'C:\\Python24\\Lib\\site-packages', 'C:\\Python24\\Lib\\site-packages\\wxaddons'] >>> import UliPad Traceback (most recent call last): File "", line 1, in -toplevel- import UliPad File "D:\development\ulipad.3.7\ulipad\UliPad.py", line 30, in -toplevel- import wx ImportError: No module named wx -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071026/bfa166d7/attachment.html
2007年10月28日 星期日 10:04
ÓпÉÄÜ£¬ÒòΪwindowsÉϵݲװ¶¼ÊǺܼòµ¥µÄ¡£ ÔÚ07-10-26£¬vicalloy <zbirder在gmail.com> дµÀ£º > > Äã°²µÄ²»»áºÍÄãµÄpython°æ±¾²»Æ¥Åä°É¡£ > ÎÒÊÇ°²×°ºÃºó¾Í¿ÉÒÔÖ±½ÓÓõġ£ > > 2007/10/27, wch <wch在cic.tsinghua.edu.cn>: > > > > > > windowsÈçºÎ°²×°wxpython ÎÒÔÚ°²×°ÍêÁËÒÔºó importÕÒ²»µ½moudle > > >>> sys.path > > ['C:\\Python24\\Lib\\idlelib', > > 'C:\\WINDOWS\\system32\\python24.zip', 'C:\\Python24', > > 'C:\\Python24\\DLLs', 'C:\\Python24\\lib', > 'C:\\Python24\\lib\\plat-win', > > 'C:\\Python24\\lib\\lib-tk', > > 'C:\\Python24\\lib\\site-packages', > > 'E:\\wch\\note\\Python\\doc\\diveintopython-htmlflat-5.4_zh-ch\\py', > > 'D:\\development\\ulipad.3.7\\ulipad', > > 'D:\\development\\ulipad.3.7\\ulipad\\modules', > > 'C:\\Python24\\Lib\\site-packages\\wx-2.8-msw-unicode\\wx\\lib', > > 'C:\\Python24\\Lib\\site-packages\\wx-2.8-msw-unicode\\wxPython\\lib', > > 'C:\\Python24\\Lib\\site-packages\\wx-2.8-msw-unicode\\wx', > > 'C:\\Python24\\Lib\\site-packages\\wx-2.8-msw-unicode\\wx', > > 'C:\\Python24\\Lib\\site-packages\\wx-2.8-msw-unicode\\wxPython', > > 'C:\\Python24\\Lib\\site-packages', > > 'C:\\Python24\\Lib\\site-packages\\wxaddons'] > > > > > > > > >>> import UliPad > > > > Traceback (most recent call last): > > File "", line 1, in -toplevel- > > import UliPad > > File "D:\development\ulipad.3.7\ulipad\UliPad.py", line > > 30, in -toplevel- > > import wx > > ImportError: No module named wx > > _______________________________________________ > > python-chinese > > Post: send python-chinese在lists.python.cn > > Subscribe: send subscribe to > > python-chinese-request在lists.python.cn > > Unsubscribe: send unsubscribe to > > python-chinese-request在lists.python.cn > > Detail Info: > > http://python.cn/mailman/listinfo/python-chinese > > > > > -- > Blog http://vicalloy.spaces.live.com/ > My googlepage http://vicalloy.googlepages.com/ > OldPhoto http://www.lzpian.com/ > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071028/f86fec86/attachment.html
2007年10月29日 星期一 23:30
·Â·ðÊÇÕâô»ØÊÂÁË ÎÒ°´µÄÊÇPython2.4 wypythonµÄ°æ±¾ÊÇ2.5µÄ ºÇºÇ ÔÎÁË ²»ºÃÒâ˼ ·¢¼þÈË£º ??? ?? ·¢ËÍʱ¼ä£º 2007-10-27 19:06:13 ÊÕ¼þÈË£º python-chinese在lists.python.cn ³ËÍ£º Ö÷Ì⣺ Re: [python-chinese]windows°²×°wxpythonµÄÎÊÌâ ÓпÉÄÜ£¬ÒòΪwindowsÉϵݲװ¶¼ÊǺܼòµ¥µÄ¡£ ÔÚ07-10-26£¬vicalloy <zbirder在gmail.com> дµÀ£º Äã°²µÄ²»»áºÍÄãµÄpython°æ±¾²»Æ¥Åä°É¡£ ÎÒÊÇ°²×°ºÃºó¾Í¿ÉÒÔÖ±½ÓÓõġ£ 2007/10/27, wch < wch在cic.tsinghua.edu.cn>: > > > windowsÈçºÎ°²×°wxpython ÎÒÔÚ°²×°ÍêÁËÒÔºó importÕÒ²»µ½moudle > >>> sys.path > ['C:\\Python24\\Lib\\idlelib', > 'C:\\WINDOWS\\system32\\python24.zip', 'C:\\Python24', > 'C:\\Python24\\DLLs', 'C:\\Python24\\lib', 'C:\\Python24\\lib\\plat-win', > 'C:\\Python24\\lib\\lib-tk', > 'C:\\Python24\\lib\\site-packages', > 'E:\\wch\\note\\Python\\doc\\diveintopython- htmlflat-5.4_zh-ch\\py', > 'D:\\development\\ulipad.3.7\\ulipad', > 'D:\\development\\ulipad.3.7\\ulipad\\modules', > 'C:\\Python24\\Lib\\site-packages\\wx-2.8-msw-unicode\\wx\\lib ', > 'C:\\Python24\\Lib\\site-packages\\wx-2.8-msw-unicode\\wxPython\\lib', > 'C:\\Python24\\Lib\\site-packages\\wx-2.8-msw-unicode\\wx', > 'C:\\Python24\\Lib\\site-packages\\wx-2.8-msw-unicode\\wx ', > 'C:\\Python24\\Lib\\site-packages\\wx-2.8-msw-unicode\\wxPython', > 'C:\\Python24\\Lib\\site-packages', > 'C:\\Python24\\Lib\\site-packages\\wxaddons'] > > > > >>> import UliPad > > Traceback (most recent call last): > File "", line 1, in -toplevel- > import UliPad > File "D:\development\ulipad.3.7\ulipad\UliPad.py", line > 30, in -toplevel- > import wx > ImportError: No module named wx > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to > python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to > python-chinese-request在lists.python.cn > Detail Info: > http://python.cn/mailman/listinfo/python-chinese > -- Blog http://vicalloy.spaces.live.com/ My googlepage http://vicalloy.googlepages.com/ OldPhoto http://www.lzpian.com/ _______________________________________________ python-chinese Post: send python-chinese在lists.python.cn Subscribe: send subscribe to python-chinese-request在lists.python.cn Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn Detail Info: http://python.cn/mailman/listinfo/python-chinese -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071029/653188bd/attachment.html
2007年10月30日 星期二 23:18
去参阅下那几个 python 的版本管理系统?
Zeuux © 2025
京ICP备05028076号