I am working on a python app to create an interface for a script(ish) visual novel framework. For now, I was able to read the file, create the labels or functions but when I read them, it just reads one line. Sort of like this:
>>> from freddie import Freddie
>>> check = Freddie()
>>> check.read_script('script')
>>> check.read_label('start')
'label start:\n' # Only reads the first line and the whitespace
And the entire label is:
label start:
test "Lorem ipsum"
test "Sir amet"
return
My function is:
def read_label(self, label):
search_label = re.search("label %s(.*)\s" % label, self.scripts.read(), re.MULTILINE)
return search_label.group()
Is there a way to make the regular expression read the entire label and the whitespace?
Thanks for your time.