| 6 | 1/1 | 返回列表 |
| 查看: 1365 | 回復(fù): 5 | |||
信任開花鐵桿木蟲 (知名作家)
|
[求助]
在vasp官方論壇看到一段如下代碼,不知道如何使用,請(qǐng)各位指教
|
|
就是讀取二進(jìn)制wavecar文件到,具體如下: For reading the header of the WAVECAR file, for example, you could do something like this: #!/usr/bin/python import sys def isprintable(char): return 0x256 <= char <= 0x16f def string(filename): data = open("/Working/Eclipse/plotting/WAVECAR", "rb" .read()count = 0 line = "" for ch in data: if isprintable(ch): count += 1 line = line + ch else: if count > 1 : print line count = 0 line= "" print line 裝啦python,就是不知道這幾行程序怎么對(duì)齊才能得到正確到wavecar到輸出,期待幫助。 |

木蟲 (小有名氣)
我們的自由!
|
#!/usr/bin/python import sys def isprintable(char): return 0x256 <= char <= 0x16f def string(filename): data = open("/Working/Eclipse/plotting/WAVECAR", "rb".read() count = 0 line = "" for ch in data: if isprintable(ch): count += 1 line = line + ch elseif count > 1 : print line count = 0 line= "" print line 試試吧 不確定對(duì),汗~ |
禁蟲 (正式寫手)
|
本帖內(nèi)容被屏蔽 |
鐵桿木蟲 (著名寫手)

專家顧問(wèn) (職業(yè)作家)
![]() |
專家經(jīng)驗(yàn): +83 |
鐵桿木蟲 (知名作家)

| 6 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 268求調(diào)劑 +7 | 好運(yùn)連綿不絕 2026-03-12 | 8/400 |
|
|---|---|---|---|---|
|
[考研] 085601材料工程專碩求調(diào)劑 +4 | 慕寒mio 2026-03-16 | 4/200 |
|
|
[考研] 302求調(diào)劑 +9 | 負(fù)心者當(dāng)誅 2026-03-11 | 9/450 |
|
|
[考研] 求調(diào)劑,總分315,考的生物醫(yī)藥,一志愿湖南師范大學(xué)。調(diào)劑到任何專業(yè)都可以 +4 | 小丁想進(jìn)步 2026-03-11 | 5/250 |
|
|
[考研] 材料與化工專碩調(diào)劑 +5 | heming3743 2026-03-16 | 5/250 |
|
|
[考研] 08工科 320總分 求調(diào)劑 +4 | 梨花珞晚風(fēng) 2026-03-17 | 4/200 |
|
|
[考研] 材料工程專碩274一志愿211求調(diào)劑 +6 | 薛云鵬 2026-03-15 | 6/300 |
|
|
[考研] 考研調(diào)劑 +3 | 淇ya_~ 2026-03-17 | 5/250 |
|
|
[考研] 0854控制工程 359求調(diào)劑 可跨專業(yè) +3 | 626776879 2026-03-14 | 9/450 |
|
|
[考研] 070300化學(xué)學(xué)碩求調(diào)劑 +6 | 太想進(jìn)步了0608 2026-03-16 | 6/300 |
|
|
[考研] 070303一志愿西北大學(xué)學(xué)碩310找調(diào)劑 +5 | d如愿上岸 2026-03-12 | 8/400 |
|
|
[考研] 294求調(diào)劑 +3 | Zys010410@ 2026-03-13 | 4/200 |
|
|
[考研] 255求調(diào)劑 +3 | 李嘉慧, 2026-03-12 | 4/200 |
|
|
[考研] 學(xué)碩285求調(diào)劑 +13 | Wisjxn 2026-03-12 | 46/2300 |
|
|
[考研] 304求調(diào)劑 +6 | Mochaaaa 2026-03-12 | 7/350 |
|
|
[考研] 求調(diào)劑(材料與化工327) +4 | 愛(ài)吃香菜啦 2026-03-11 | 4/200 |
|
|
[考研] 求材料調(diào)劑 085600英一數(shù)二總分302 前三科235 精通機(jī)器學(xué)習(xí) 一志愿哈工大 +4 | 林yaxin 2026-03-12 | 4/200 |
|
|
[考研] 281求調(diào)劑 +9 | Koxui 2026-03-12 | 11/550 |
|
|
[考研] 0856化學(xué)工程280分求調(diào)劑 +4 | shenzxsn 2026-03-11 | 4/200 |
|
|
[考研] 283求調(diào)劑,材料、化工皆可 +8 | 蘇打水7777 2026-03-11 | 10/500 |
|