You can use the functions provided by os.path for handling pathnames independendly from a platform.
import bpy
import os
filepath = bpy.data.filepath
directory = os.path.dirname(filepath)
print(directory)
To add a file to the basename you could use os.path.join:
newfile_name = os.path.join( directory , "newfile.blend")