Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ʹÓÃPython¶ÁSEGYµÀÍ·

×Ô¼ºÓöµ½µÄÒ»¸öÎÊÌâ, WestGecoµÄ3DµØÕðÊý¾Ý, ÌáÈ¡µ¼º½Êý¾Ý:
#!/bin/env python
import sys
import struct
try:
        f=open(sys.argv[1],'rb')
except (IOError,Exception):
    print '''usage:
        scriptname segyfilename
'''
    sys.exit(1)
#skip EBCDIC header
try:
    f.seek(3200)
except Exception:
    print 'Oops! your file is broken..'
#read binary header
binhead = f.read(400)
ns = struct.unpack('>h',binhead[20:22])[0]
if ns < 0:
    print 'file read error'
    sys.exit(1)
#read trace header
while True:
    trchead = f.read(240)
    if trchead == '':
        break
    nav = trchead[224:228]+\
          trchead[228:232]+\
          trchead[200:204]+\
          trchead[204:208]+\
          trchead[60:64]
#define output format
    nl = struct.unpack('>5i',nav)
    print 'QL%-4d%9s%10.2f%10.2f%5s' % (nl[0], nl[1], nl[2]/100.0, nl[3]/100.0, nl[4])
    f.seek(ns*4,1)
f.close()


Ïà¹ØÎĵµ£º

ʹÓÃpython»ñÈ¡htmlÒ³ÃæµÄÄÚÈÝ

import urllib
from HTMLParser import HTMLParser
class TitleParser(HTMLParser):
def __init__(self):
self.title = ''
self.divcontent = ''
self.readingtitle = 0
self.readingdiv = 0
HTMLParser.__init__(self)
def handle_starttag(self, tag, attrs): ......

Install Python + Eric IDE


Install Python Eric IDE
1 Download following things
 
1) Python3.1
 
2) PyQt for python 3.1
(http://www.riverbankcomputing.co.uk/software/pyqt/download) I am using
PyQt-Py3.1-gpl-4.7.3-2.exe
 
3) Eric5 IDE
(http://eric-ide.python-projects.org/eric-download.html)
 
2 ......

»°ËµPython£¨ËÄ£©»¶Ó­Ð¡Âéȸ

С°×ÊǸö΢ÈíÃÔ£¬ËûµÄżÏñÊDZȶû´óÊ壬ԭÒòµ±È»ÊǵØÇòÈ˶¼ÖªµÀÀ²¡£´ó¶þµÄʱºò£¬ËûµÄ“ê¡Ñ§¼Æ»®”ÔøÒ»¶ÈµÃ³Ñ£¬Ô­ÒòÊÇËû¹Ò¿ÆÌ«¶à¡£µ±È»£¬´óÈýÐÂѧÆÚ¿ªÊ¼µÄʱºò£¬Ãæ¶Ô¹«ÖÚÖÊÒÉ£¬Ð¡°×Õ¾ÔÚÒÎ×ÓÉÏ£¬Ïñ¼«ÁË¡¶´óÄÚÃÜ̽ÁãÁã·¢¡·ÀïµÄÎ÷ÃÅ´µÑ©£º“ÊÀ½çÊ׸»±È²»Ò»¶¨Óжà³öÉ«£¬ÕâÖ»²»¹ýÊÇÄãÃÇÕâЩÐǶ·ÊÐÃñÒ»ÏáÇéÔ¸µÄÏë·¨° ......

ÊÖ¶¯ÖÆ×÷pythonµÄexe¿ÉÖ´ÐгÌÐò


1. ÊÖ¶¯ÖÆ×÷pythonµÄexe¿ÉÖ´ÐгÌÐò
                                      ×ªÔØ---------------
PythonûÓÐÄÚ½¨Ò»¸ö±à ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