Created
June 6, 2013 05:33
-
-
Save semeltheone/5719526 to your computer and use it in GitHub Desktop.
Get code completion for a specific position in a given python file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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