I am trying to create a python script script.py in bash and importing a bash script.
#!/usr/bin/env python
import os
import glob
from fnmatch import fnmatch
# importing a software
python_package = os.system("""#!/path_to_bin/bin/python \
from __future__ import print_function, division \
from python_toolbox.toolbox.some_toolbox import run \
if __name__ == '__main__': \
run()"""
# testing
greeting = "Hello world!"
print(greeting)
Running the script.py in python3
$python3 script.py
File "script.py", line 15
greeting = "Hello world!"
SyntaxError: invalid syntax
os.system(...has no closing paren. It's best to read your own code before asking others to read it for you.os.system(...call. Python figured that out on the next line.