- 论坛徽章:
- 0
|
SVN URL: https://secure.simplistix.co.uk/svn/xlrd/trunk
revision: 4774 ***CHANGED*** (bug fix needed)
Installation: cd to your checkout directory and do /wherever/it/is/python setup.py install
sample xls file: attached
sample interactive session:
>>> import xlrd
>>> b = xlrd.open_workbook('hlink_example.xls')
>>> s = b.sheet_by_index(0)
>>> len(s.hyperlink_list)
9
>>> for h in s.hyperlink_list:
... h.dump(header = 60 * '-')
...
------------------------------------------------------------
desc: u'example description (e-mail)'
fcolx: 1
frowx: 1
lcolx: 1
lrowx: 1
type: u'url'
url_or_path: u'mailto:foo@bar.com?subject=xlrd%20better%20than%20sliced%20bread%20and%20WD40'
------------------------------------------------------------
desc: u'python.org website'
fcolx: 1
frowx: 2
lcolx: 1
lrowx: 2
type: u'url'
url_or_path: u'http://www.python.org/'
------------------------------------------------------------
desc: u'top left cell in 2nd sheet'
fcolx: 1
frowx: 3
lcolx: 1
lrowx: 3
textmark: u'Sheet2!A1'
type: u'workbook'
------------------------------------------------------------
desc: u'sample local file'
fcolx: 1
frowx: 4
lcolx: 1
lrowx: 4
type: u'local file'
url_or_path: 'dummy.txt'
------------------------------------------------------------
desc: u'desc of UNC file'
fcolx: 1
frowx: 5
lcolx: 1
lrowx: 5
type: u'unc'
url_or_path: u'\\\\MACHINENAME\\c:\\xlrd\\hyperlinks\\dummy.txt'
------------------------------------------------------------
desc: u'struct format parameters'
fcolx: 1
frowx: 6
lcolx: 1
lrowx: 6
textmark: u'format-characters'
type: u'url'
url_or_path: u'http://docs.python.org/library/struct.html'
------------------------------------------------------------
desc: u'4th char of name is U+00E4'
fcolx: 1
frowx: 7
lcolx: 1
lrowx: 7
type: u'local file'
url_or_path: u'fub\xe4r.txt'
------------------------------------------------------------
desc: u'Sheet3!A1:Z99'
fcolx: 1
frowx: 8
lcolx: 1
lrowx: 8
textmark: u'Sheet3!A1:Z99'
type: u'workbook'
------------------------------------------------------------
desc: u'http://www.foo.com'
fcolx: 1
frowx: 9
lcolx: 1
lrowx: 9
type: u'url'
url_or_path: u'http://www.foo.com/'
hlink_example.zip
(2.71 KB, 下载次数: 27)
|
|