Hi,<br><br>For a start, using help isn&#39;t all that useful. Output for help of Versekey is contained in attached help.txt. Using dir will usually be just as much use. If I want to know how something works, I look at the c++ source code (which is quite an opaque mess, I think :) If you have doxygen generated, look at that. That may help a bit. A few of the methods are renamed, I think. ie 
SWModule.search becomes SWModule.doSearch<br><br>Also, I do not know that there is any way to check whether a module contains a certain book (though it probably doesn&#39;t if you go through a whole chapter and it is empty)
<br><br>To get all book names and chapter counts in old and new testaments:<br>__________________<br>#!/usr/bin/python2.5<br>import Sword<br>vk=Sword.VerseKey()<br><br>def GetBooks():<br>&nbsp;&nbsp;&nbsp; for i in range(2):<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for j in range(
vk.bookCount(i+1)):<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print vk.bookName(i+1, j+1),<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print &quot;has %d chapters&quot; % vk.chapterCount(i+1, j+1)<br><br>def GetChapters(i, j):<br>&nbsp;&nbsp;&nbsp; bookname=vk.bookName(i, j)<br>&nbsp;&nbsp;&nbsp; for k in range(
vk.chapterCount(i, j)):<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print &quot;%s %d has %d verses&quot; %&nbsp; (bookname, k+1, \<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vk.verseCount(i,j,k+1))<br><br>print GetBooks()<br>print GetChapters(1, 3) #old testament, 3rd book = Leviticus<br>
print GetChapters(2, 3) #new testament, 3rd book = Luke<br>__________________<br><br clear="all">An updated version of your script with my comments added on certain points:<br>__________________<br>#!/usr/bin/python2.5<br>
import Sword<br>import sys<br>#mgr=Sword.SWMgr()<br>#mgr.getModule(&#39;KJV&#39;)<br>vk=Sword.VerseKey()<br>error=0<br>cnt=1<br>while 1:<br>&nbsp;&nbsp; print &quot;cnt=%d&quot; % cnt<br>&nbsp;&nbsp; # use the following instead of a count as when the counter gets to Matthew, 
<br>&nbsp;&nbsp; # it automatically increments the testament and sets vk.Book() to 1<br>&nbsp;&nbsp; # ie <br>&nbsp;&nbsp; # &gt;&gt;&gt; vk=Sword.VerseKey()<br>&nbsp;&nbsp; # &gt;&gt;&gt; vk.Book(1)<br>&nbsp;&nbsp; # &#39;\x00&#39;<br>&nbsp;&nbsp; # &gt;&gt;&gt; vk.Testament()<br>
&nbsp;&nbsp; # &#39;\x01&#39;<br>&nbsp;&nbsp; # &gt;&gt;&gt; vk.Book(40)<br>&nbsp;&nbsp; # &#39;\x01&#39;<br>&nbsp;&nbsp; # &gt;&gt;&gt; vk.Book()<br>&nbsp;&nbsp; # &#39;\x01&#39;<br>&nbsp;&nbsp; # &gt;&gt;&gt; vk.Testament()<br>&nbsp;&nbsp; # &#39;\x02&#39;<br>&nbsp;&nbsp; # So we do this below:<br>
&nbsp;&nbsp; test=vk.Book(ord(vk.Book())+1) #use ord to change char -&gt; int<br>&nbsp;<span style="background-color: rgb(255, 255, 255);">&nbsp; cnt+=1</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);">
 &nbsp; &nbsp;error=</span><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">ord(vk.Error()) #with error, do error=ord(vk.Error()), this will output a number instead of a char<br>&nbsp;&nbsp; if(error):</span><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
