def get_cmd(some_file, notebook_options=''):
 if some_file.endswith('.py'):
  command = 'python'
 elif some_file.endswith('.ipynb'):
  command = ('ipython notebook %s' % notebook_options)
 return command

def get_cmd ( some_file , notebook_options = '' ) : if some_file . endswith ( '.py' ) : command = 'python' elif some_file . endswith ( '.ipynb' ) : command = ( 'ipython notebook %s' % notebook_options ) return command
determines how to open a file depending on whether it is a .