0

i installed alchemyAPI with python 2.7 on the desktop and it runs perfectly but when i saved the file to a live server whenever i try running the example files on aclemy i got the error. "Syntax Error near unexpected token `('" I checked the syntax python syntax and its okay. The syntax error is in creating the instance of the object.I want to ask if there is something wrong with the syntax. I am not an expert of AlchemyAPI in python.Thank You.

# Load the AlchemyAPI module code.
import AlchemyAPI            
# Create an AlchemyAPI object.
alchemyObj = AlchemyAPI.AlchemyAPI()
Daniel Roseman
  • 588,541
  • 66
  • 880
  • 895
Oliver Ven Quilnet
  • 461
  • 1
  • 4
  • 4

1 Answers1

0

The error message Syntax Error near unexpected token('` is a bash error, not a Python one. You appear to be typing this code into the bash shell rather than into Python.

Daniel Roseman
  • 588,541
  • 66
  • 880
  • 895
  • Yes i am actually accessing this on a shell, do you have any suggestions? what is the best way to run a script of python into a live server. I am using web2py python framework and turnkey linux as server. – Oliver Ven Quilnet Jul 26 '13 at 03:00
  • If you want to type in Python code directly, you need to do it from within Python, not from bash. You can start Python by typing `python`. I have no idea what web2py has to do with this, nor what "run a script into a live server" means. – Daniel Roseman Jul 26 '13 at 03:09
  • Or what is the best way to implement python on a server – Oliver Ven Quilnet Jul 26 '13 at 03:10
  • If you're using web2py, you should follow its documentation on deploying it to a server, which appears to be [here](http://www.web2py.com/books/default/chapter/29/13/deployment-recipes). – Daniel Roseman Jul 26 '13 at 03:17