python - syntax error near unexpected token `check_call' . Syntax error in terminal -
i'm trying enter command in mac terminal
#!/usr/bin/env python sys import argv subprocess import check_call os.path import basename, dirname, splitext, join tempfile import namedtemporaryfile app = argv[-1] ldid_path = join(dirname(__file__), 'ldid') obj_path = join(app, splitext(basename(app))[0]) if '-gta' not in argv: check_call([ldid_path, '-s', obj_path]) else: namedtemporaryfile('w+b', 0) f: f.write(""" <!doctype plist public "-//apple//dtd plist 1.0//en" "http://www.apple.com/dtds/propertylist-1.0.dtd"> <plist version="1.0"> <dict> <key>get-task-allow</key> <true/> </dict> </plist> """) f.flush() check_call([ldid_path, '-s' + f.name, obj_path])
but got error:
imac-oleg:ldid olegmelnik$ f.flush()
check_call([ldid_path, '-s' + f.name, obj_path]) -bash: syntax error near unexpected token `check_call'
how fix this? much...
in check_call raise calledprocesserror(retcode, cmd) subprocess.calledprocesserror: command '['/users/olegmelnik/desktop/ldid', '-s', '/users/olegmelnik/desktop/ldid3.py/ldid3']' returned non-zero exit status 1
this check_call
does. if don't want that, don't use check_call
. see subprocess
documentation more information.
Comments
Post a Comment