Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #!/usr/bin/env python
  2. from modules.charlist import Charlist
  3. import curses
  4.  
  5. def main(stdscr):
  6. # Curses
  7. height, width = stdscr.getmaxyx()
  8. stdscr.border(0)
  9.  
  10. # Character list
  11. charlist = Charlist()
  12. charlist.newcharacter('Sam', [{'name': 'Hitpoints'}, {'name': 'Mana'}])
  13. charlist.newcharacter('Jack', [{'name': 'Hitpoints'}, {'name': 'Mana'}])
  14.  
  15. # Print to screen
  16. pad = curses.newpad(100,width - 2)
  17. line = 1
  18. for character in charlist.chars:
  19. pad.addstr(line, 1, character.name)
  20. line += 1
  21. pad.refresh(0,0, 2,1, height - 4, width - 2)
  22. stdscr.refresh()
  23. stdscr.getch()
  24.  
  25. if __name__ == '__main__':
  26. curses.wrapper(main)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement