error using pywinauto
Question: I am new to python and have just installed pywinauto using easy_install.

I am trying to execute a simple code as follow:

    
    
    from pywinauto import application
    app = application.Application.start ('notepad.exe')
    Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
    AttributeError: type object 'Application' has no attribute 'start'
    

As you see I am getting an error. I tried searching for an answer for this on
the web but could not find out why this is happening.

Please help. thanks in advance.

VG


Answer: Pywinauto is very confused about the naming convention used (I know - I wrote
it!).

There are two choices:

a) create an instance of the Application class first and then call start() on
it.

    
    
    >>> from pywinauto import Application
    >>> app = Application()
    >>> app.start('notepad.exe')
    <pywinauto.application.Application object at 0x022991B0>
    >>> app.UntitledNotepad.MenuItem("File -> Exit").Select()
    

b) call the Application.Start() class method. (starts with uppercase 'S')

    
    
    >>> app = Application.Start('Notepad')
    >>> app.UntitledNotepad.MenuItem("File -> Exit").Select()
    

Option b) is less typing :)

