def run_file_or_script (script=None, file_name='script_from_command_line',
                        argv=None, params=None, **kwargs):
    """Main entry point for bin/ayrton and unittests."""
    runner= Ayrton (**kwargs)

    if params is None:
        params= ExecParams ()

    if script is None:
        v= runner.run_file (file_name, argv, params)
    else:
        if not isinstance(script, bytes):
            # the problem here it's that the parser expects the source as bytes
            # so we must encode the source before passing it
            script = script.encode()
        v= runner.run_script (script, file_name, argv, params)

    return v