# from lxml import etree;
import module2dbk;
print module2dbk.xsl_transform(etree.parse('test-ccap/col10614/index.cnxml'), []);
Error: bash: syntax error near unexpected token `('
4 Answers
Well I had exactly the same problem. I had tried everything and nothing really worked. My program was running perfectly on Windows command prompt, and on my iPhone Python app interpreter, but not on my Macbook's terminal, where I always got the following error whenever I tried to run the program:
bash: syntax error near unexpected token `('
Finally the comment above from the user tripleee helped me come up with a solution; although his solution of adding !/usr/bin/python at the very start of my code didn't do it for me it helped me understand as he wrote that:
The error message indicates that the script gets executed by bash, not python.
Then I noticed that my code(extra).py contained '(' apostrophes, I renamed to my codeextra.py and that was it, problem solved. :)
#!/usr/bin/pythonas the first line of the file. - tripleee