I found under this link good information about running python scripts from blender. This is something that is not solved sufficiently in blender. There is no concept of a working directory, users are motivated to place all their scripts in a special directory. This is however not very practical if you have different projects that you would like to have separated.
filename = os.path.join(os.path.basename(bpy.data.filepath), "myscript.py")
exec(compile(open(filename).read(), filename, 'exec'))