chinesepython-users Mailing List for ChinesePython
Status: Beta
Brought to you by:
glace
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
---|
From: glace <gl...@ch...> - 2002-11-18 15:00:00
|
不起, 又回覆晚了 ^_^ 我理解的你是想把 --------------------------------------------------------------- data.txt --------------------------------------------------------------- 1.3, 4.5, 3.24, 7.8, 0.01, 13, 14., -5.6 5.3, 2.5, 3.12, 4.8, 17, 19 21, 22.3 ...... . . . --------------------------------------------------------------- 文件到一序列中, 可以: --------------------------------------------------------------- getdata.py --------------------------------------------------------------- text = open("data.txt").read() #全部, 分行先不理 text = text.replace('\r\n\','') #全部行替 text = text.replace('\n','') #如果 linux 要替的是 '\r' data = text.split(',') #按 ',' 把字串分拆成序列 data = map(float, data) #把全部字符串成浮 #便 data 做操作好了. --------------------------------------------------------------- 用中蟒的法 --------------------------------------------------------------- 字串 = 打("data.txt").入() 字串 = 字串.替('\r\n','') 字串 = 字串.替('\n','') 料 = 字串.分割(',') 料 = (浮,料) --------------------------------------------------------------- 祝你成功. glace ----- Original Message ----- From: "freelamp" <FRE...@Ho...> To: <gl...@ch...> Sent: Friday, November 16, 2001 9:42 AM Subject: 问个问题/ > 您好: > 我又来向您请教啦/不好意思 > > 我想编个程序来处理大量的数据,但又不想在命令行上一个一个的敲,我就想到先把 数据存成TXT文件 > 再使用OPEN()就行了。 > > 但问题是:我用“,”做分隔,如何读取平面数据文件然后转成一个序列(链表)? ??(用的是浮点数字) > > 学PYTHON的过程是很有趣的,如果我能用它解决生活中的问题就更有趣啦。 > > 谢谢您的帮助。 > |
From: glace <gl...@ch...> - 2002-10-29 12:31:45
|
你好, 不好意思這麼晚才回信。因為我沒有用 Windows 2000 的經驗。 終於找到了人借了 Windows 2000 來試。的確是麻煩。 因為在 Win95/98/ME 下 DOS 視窗都可以直接顯示 big5 的中文字但 Windows 2000 和 XP 的 DOS 視窗則看不到。 大概是因為該系統的預設中文編碼是 Unicode 所以大五碼 會變成亂碼。 解決方法: 把下載的 chinesepython0-3.14.zip 解壓到某目錄下(假設為 d:\)。然後 打開 DOS 視窗, 鍵入: -------------------------------------------------- c:\> d: d:\> cd chines~1 d:\> cpython.exe tools\pyshell\pyshell.py -------------------------------------------------- 這個程式會調用 wxPython 介面庫中的函數打開一個視窗讓你以互動方式操作中蟒。 至於寫程式時則可以用像 notepad.exe 的編輯工具。存成文字檔後可以如此執行: -------------------------------------------------- d:\> cpython.exe myprog.py -------------------------------------------------- 但同樣,雖然能輸出中文字但在 DOS 視窗下看到的只是亂碼。解決方法有二: 1. 改程式, 調用 wxPython 把結果輸出到另一個視窗中。可以參考 pyshell.py 中 的寫法。 2. 執行 pyshell.py,然後用 ">>> import myprog" 的方法執行你的程式。 我試過,應該沒問題。就是挺煩的。日後等中蟒支授 Unicode 後就好了。 至於你信中所說的 1. 和 2. 我都沒有試,因此沒什麼心得。抱歉。 基本上我是在 Linux 下做移植工作的,有些 Windows 環境要注意的事我不很清楚。如 果再找到什麼問題,希望你能告訴我。 glace ----- Original Message ----- From: "陳伯昭" <che...@pc...> To: <gl...@ch...> Sent: Saturday, October 26, 2002 2:44 PM Subject: 請問如何安裝中文Python ? > Glace您好,我是使用Big5碼的Python 初學者。 > 我在安裝Python 中文上遇上很大的問題,想要麻煩您的幫忙 > 1.『python221-win32』在Windows2000中,安裝正常,但是顯示的字體為亂碼,結果 造成我無法辨識程式的功能。 > 2.『chinesepython-BIG5-setup』在Windows2000中無法安裝〈安裝後,電腦沒有作 任何執行的動作。〉 > 3.『chinesepython0-3.14.zip』由中蟒網站連到Python 外國的官方網站,結果程式 解壓縮後,我不知道該如何執行程式。 > 請回信或是放在網頁上回覆,謝謝。 |
From: glace <gl...@us...> - 2002-07-21 04:50:52
|
----- Original Message ----- From: "Zoom.Quiet" <zo...@it...> To: "glace" <gl...@ww...> Sent: Thursday, July 18, 2002 9:17 AM Subject: "cpython -g" is roght! glace,Hollo! thanx for u answer! download "中蟒入门" 原来早已有提示的! 谢谢! u welcome answer my foo question! but ,进一步使用pyshell.py 时报错:: " 来自 "E:\LAMPS\Python\chinesepython\Tools\pyshell\pyshell.py", 第 1 行的 wxPython.wx 更 * ^ 句法异常: 不合法的句法" soso ?! what can i do for it? ===> 在 2002-07-17 22:38:00 您写道: >你好, 这迟才回你对不起. 本讯息和'共创联盟'上中蟒论坛的回覆相同. > >Well.... > >First try start the interpreter by >c:\cpython -g >(this tells chinesepython to start in GBK mode) >and see if the display is corrected. > >ChinesePython currently support BIG5 and GBK encodings only, no native >unicode support in the current version. I don't have a win2000 server to >test with, but if both -b/-g aren't working, most probably you are stucked >:( > >I'm working on the newer version that I hope to include an unicode table. >You can wait, OR, he he, why not try Linux ! ^_^ > >glace > >(sorry for the late reply, I went to the Philipines and was totally blocked >to the internet world.) > >----- Original Message ----- >From: "Zoom.Quiet" <zo...@it...> >To: "gl...@us..." <gl...@ww...> >Sent: Friday, July 12, 2002 3:00 PM >Subject: "中文编程论战" > > >glace > こんにじわ: > "中蟒大杂院 " 进不了了! >但是,想来想去有话讲,so mail u! >"中文编程论战" :: > 为什么有那么多人会反感, 中文化的程序语言?! >一来, 先入为主的下意识认为 中文化的 不正宗; >二来, 害怕失去优越感, 突然间密码一样的程序原代码变成了政府公文一样的东 东, >就没有办法 >蒙骗不懂的领导了! > >其实, 在祖冲之 的年代, 先哲们就已经开始使用中文程式演算三元方程式了! 那 会 >的变量名都是天干地支的名字, 实际上, 整个周易学说, 也是一种程式演算 是也 乎 >!!! > >所以, 如果可以借用Python 将现代的对象思想, 提升并实用化古老的 数算技法, >对象中华文明的进化 功德无量 是也乎!!!! > >所以, 不要在意, 对于中蟒 的非意! 迅速推出应用中实现的工具, 是让非难不 >攻而破的正途! > > >ps. >win2000 server 中安装 中3.14; >启动后乱码?! > >" >[e:\lamps\python\chinesepython]cpython >い怜 (Python いゅ)2.1.1 (#20, Apr 28 2002, 16:53:43) [MSC 32 bit (Intel)] >on win32 >龄 "", "伙谅", "ㄏノ谍" 戈. >>>> help >萝 (抖): > 郎 "<夹非块>", 材 1 ? >嘿钵: Τ 'help' 跑计 >>>> >" > >what happen?! >how can i make it right?! > >thanx for all! > > >Good > 2002 summer... > > u turely Zoom.Quiet > >Zo...@so... >or >Zo...@fm... > >>>> 2002-07-12 15:20:21 > >/==========================================\ >|> Time is unimportant,only life important! >\==========================================/ = = = = = = = = = = = = = = = Good 2002 summer... u turely Zoom.Quiet Zo...@so... or Zo...@fm... >>> 2002-07-18 09:17:12 /==========================================\ |> Time is unimportant,only life important! \==========================================/ |
From: marr <ma...@li...> - 2002-04-30 12:05:09
|
hi ... I'm a Python/Zope fan, also a member of Software Liberty Association of Taiwan. Glad to see your great work on chinese python. Right now, some Python/Zope folks are running a website and mailing list here, please take a look at http://zope.slat.org/ (big5 encoding pages) We'd like to host some Python/Zope/Chinese projects on our site, and see if any chance to invite chinese python to be hosted on zope.slat.org. zope.slat.org is a Linux box hosted in academia sinica, where provides quite satisfying bandwidth and storage for Open Source projects. At least, we can provide mirror service. Best regards, -- Penelope Marr 馬兒 <marr at softwareliberty.org> http://zope.slat.org/Members/marr ICQ: 45274679 |