Ask a Question

Python Variable Auto Completion

SOLVED
poffin
Occasional Contributor

Python Variable Auto Completion

I have the same question as a previous poster: https://community.smartbear.com/t5/Desktop-Testing/Python-and-IDE-auto-complete/m-p/104937/highlight...

 

I'm switching from a JavaScript project to a Python project and there's one feature that I really miss. 

 

 

var aLongVariableName = Sys.Process("chrome");
aLo

If I were to type this into a TestComplete javascript project the IDE would suggest the name of the variable before I finished typing it.

 

 

 

anotherLongVariableName = Sys.Process("chrome")
ano

If I were to write the above code in Python, I would not be offered the name of the previously defined variable. Does the python IDE just not have this functionality, or perhaps if I declare it a special way I could get my auto completion back?

 

2 REPLIES 2
baxatob
Community Hero

Hi,

 

Unfortunately, in TestComplete IDE auto-completion for python works only if variable was declared or imported on the top level of the module:

 

from some_module import variable1

variable2 = 222


class A:
    def __init__(self):
        self.variable3 = 333


def foo():
    variable4 = 444


'''
Auto completion will work only for variable1 and variable2
'''

You can create the feature request for this case.

poffin
Occasional Contributor

Thank you for the thorough reply!

cancel
Showing results for 
Search instead for 
Did you mean: