diff --git a/apa b/apa index e7dffe9c0cc8ffa7280926edea9d773e6f178695..cc9ca8db2e9177a3a2c54a99086c4049a05e23ab 100755 --- a/apa +++ b/apa @@ -2,7 +2,7 @@ """ Anders Python Archiver -Copyright (C) 2004-2009 Anders Blomdell <anders.blomdell@control.lth.se> +Copyright (C) 2004-2019 Anders Blomdell <anders.blomdell@control.lth.se> A small utility program to join a number of python modules into a single executable python program. @@ -54,6 +54,10 @@ if __name__ == '__main__': optParser.add_option('-d','--documentation', action='store_true', help='Show documentation') + optParser.add_option('--interpreter', + default=None, + action='store', + help='Interpreter to use') optParser.add_option('-o','--output', action='store', help='Name of archive') @@ -98,13 +102,15 @@ if __name__ == '__main__': # Emit code interpreter = code[0][2].splitlines()[0] - if interpreter.find("python") >= 0: + if options.interpreter != None: + print >> apa, "#!%s" % options.interpreter + elif interpreter.find("python") >= 0: # Take interpreter version from main file print >> apa, interpreter else: # Default interpreter - print >> sys.stderr, "Interpreter defaulting to '#!/usr/bin/python'" - print >> apa, "#!/usr/bin/python" + print >> sys.stderr, "Interpreter defaulting to '#!/usr/bin/python3'" + print >> apa, "#!/usr/bin/python3" print >> apa, "\"\"\"" print >> apa, "Executable archive of '%s'" % code[0][0] print >> apa, "\nThe following modules are archived:"