You cannot import robot keywords into a python file. If you have a python-based keyword that needs to call keywords written in the robot syntax, then you need to use the "Run keywords" keyword. The technique for using built-in keywords from python is shown in the user guide here:
http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#using-builtin-library
You can either import the .txt file in your test before calling the python keyword, or you can have your python keyword load it for you using the "Import Resource" keyword, also in the built-in library.
For example:
# ext.py
from robot.libraries.BuiltIn import BuiltIn
def custom_keyword():
...
BuiltIn().load_resource("test.txt")
BuiltIn().run_keyword("the_keyword", "arg1", "arg2")
...