Jump to content


Photo

Chapter 4, Page 129


  • Please log in to reply
1 reply to this topic

#1 chrisbruce

chrisbruce

    New Member

  • Members
  • Pip
  • 2 posts

Posted 27 March 2013 - 02:30 AM

Hello all,

Following the instructions on page 129 I made the adjustments to nester.py -
def print_lol(the_list, indent=False, level=0, fh=sys.stdout):
And my with statements -
with open('man_data.txt', 'w') as man_file:
nester.print_lol(man, fh=man_file)

But now i get the error -
def print_lol(the_list, indent=False, level=0, fh=sys.stdout):
NameError: name 'sys' is not defined

Anyone have any ideas?

Thanks.

#2 chrisbruce

chrisbruce

    New Member

  • Members
  • Pip
  • 2 posts

Posted 27 March 2013 - 02:43 AM

oh... fixed it...

Turns out i needed to add
import sys
to nester.py.

Probably should have googled it first!

Sorry guys.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users