title: Syntax Error ncurses + python3
body: <p>I've been trying to make my first program in Python 3 with Ncurses and I'm stuck trying to figure out this syntax error. I'm trying to build the ncurses menu topbar menu and I'm getting the following error;</p>
  
  <pre><code>s.refresh()  c = s.getch()  
               ^
  SyntaxError: invalid syntax
  </code></pre>
  
  <p>I've been trying learn off from here <a href="http://www.ibm.com/developerworks/library/l-python6/#h3" rel="nofollow noreferrer">http://www.ibm.com/developerworks/library/l-python6/#h3</a> but I cannot figure out why I'm getting syntax error with this. It happens with both <code>Python 3.4.0</code> and <code>Python 2.7.6</code> when I test it out. Also the menu's aren't rendering when I do go to test it out. I get nothing displaying at all. I'm just trying to make a simple program with very basic functions, nothing too special.</p>
  
  <p>The problem is this piece of ncurses code when I try to add it to my own python script</p>
  
  <pre><code>def file_func():
      s = curses.newwin(5,10,2,1)
      s.box()
      s.addstr(1,2, "I", hotkey_attr)
      s.addstr(1,3, "nput", menu_attr)
      s.addstr(2,2, "O", hotkey_attr)
      s.addstr(2,3, "utput", menu_attr)
      s.addstr(3,2, "T", hotkey_attr)
      s.addstr(3,3, "ype", menu_attr)
      s.addstr(1,2, "", hotkey_attr)
      s.refresh()  c = s.getch()  
      if c in (ord('I'), ord('i'), curses.KEY_ENTER, 10):
          curses.echo()
          s.erase()
          screen.addstr(5,33, " "*43, curses.A_UNDERLINE)
          cfg_dict['source'] = screen.getstr(5,33)
          curses.noecho()
      else:
          curses.beep()
          s.erase()
      return CONTINUE
  </code></pre>
  
  <p>Here's what the current output looks like before trying to add the menu, before I got syntax error on the above code example at <code>s.refresh() c = s.getch()</code> line.</p>
  
  <p><img src="https://i.stack.imgur.com/Oh4rz.png" alt="preview example of output before trying to add menu">
  The is first time trying something like this in Python3 and Ncurses, I wanted to give it a go to see what I can do to make a simple functional program. ALso I'm not too sure how to customize the output more with Ncurses, I did want to change the colors and put a background fill to the boxed window it created, but not too sure on that, the tutorials I've read don't make it too clear on how to implement this into Python. Not too sure if I can just bundle it all into one script which is the main idea approach to this.</p>