Python Workshops for Beginners/Saturday September 27th homework: Difference between revisions

Line 24:
To get started, import the two modules which provide the character list and text of the play:
<pre>
>>> import characters from summerChar
>>> import lines from summerNight
</pre>
 
Note: characterCharacter names are stored in the form <NAME>, which is how their parts are represented in the script.
To access the list of characters, set the following variable:
<pre>
>>> characters = summerChar.lines
</pre>
 
ToEach access the textline of the play as a list (each line is an entry in the list):.
Note: character names are stored in the form <NAME>, which is how their parts are represented in the script.
 
To access the text of the play as a list (each line is an entry in the list):
<pre>
>>> lines = summerNight.lines
</pre>
 
 
Anonymous user