py2exe + pywinauto + sendkeys issue

Discussion in 'Python' started by hellt, Mar 17, 2008.

  1. hellt

    hellt Guest

    Hi all
    i have a problem with this modules py2exe + pywinauto + sendkeys used
    together.

    In my script i'm using this expression
    app.window_(title="SJphone").Edit.TypeKeys("Test is
    running",with_spaces=True)

    TypeKeys is using SendKeys module i suppose.

    my setup.py looks like that:

    from distutils.core import setup
    import py2exe

    setup(
    options = {"py2exe": {"compressed": 1,
    "optimize": 0,
    "bundle_files": 1,
    "packages": ["encodings", "pywinauto",
    "pywinauto.controls", "pywinauto.tests"] } },
    zipfile = None,
    console=["hosts.py"]
    )



    and when i'm trying to run my hosts.exe i'm getting this traceback


    Traceback (most recent call last):
    File "hosts.py", line 524, in <module>
    main()
    File "hosts.py", line 517, in main
    TestCase3_1()
    File "hosts.py", line 421, in TestCase3_1
    SJstart()
    File "hosts.py", line 36, in SJstart
    app.window_(title="SJphone").Edit.TypeKeys("Test is
    running",with_spaces=Tru
    e)
    File "pywinauto\controls\HwndWrapper.pyc", line 928, in TypeKeys
    NameError: global name 'SendKeys' is not defined


    are there any workarounds on that?
     
    hellt, Mar 17, 2008
    #1
    1. Advertising

  2. En Mon, 17 Mar 2008 08:56:26 -0200, hellt <> escribi�:

    > i have a problem with this modules py2exe + pywinauto + sendkeys used
    > together.
    >
    > In my script i'm using this expression
    > app.window_(title="SJphone").Edit.TypeKeys("Test is
    > running",with_spaces=True)
    >
    > TypeKeys is using SendKeys module i suppose.


    Does it work as a normal script, without using py2exe?

    > my setup.py looks like that:
    >
    > from distutils.core import setup
    > import py2exe
    >
    > setup(
    > options = {"py2exe": {"compressed": 1,
    > "optimize": 0,
    > "bundle_files": 1,
    > "packages": ["encodings", "pywinauto",
    > "pywinauto.controls", "pywinauto.tests"] } },
    > zipfile = None,
    > console=["hosts.py"]
    > )


    Perhaps you have to include SendKeys explicitely. I think pywinauto
    doesn't require SendKeys, but uses it if already installed.

    --
    Gabriel Genellina
     
    Gabriel Genellina, Mar 17, 2008
    #2
    1. Advertising

  3. hellt

    hellt Guest

    On 17 мар, 15:48, "Gabriel Genellina" <> wrote:
    > En Mon, 17 Mar 2008 08:56:26 -0200, hellt <> escribi�:
    >
    > > i have a problem with this modules py2exe + pywinauto + sendkeys used
    > > together.

    >
    > > In my script i'm using this expression
    > > app.window_(title="SJphone").Edit.TypeKeys("Test is
    > > running",with_spaces=True)

    >
    > > TypeKeys is using SendKeys module i suppose.

    >
    > Does it work as a normal script, without using py2exe?
    >
    > > my setup.py looks like that:

    >
    > > from distutils.core import setup
    > > import py2exe

    >
    > > setup(
    > > options = {"py2exe": {"compressed": 1,
    > > "optimize": 0,
    > > "bundle_files": 1,
    > > "packages": ["encodings", "pywinauto",
    > > "pywinauto.controls", "pywinauto.tests"] } },
    > > zipfile = None,
    > > console=["hosts.py"]
    > > )

    >
    > Perhaps you have to include SendKeys explicitely. I think pywinauto
    > doesn't require SendKeys, but uses it if already installed.
    >
    > --
    > Gabriel Genellina


    i tried this:

    "packages": ["encodings", "pywinauto", "SendKeys",
    "pywinauto.controls", "pywinauto.tests"]

    But there was an error too(
     
    hellt, Mar 17, 2008
    #3
  4. hellt

    hellt Guest

    On 17 мар, 15:48, "Gabriel Genellina" <> wrote:
    > En Mon, 17 Mar 2008 08:56:26 -0200, hellt <> escribi�:
    >
    > > i have a problem with this modules py2exe + pywinauto + sendkeys used
    > > together.

    >
    > > In my script i'm using this expression
    > > app.window_(title="SJphone").Edit.TypeKeys("Test is
    > > running",with_spaces=True)

    >
    > > TypeKeys is using SendKeys module i suppose.

    >
    > Does it work as a normal script, without using py2exe?
    >
    > > my setup.py looks like that:

    >
    > > from distutils.core import setup
    > > import py2exe

    >
    > > setup(
    > > options = {"py2exe": {"compressed": 1,
    > > "optimize": 0,
    > > "bundle_files": 1,
    > > "packages": ["encodings", "pywinauto",
    > > "pywinauto.controls", "pywinauto.tests"] } },
    > > zipfile = None,
    > > console=["hosts.py"]
    > > )

    >
    > Perhaps you have to include SendKeys explicitely. I think pywinauto
    > doesn't require SendKeys, but uses it if already installed.
    >
    > --
    > Gabriel Genellina


    pywinauto uses sendkeys when performs TypeKeys function.
    when i include sendkeys to my package's list i have an error posted
    below:

    "No module named SendKeys"
     
    hellt, Mar 17, 2008
    #4
  5. hellt

    hellt Guest

    On 17 мар, 20:22, hellt <> wrote:
    > On 17 мар, 15:48, "Gabriel Genellina" <> wrote:
    >
    >
    >
    > > En Mon, 17 Mar 2008 08:56:26 -0200, hellt <> escribi�:

    >
    > > > i have a problem with this modules py2exe + pywinauto + sendkeys used
    > > > together.

    >
    > > > In my script i'm using this expression
    > > > app.window_(title="SJphone").Edit.TypeKeys("Test is
    > > > running",with_spaces=True)

    >
    > > > TypeKeys is using SendKeys module i suppose.

    >
    > > Does it work as a normal script, without using py2exe?

    >
    > > > my setup.py looks like that:

    >
    > > > from distutils.core import setup
    > > > import py2exe

    >
    > > > setup(
    > > > options = {"py2exe": {"compressed": 1,
    > > > "optimize": 0,
    > > > "bundle_files": 1,
    > > > "packages": ["encodings", "pywinauto",
    > > > "pywinauto.controls", "pywinauto.tests"] } },
    > > > zipfile = None,
    > > > console=["hosts.py"]
    > > > )

    >
    > > Perhaps you have to include SendKeys explicitely. I think pywinauto
    > > doesn't require SendKeys, but uses it if already installed.

    >
    > > --
    > > Gabriel Genellina

    >
    > pywinauto uses sendkeys when performs TypeKeys function.
    > when i include sendkeys to my package's list i have an error posted
    > below:
    >
    > "No module named SendKeys"




    ok.. all is ok.
    i have just reinstall sendkeys.
     
    hellt, Mar 17, 2008
    #5
  6. En Mon, 17 Mar 2008 14:22:31 -0300, hellt <> escribió:
    > On 17 мар, 15:48, "Gabriel Genellina" <> wrote:
    >> En Mon, 17 Mar 2008 08:56:26 -0200, hellt <>
    >> escribi�:
    >>
    >> > i have a problem with this modules py2exe + pywinauto + sendkeys used
    >> > together.

    >>

    > pywinauto uses sendkeys when performs TypeKeys function.
    > when i include sendkeys to my package's list i have an error posted
    > below:
    >
    > "No module named SendKeys"


    Does your script actually work *without* py2exe?
    SendKeys is a separate package that you have to download and install
    separately.

    --
    Gabriel Genellina
     
    Gabriel Genellina, Mar 17, 2008
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike John

    How do I sendkeys

    Mike John, Jul 7, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    520
    Mike John
    Jul 7, 2003
  2. Replies:
    3
    Views:
    562
  3. Replies:
    0
    Views:
    443
  4. Mark Mc Mahon

    ANN: pywinauto 0.3.7 now released

    Mark Mc Mahon, Apr 10, 2007, in forum: Python
    Replies:
    0
    Views:
    408
    Mark Mc Mahon
    Apr 10, 2007
  5. 为爱而生
    Replies:
    0
    Views:
    382
    为爱而生
    Dec 17, 2008
Loading...

Share This Page