break<br></span><span style="background-color: rgb(255, 255, 255);"> &nbsp; &nbsp;name=vk.getBookName()</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> &nbsp; &nbsp;abr=vk.getBookAbbrev
()</span><br># &nbsp; &nbsp;count=vk.bookCount()<br> &nbsp; &nbsp;print &quot;%s -&gt; %s &quot; %(abr,name)<br> &nbsp; &nbsp;print &quot;error=&quot;,error<br>&nbsp;&nbsp; print vk.Index()<br> &nbsp;&nbsp; #print vk.UpperBound().Index() #This is only for keys with bounds set
<br> &nbsp;&nbsp; #print vk.LowerBound().Index() #ditto<br>__________________<br><br>If you would like any other help, just ask.<br><br>God Bless,<br>Ben<br>-------------------------------------------------------------------------------------------
<br>He has made everything beautiful in its time. Also, he has put eternity into mans heart, yet so that he cannot find out what God has done from the beginning to the end.<br>Ecclesiastes 3:11 (ESV)
<br><br><div><span class="gmail_quote">On 1/30/07, <b class="gmail_sendername">Pierre Amadio</b> &lt;<a href="mailto:pierre.amadio@libertysurf.fr">pierre.amadio@libertysurf.fr</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi there.<br><br>On Sun, Jan 28, 2007 at 07:18:31PM +1100, Ben Morgan wrote:<br>&gt;<br>&gt; If you have any specific questions on how to do something, just email me.<br><br>I m copying the list as well as the answer may be interesting to have on
<br>the archive of the list.<br><br>I do not understand how to get a list of book that one can use in a<br>given module.<br><br>Using the following code, i have a sort of list of existing bible book:<br><br>__________________
<br>#!/usr/bin/python2.5<br>import Sword<br>import sys<br>#mgr=Sword.SWMgr()<br>#mgr.getModule(&#39;KJV&#39;)<br>vk=Sword.VerseKey()<br>error=0<br>cnt=0<br>while 1:<br>&nbsp;&nbsp;&nbsp;&nbsp;print &quot;cnt=%d&quot; % cnt<br>&nbsp;&nbsp;&nbsp;&nbsp;test=vk.Book
(cnt)<br>&nbsp;&nbsp;&nbsp;&nbsp;cnt+=1<br>&nbsp;&nbsp;&nbsp;&nbsp;error=vk.Error()<br>&nbsp;&nbsp;&nbsp;&nbsp;name=vk.getBookName()<br>&nbsp;&nbsp;&nbsp;&nbsp;abr=vk.getBookAbbrev()<br>#&nbsp;&nbsp;&nbsp;&nbsp;count=vk.bookCount()<br>&nbsp;&nbsp;&nbsp;&nbsp;print &quot;%s -&gt; %s &quot; %(abr,name)<br>&nbsp;&nbsp;&nbsp;&nbsp;print &quot;error=&quot;,error<br>
&nbsp;&nbsp;&nbsp;&nbsp;print vk.Index()<br>&nbsp;&nbsp;&nbsp;&nbsp;print vk.UpperBound().Index()<br>&nbsp;&nbsp;&nbsp;&nbsp;print vk.LowerBound().Index()<br>__________________<br><br>However, as my verse key does not know wich module i m interested in, i<br>cannot be sure all the book will be available for a given module (i
<br>think tere are some translation that are not complete).<br><br>Plus, I do not see any new testament book (except for revelation).<br><br>I cannot understand how to detect i reach the end of the books.<br><br>Bear in mind that, as my python version does not seem to implement
<br>help(), i guess what is available in the modules and object i have<br>with dir().<br><br>Before trying to understand every things related to text rendering, i<br>would be happy knowing how to:<br><br>-get a list of books in a module
<br>-get a list of chapter in a book<br>-get a list of verses in a chapter<br><br>I hope the 3 mechanism are similar :)<br><br>Best regards<br><br><br>_______________________________________________<br>sword-devel mailing list: 
<a href="mailto:sword-devel@crosswire.org">sword-devel@crosswire.org</a><br><a href="http://www.crosswire.org/mailman/listinfo/sword-devel">http://www.crosswire.org/mailman/listinfo/sword-devel</a><br>Instructions to unsubscribe/change your settings at above page
<br></blockquote></div><br>