I read through Add to python path mac os x and I figured doing that is a good idea, but still IDLE gives me a syntax error for a simple call of open(filename, mode)
, so I looked a little bit further and I found that I am able to do as stated in http://developer.apple.com/library/mac/#qa/qa1067/_index.html and set up an environment.plist in a .MacOSX folder, so I did that in my home dir and still no changes ... I am now lost :-)
Thats what I added as my python-path in .bash_profile and the same path in my environment.plist (without the :$PYTHONPATH):
PYTHONPATH="/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7:$PYTHONPATH"
export PYTHONPATH
EDIT: Thats where I get the syntax-Error... works fine in the interpreter
import xml.etree.ElementTree as et
import json
app = Bottle()
@app.route('/proPass', method ='POST')
#here happens here, need it further down in the code... which is not really relevant
f = open('/Users/mohi/Desktop/proPass_project/server_service/systems.xml', 'rw')
def getData():
timestamp = request.POST.get('timestamp', '').strip()
data = request.POST.get('data', '').strip()
if timestamp:
processData(data, timestamp)
run()
The error:
File "proPass_script.py", line 9
f = open('/Users/mohi/Desktop/proPass_project/server_service/systems.xml', 'rw')
^
SyntaxError: invalid syntax