Skip to content

Instantly share code, notes, and snippets.

@semeltheone
Created June 6, 2013 05:33
Show Gist options
  • Save semeltheone/5719526 to your computer and use it in GitHub Desktop.
Save semeltheone/5719526 to your computer and use it in GitHub Desktop.
Get code completion for a specific position in a given python file.
from rope.base.project import Project
from rope.contrib.codeassist import code_assist
project = Project('.')
mod1 = project.get_file('mod1.py')
pos = 20
codeCompletions = code_assist(project,mod1.read(),pos+4,resource=None,maxfixes=10)
for cc in codeCompletions:
print cc
def test():
a = "x".
b = a*2
c = a+b
return c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment